boolangery / py-lua-parser

A Lua parser and AST builder written in Python.
MIT License
124 stars 39 forks source link

Refusing to parse chained conditions without parentheses, eg "if a == b == c then" #48

Closed Wha-The closed 1 month ago

Wha-The commented 1 year ago

If you try to parse

if a == b == c then end

it raises a syntax error

luaparser.builder.SyntaxException: Error: Expecting one of 'and', 'not', 'or', 'then', '+', '-', '*', '/', '//', '%', '^', '#', '&', '|', '~', '>>', '<<', '(', '{', '[', ':', '..', '.', STRING at line 1, column 13

However if you parse the equivelent

if (a == b) == c then end

then it works just fine.

found this bug whilst trying to parse this

if aJ == aK == (aI.A ~= 0) then 
boolangery commented 1 month ago

Fixed on master, will release a version soon