rokucommunity / brighterscript

A superset of Roku's BrightScript language
MIT License
160 stars 46 forks source link

Change += and other operators to ExpressionStatement #1186

Closed TwitchBronBron closed 4 months ago

TwitchBronBron commented 4 months ago

Currently expressions like this: value += 2 are parsed as AssignmentStatements. This is strange because the AST ends up with 2 different pointers to the value token (in the assignment AND in the value += value). The TypeScript AST represents this as an ExpressionStatement, which seems to make more sense in this context, so we should consider moving to a similar pattern.

This would be a breaking change.

image