Post #4140178
2026-07-27 15:22 UTC
@lisyarus@mastodon.gamedev.place Most programming languages have expression statements: statements that are just a blank expression. Like,
3 + 3;
is valid syntax in a lot of languages. These are what make multi-line no-semicolon syntax ambiguous, because
let x = 10
- 1
could be
let x = 10 - 1;
or
let x = 10;
- 1;
but if "- 1;" is not a valid statement (because expression statements are forbidden) then the only valid interpretation is 10 - 1.
Replies (1)
-
@lisyarus@mastodon.gamedev.place 2026-07-27 16:11
@witchgirls@woof.tech Ah, yes. In my example above "-1" would be an expression statement. I can't not have that because they can contain function calls with side effects