Re: [PATCH v2 5/5] peg: Add fall-back parsing.

2024-10-14 Thread Ekaitz Zarraga
On 2024-10-14 09:36, Janneke Nieuwenhuizen wrote: Janneke Nieuwenhuizen writes: From: Rutger van Beusekom This allows production of incomplete parse trees, without errors, e.g., for code completion. * module/ice-9/peg/codegen.scm (%peg:fall-back?): New exported parameter. (%enable-expect, %c

Re: [PATCH v2 5/5] peg: Add fall-back parsing.

2024-10-14 Thread Janneke Nieuwenhuizen
Janneke Nieuwenhuizen writes: > From: Rutger van Beusekom > > This allows production of incomplete parse trees, without errors, e.g., > for code completion. > > * module/ice-9/peg/codegen.scm (%peg:fall-back?): New exported > parameter. > (%enable-expect, %continuation, %final-continuation): New

[PATCH v2 1/5] Remove trailing whitespace in PEG texinfo.

2024-10-14 Thread Janneke Nieuwenhuizen
From: Rutger van Beusekom * doc/ref/api-peg.texi (PEG API Reference): Remove trailing whitespace. --- doc/ref/api-peg.texi | 46 ++-- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/doc/ref/api-peg.texi b/doc/ref/api-peg.texi index d34ddc64

[PATCH v2 2/5] peg: Add debug tracing.

2024-10-14 Thread Janneke Nieuwenhuizen
From: Rutger van Beusekom * module/ice-9/peg/codegen.scm (trace?): New function. (indent): New variable. (%peg:debug?): New exported parameter. (wrap-parser-for-users): Use them to provide debug tracing. * test-suite/tests/peg.test ("Parse tracing"): Test it. * doc/ref/api-peg.texi (Debug tracing

[PATCH v2 3/5] peg: Add expect.

2024-10-14 Thread Janneke Nieuwenhuizen
From: Rutger van Beusekom This adds an expectation parser (expect a, 'a#') to the PEG parser grammar. Rationale: PEG will return #f for invalid input. Adding expect (#) to the grammar is a way to report syntax errors. * module/ice-9/peg/string-peg.scm (peg-secondary->defn): Rename from peg-pri

[PATCH v2 4/5] peg: Add whitespace and comment skip parsers.

2024-10-14 Thread Janneke Nieuwenhuizen
From: Rutger van Beusekom * module/ice-9/peg/codegen.scm: (%peg:locations?, %peg:skip?): New exported parameters. (wrap-parser-for-users): Use them to enable skip parsing and switch having locations on comments and whitespace. * test-suite/tests/peg.test ("Skip parser"): Test it. * doc/ref/api-pe

[PATCH v2 5/5] peg: Add fall-back parsing.

2024-10-14 Thread Janneke Nieuwenhuizen
From: Rutger van Beusekom This allows production of incomplete parse trees, without errors, e.g., for code completion. * module/ice-9/peg/codegen.scm (%peg:fall-back?): New exported parameter. (%enable-expect, %continuation, %final-continuation): New parameter. (final-continuation): New function

[PATCH v2 0/5] Extend PEG for production use.

2024-10-14 Thread Janneke Nieuwenhuizen
Rutger van Beusekom writes: > First of all, I am aware I am submitting a sizeable patch here, and I am > happy to break it up if necessary. As Ekaitz has been doing some great PEG work and it seems that there's some renewed interest in PEG, please find a newer version of this patch as a broken-up