mirror of
https://github.com/hanzoai/expr.git
synced 2026-09-24 16:58:58 +00:00
Better error message for predicate with sequence
This commit is contained in:
@@ -619,6 +619,9 @@ func (p *parser) parsePredicate() Node {
|
||||
node = p.parseSequenceExpression()
|
||||
} else {
|
||||
node = p.parseExpression(0)
|
||||
if p.current.Is(Operator, ";") {
|
||||
p.error("wrap predicate with brackets { and }")
|
||||
}
|
||||
}
|
||||
p.depth--
|
||||
|
||||
|
||||
@@ -925,7 +925,7 @@ func TestParse_error(t *testing.T) {
|
||||
| .....^`},
|
||||
{
|
||||
`map(ls, 1; 2; 3)`,
|
||||
`unexpected token Operator(";") (1:10)
|
||||
`wrap predicate with brackets { and } (1:10)
|
||||
| map(ls, 1; 2; 3)
|
||||
| .........^`,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user