fab13n / metalua-parser

luarock packaging of Metalua's parser
47 stars 2 forks source link

Release as Lua 5.2 compatible #9

Open mpeterv opened 10 years ago

mpeterv commented 10 years ago

Currently the rock is marked as Lua 5.1 only in the rockspec. I'm using it for a very basic static checker and it works fine on Lua 5.2, too. So, it would be nice if it was released as Lua 5.2 compatible so that I could use it as a dependency without patching the rockspec.

fab13n commented 10 years ago

Already fixed in the (unreleased yet) 0.7.3 rockspec.

mpeterv commented 10 years ago

The rock is still marked as Lua 5.1 only, even in the 0.7.3 rockspec. lua ~> 5.1 means lua >= 5.1, < 5.2, it should be changed to lua >= 5.1, < 5.3 or just lua >= 5.1.

mpeterv commented 10 years ago

@fab13n I'm sorry to bother you again, but there is another problem with the current 0.7.3-2 rockspec - dependency on check is not mentioned, therefore, attempts to require() freshly installed rock result in error module 'checks' not found.

mpeterv commented 10 years ago

@fab13n it would be very nice to have this fixed, I can't release luacheck because of this... It is only needed to add checks to the list of dependencies. The fixed rockspec could look like this: https://gist.github.com/mpeterv/9756162

fab13n commented 10 years ago

It's not as simple: we'd like to make checks optional, because as a C package, it's annoying to pack and release under Win32. We're going to fix the code so that checks is used when available and stubbed when not. If you want to go faster than us you can either:

mpeterv commented 10 years ago

@fab13n I see. I think I'll add checks as dependency to my module for now. By the way it seems that checks could be reimplemented in Lua quite easily using the debug library.

mpeterv commented 10 years ago

@fab13n If you are interested, here is my attempt to make a pure Lua version of checks: https://gist.github.com/mpeterv/10748836. It should be fully compatible with it; in fact, it might work better than the original, which fails the small test suite found in the comments.