Skip to content

Commit 08e3a81

Browse files
committed
fix(parser): check for extra symbols in expression
1 parent fc33494 commit 08e3a81

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pkg/parser/parser.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -651,6 +651,12 @@ func ParseExpr(e string) (Expr, string, error) {
651651
if err != nil {
652652
return exp, e, err
653653
}
654+
655+
// all symbols should be parsed, otherwise we have an syntax error
656+
if e != "" {
657+
return nil, "", ErrUnexpectedCharacter
658+
}
659+
654660
exp, err = defineMap.expandExpr(exp.(*expr))
655661
return exp, e, err
656662
}

0 commit comments

Comments
 (0)