Git Product home page Git Product logo

Comments (6)

okroth avatar okroth commented on August 11, 2024

I found that in lexer.lua, line 690, there IS a test for a shebang line, but it requires the line to begin with #! , where the Lua interpreter just requires the line to begin with # .

from luacheck.

linuxmaniac avatar linuxmaniac commented on August 11, 2024

please read #198

from luacheck.

alerque avatar alerque commented on August 11, 2024

I think this may be a case where Lua is wrong and we can ignore what it might have allowed. As far as I know the so called hashbang / shebang must actually be both characters to valid for the use case of specifying a script interpreter. Are there really any other valid use case that shouldn't throw a warning?

In any event if you still think this is an issue we should address, please open a new issue on the new official repository. As the previous commenter noted the maintainer of this one passed away and we have no way to resolve issues here any more. It would be appreciated if you close this to help us track what is dealt with and (if applicable) open a new issue on the active repository. Thanks!

from luacheck.

okroth avatar okroth commented on August 11, 2024

We have a different use case, where the first line contains a digital signature of the rest of the Lua script, which is hidden from the Lua interpreter by the #-character.
In the meantime we simply modified the lexer.lua in our copy to look only for the '#' and not the '!'

from luacheck.

alerque avatar alerque commented on August 11, 2024

I think a bit more orthodox way to do this would be to use a Lua comment, somewhat like luacheck does to pass cues to itself, something like:

-- signature: <hash>
print("rest of script")

Overloading the idea of a hashbang for this seems like an edge case that probably shouldn't be allowed. That Lua handles it is probably a mistake or lazy parsing shortcut and you might not want to rely on it.

Of course it is open source and you can do what you like, but as a the current maintainer I'm not convinced this is something we should accommodate in the regular releases.

from luacheck.

okroth avatar okroth commented on August 11, 2024

retrospectively, the comment would have been the better choice, but I can't change it any more.

from luacheck.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.