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

RFC ABNF parsing #153

Open
Carlyle-Foster opened this issue Jan 1, 2025 · 1 comment
Open

RFC ABNF parsing #153

Carlyle-Foster opened this issue Jan 1, 2025 · 1 comment

Comments

@Carlyle-Foster
Copy link
Contributor

i want to implement support for parsing the kind's of ABNF's used in RFC's like RFC 822: Standard for ARPA Internet Text Messages and RFC 9112: HTTP/1.1. RFC 5234: ABNF shoould be a big help here, but older RFC's don't strictly follow it and newer ones often use extensions.

the obvious (to me) first step is adding support for ; comments, followed by support for bare non-terminals and = withou :: like in CRLF = CR LF

i'm not sure how this should be reflected in the API, we've still got to support .parse() but it should probably(?) be marked deprecated on account of BNF not being standardized enough for it to make sense, maybe Grammar::parse_from(source, spec) could work? i like the idea of having a single function dispatching on an enum, having separate functions for BNF and EBNF could be misleading because the BNF versions by themselves might appear complete

@Carlyle-Foster Carlyle-Foster changed the title RFC parsing RFC ABNF parsing Jan 1, 2025
@Carlyle-Foster
Copy link
Contributor Author

i've made a lot of progress on this in a branch, got () and [] and / down, but i'm starting to reconsider the approach of having different formats when they seem cross-compatible, what if we just made the parser more permissive instead so u could use | or /, ::= or =, etc.

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

1 participant