metalua-parser icon indicating copy to clipboard operation
metalua-parser copied to clipboard

Release as Lua 5.2 compatible

Open mpeterv opened this issue 11 years ago • 7 comments

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.

mpeterv avatar Mar 11 '14 19:03 mpeterv

Already fixed in the (unreleased yet) 0.7.3 rockspec.

fab13n avatar Mar 12 '14 11:03 fab13n

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 avatar Mar 20 '14 20:03 mpeterv

@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 avatar Mar 21 '14 18:03 mpeterv

@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

mpeterv avatar Mar 25 '14 06:03 mpeterv

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:

  • add a dependency on cheks on your own module
  • or add a stub function package.preload.checks() return function() end end

fab13n avatar Mar 25 '14 14:03 fab13n

@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 avatar Mar 25 '14 16:03 mpeterv

@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.

mpeterv avatar Apr 15 '14 17:04 mpeterv