py-lua-parser icon indicating copy to clipboard operation
py-lua-parser copied to clipboard

Can't parse call expressions in LocalAssign

Open uniquadev opened this issue 2 years ago • 0 comments

Given the following code:

local d, p, one, floor, mul, idx;
if d * d > p then
    local lo = floor(one * (2^-56 / 3) * mul / p)
end

Running luaparser: py -m luaparser <path>

Expected result: <successfully parsed chunk>

Error: Expecting one of 'break', 'do', 'else', 'elseif', 'end', 'function', '::', 'return', ';' at line 3, column 21

Additional Info: builder.py

Seem like parse_expr_list inside parse_local has no actual way of handling functions call expression, and the floor call is resolved to a Name expression

uniquadev avatar Aug 27 '22 21:08 uniquadev