|
|
|
|
|
by david-given
3397 days ago
|
|
Having tried this in the past with personal programming languages, I always found I needed the parentheses to disambiguate control flow statements. You end up with stuff like: if foo*bar baz()
...being parseable as either of these: if (foo) { *bar } baz()
if (foo*bar) { baz() }
That example can be solved with enough lookahead but I think I found cases where it couldn't be (although I can't bring them to mind). Terminator tokens are another way to solve it, so you get Ada-style: if foo*bar then baz() endif
...or Go-style: if foo*bar { baz() }
|
|