You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
lua5.3: /usr/local/share/lua/5.3/lua-parser/parser.lua:478: attempt to get length of a number value (local 'sfail')
stack traceback:
/usr/local/share/lua/5.3/lua-parser/parser.lua:478: in function 'lua-parser.parser.parse'
<my code>
[C]: in ?
This issue does not occur with lua-parser 0.1.1-1. The parse function returns normally and error message is sourcefile.lua:1:13: syntax error, unexpected 'EOF', expecting 'end', 'return', '(', 'Name', 'goto', 'break', '::', 'local', 'function', 'repeat', 'for', 'do', 'while', 'if', ';'
The text was updated successfully, but these errors were encountered:
Thanks for the report @PhilipRoman! This issue was introduced by LPegLabel 1.5.0 and it indeed will happen to any invalid syntax, because now LPegLabel is returning the subject position (number) related to the error instead of the subject itself (string) where the failure occurred. I still have to see how to fix this because this change is breaking several tests due to different error positions being reported by LPegLabel. For now, I recommend using either lua-parser 1.0.0 with LPegLab 1.4.0 or lua-parser 0.1.1, which is basically the same parser, but using LPeg instead of LpegLabel.
The solution was really simple. I just needed to use the error position being returned, as it wasn't necessary to calculate it anymore. I generated a new version to make sure the right LPegLabel version is used with the fix, that is, from now on lua-parser 1.0.1 requires at least LPegLabel 1.6.0.
Error
Steps to reproduce
Seems like this happens with any invalid syntax.
Versions
Additional info
This issue does not occur with
lua-parser 0.1.1-1
. Theparse
function returns normally and error message issourcefile.lua:1:13: syntax error, unexpected 'EOF', expecting 'end', 'return', '(', 'Name', 'goto', 'break', '::', 'local', 'function', 'repeat', 'for', 'do', 'while', 'if', ';'
The text was updated successfully, but these errors were encountered: