Skip to content

Commit

Permalink
allow panics inside PEG parser (#5301)
Browse files Browse the repository at this point in the history
This commit changes the default behavior of the PEG parser
to not recover from panics.  Previously, a panic would be caught
and converted to an error then we would report the error as
a syntax error. There should be no panics in the grammar and
if there are, they should be displayed to users so bugs can
be filed and fixed.
  • Loading branch information
mccanne authored Sep 25, 2024
1 parent 961e86b commit 6328d79
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion compiler/parser/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ func ParseZed(filenames []string, src string) (ast.Seq, *SourceSet, error) {
if err != nil {
return nil, nil, err
}
p, err := Parse("", []byte(sset.Text))
p, err := Parse("", []byte(sset.Text), Recover(false))
if err != nil {
return nil, nil, convertErrList(err, sset)
}
Expand Down

0 comments on commit 6328d79

Please sign in to comment.