[prev in list] [next in list] [prev in thread] [next in thread] 

List:       python-dev
Subject:    [Python-Dev] NEWLINE sentinel behavior in CPython's PEG grammar
From:       David J W <ward.davidj () gmail ! com>
Date:       2022-10-26 17:49:02
Message-ID: CAPKNibgdt0ck5qNOd5nKEACL7aaGLvknkdq0H=Faq-9YXkxs8Q () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


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.

[Attachment #5 (text/html)]

<div dir="ltr"><div class="gmail_quote"><div>I am writing a Rust version of Python \
for fun and I am at the parser stage of development.<br></div><div><br></div><div>I \
copied and modified a PEG grammar ruleset from another open source project and \
I&#39;ve already noticed some problems (ex Newline vs NL) with how they transcribed \
things.</div><div><br></div><div>I am suspecting that CPython&#39;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.</div></div></div>



_______________________________________________
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-leave@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at https://mail.python.org/archives/list/python-dev@python.org/message/NMCMEDMEBKATYKRNZLX2NDGFOB5UHQ5A/
 Code of Conduct: http://python.org/psf/codeofconduct/



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic