4 ms·
Syntax comment: in your control structures you use a keyword ("do", "then") to start a block as well as wrapping the block in parentheses. This feels superfluou
by jasperry 8mo ago
Syntax comment: in your control structures you use a keyword ("do", "then") to start a block as well as wrapping the block in parentheses. This feels superfluous. I suggest sticking with either keywords or parens to delineate blocks, not both.
- jcparkyn 8mo agoThis is a little bit tricky because the parser has to distinguish between: for x in arr (something ()) \ /-- function call and for x in arr (something ()) \ /-- loop body This is consequence of combining "blocks" and "precedence" into the same construct (). A more fitting example would be to support: for x in arr do set z += x; for x in arr do something x; IIRC these both currently require an explicit block in my parser.
- jasperry 8mo agoI see, thanks for the clear example of the ambiguity you need to avoid! Fun stuff.