Use gigaparsec.Run to run sexp parser
This commit is contained in:
parent
4a13ec209d
commit
a007bdd8c3
@ -152,13 +152,9 @@ func Parse(data []byte) (Sexp, error) {
|
||||
gigaparsec.End[byte](),
|
||||
func(s Sexp, _ struct{}) Sexp { return s },
|
||||
)
|
||||
result, err := parser(gigaparsec.MakeState(cursor.NewSlice(data)))
|
||||
result, err := gigaparsec.Run(parser, cursor.NewSlice(data))
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("csexp.Parse: %w", err)
|
||||
}
|
||||
if failed, _, msg := result.Failed(); failed {
|
||||
return nil, fmt.Errorf("csexp.Parse: %v", msg)
|
||||
}
|
||||
_, _, sexp, _, _ := result.Succeeded()
|
||||
return sexp, nil
|
||||
return result, nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user