luaparse
luaparse copied to clipboard
Reflect parentheses that discard extra values in the AST
The parentheses are represented as a UnaryExpression with the empty string as the operator. This choice minimises compatibility breaks: users only need to add precedence information and/or identity evaluation for a new operator. Serialising code that assumes all unary operators have the same precedence bested only by the power operator, and otherwise treats them as black boxes, should keep working correctly, even in the presence of the latter.
Parentheses on the LHS of assignment are not represented unless nested.
This fixes #79.