diff --git a/csexp/sexp.go b/csexp/sexp.go index 9876293..69791cc 100644 --- a/csexp/sexp.go +++ b/csexp/sexp.go @@ -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 }