grammars-v4
grammars-v4 copied to clipboard
Lua grammar handles method calls incorrectly
Sample snippet: local _addr = tostring(_obj).sub(8)
This input is ambiguous. (trperf -i 'local _addr = tostring(_obj).sub(8)' | column -t and look at the column named "Ambiguiities".)
Lua allows two statements without a semi-colon separator. print(1) print(2). So, for local _addr = tostring(_obj).sub(8), we have two statements, local _addr = tostring and (_obj).sub(8).
But, clearly the intent of the input is for it to be one statement.
I haven't looked at the source code for the interpreter yet, but I suspect there are missing disambiguation rules for the parse.
Reordering rule alts is insufficient to fix this problem!