Why Preserving Parenthesis in AST?
Even though we don’t need parenthesis when evaluating an expression, they are useful to disambiguate in assignment when we have an lvalue/rvalue situation:
int x;
x = 1; // valid
(x) = 42; // invalid
Created: May 30, 2023Last Modified: Mar 14, 2024
Even though we don’t need parenthesis when evaluating an expression, they are useful to disambiguate in assignment when we have an lvalue/rvalue situation:
int x;
x = 1; // valid
(x) = 42; // invalid