NEWLINE sentinel behavior in CPython's PEG grammar
David J W <[email protected]> Wed, 26 Oct 2022 11:49:02 -0600
| Newsgroups | gmane.comp.python.devel |
|---|---|
| Message-ID | <CAPKNibgdt0ck5qNOd5nKEACL7aaGLvknkdq0H=Faq-9YXkxs8Q@mail.gmail.com> |
I am writing a Rust version of Python for fun and I am at the parser stage
of development.
I copied and modified a PEG grammar ruleset from another open source
project and I've already noticed some problems (ex Newline vs NL) with how
they transcribed things.
I am suspecting that CPython's grammar NEWLINE is a builtin rule for the
parser that is something like `(Newline+ | NL+ ) {NOP}` but wanted to
sanity check if that is right before I figure out how to hack in a NEWLINE
rule and update my grammar ruleset.