Re:Statements vs. Expressions
by chrismorgan on Thursday July 14, 2022 @09:31AM
(#32095871)
> (5 + 1) * 2
That’s six expressions, not five. Josh conflates the the addition expression and the parenthesised expression, but they’re distinct (even if you couldn’t represent the semantics without the parenthesis due to operator precedence).
Here’s an approximate representation of the parse tree, indicating which nodes are expressions:
That’s six expressions, not five. Josh conflates the the addition expression and the parenthesised expression, but they’re distinct (even if you couldn’t represent the semantics without the parenthesis due to operator precedence).
Here’s an approximate representation of the parse tree, indicating which nodes are expressions: