New grammar rules to fix #6, #22, #41 by adding binary operators, function calls and member access that can start with expressions.
That's quite a big grammar change because PEG parsers can't deal directly with left-recursive rules (i.e. an expression that starts with another expression like x + y).
Grammar
[x] Infix binary expressions e.g. a + b
[x] multiplicative
[x] additive
[x] inequality
[x] equality
[x] assignment
[x] Member expressions: a[b] and a.b
[x] Function calls: a(b)
AST node types, type checker and interpreter
[x] BinaryExpression
Other changes
[x] Remove the temporary tuple syntax
[x] Remove the temporary member syntax
The new syntax caused some ambiguities with parsing some variants of multi-clause functions. Multi-clause functions must now wrap argument patters in parentheses and use , to delimit clauses.
New grammar rules to fix #6, #22, #41 by adding binary operators, function calls and member access that can start with expressions.
That's quite a big grammar change because PEG parsers can't deal directly with left-recursive rules (i.e. an expression that starts with another expression like
x + y
).Grammar
a + b
a[b]
anda.b
a(b)
AST node types, type checker and interpreter
BinaryExpression
Other changes
The new syntax caused some ambiguities with parsing some variants of multi-clause functions. Multi-clause functions must now wrap argument patters in parentheses and use
,
to delimit clauses.I'll try to refine this syntax in a later PR.