Better error message for predicate with sequence

This commit is contained in:
Anton Medvedev
2025-03-08 12:14:13 +01:00
parent 97e061adca
commit 26eebbe70c
2 changed files with 4 additions and 1 deletions
+3
View File
@@ -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--
+1 -1
View File
@@ -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)
| .........^`,
},