Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Infinite repetition in RFCs #516

Open
zp-zpanda opened this issue May 9, 2024 · 2 comments
Open

Infinite repetition in RFCs #516

zp-zpanda opened this issue May 9, 2024 · 2 comments

Comments

@zp-zpanda
Copy link

zp-zpanda commented May 9, 2024

Some RFCs such as RFC 5322 (Internet Message Format) allow infinite repetition in their ABNF:

(RFC 5322 3.2.5 Miscellaneous Tokens)
...
unstructured    =   (*([FWS] VCHAR) *WSP) / obs-unstruct
...

(RFC 5322 4.1 Miscellaneous Obsolete Tokens)
obs-unstruct    =   *((*LF *CR *(obs-utext *LF *CR)) / FWS)
...

(And many more)

I have tried using node-abnf to generate a full Peggy tree from the ABNF, but of course Peggy errors. Is there any method to mitigate that?

Related: #357, #367

@hildjj
Copy link
Contributor

hildjj commented May 9, 2024

First, see errata 1905. Making that change in the ABNF yields a Peggy grammar that compiles.

Then, check the other errata for a few more grammar changes.

In general, these sorts of errors often mean there's something wrong with the starting assumptions, so there isn't a mechanical fix for them.

@zp-zpanda
Copy link
Author

I see... I will try again after incorporating those errata. Thank you so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants