ast.go, pasrse.go: fixed the recover routine

This commit is contained in:
2026-05-01 17:03:44 +02:00
parent f2d1f23774
commit 75ed88915d
2 changed files with 6 additions and 8 deletions
+2 -3
View File
@@ -386,11 +386,10 @@ func (parser *parser) Parse(scanner *scanner, termSymbols ...Symbol) (tree *ast,
if r := recover(); r != nil {
if errVal, ok := r.(error); ok {
err = errVal
} else {
err = errors.New("unexpected error while parsing the expression")
}
}
if err == nil {
err = errors.New("unexpected error while parsing the expression")
}
}()
termSymbols = append(termSymbols, SymEos)
return parser.parseGeneral(scanner, allowMultiExpr, termSymbols...)