luaparse icon indicating copy to clipboard operation
luaparse copied to clipboard

Reflect parentheses that discard extra values in the AST

Open fstirlitz opened this issue 4 years ago • 0 comments

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.

fstirlitz avatar Apr 27 '21 06:04 fstirlitz