Fixed a special case in the expression parser
This commit is contained in:
parent
9574a26da7
commit
3fb6061c30
@ -110,7 +110,8 @@ func TestParse(t *testing.T) {
|
|||||||
{"Array access 4", "a.b[c+d]", "(@ (. a b) (+ c d))"},
|
{"Array access 4", "a.b[c+d]", "(@ (. a b) (+ c d))"},
|
||||||
{"Array access 5", "a()[b]", "(@ (λ a) b)"},
|
{"Array access 5", "a()[b]", "(@ (λ a) b)"},
|
||||||
{"Array access 6", "a.b()[c]", "(@ (λ (. a b)) c)"},
|
{"Array access 6", "a.b()[c]", "(@ (λ (. a b)) c)"},
|
||||||
// {"Array access 7", "a.b(c)[d]", "(@ (λ (. a b) c) d)"},
|
{"Array access 7", "a.b(c)[d]", "(@ (λ (. a b) c) d)"},
|
||||||
|
{"Array access 8", "a.b(c)[d][e]", "(@ (@ (λ (. a b) c) d) e)"},
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, test := range tests {
|
for _, test := range tests {
|
||||||
|
@ -63,6 +63,10 @@ func isComplete(expr *Expression) bool {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if expr.Token.Kind == token.Call {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
if expr.Token.IsOperator() && len(expr.Children) == numOperands(expr.Token.Kind) {
|
if expr.Token.IsOperator() && len(expr.Children) == numOperands(expr.Token.Kind) {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user