ast.go, pasrse.go: fixed the recover routine
This commit is contained in:
@@ -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...)
|
||||
|
||||
Reference in New Issue
Block a user