Skip to content
New issue

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

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

Already on GitHub? # to your account

Place formal syntax in comments #24

Open
vandenoever opened this issue Aug 23, 2018 · 3 comments
Open

Place formal syntax in comments #24

vandenoever opened this issue Aug 23, 2018 · 3 comments

Comments

@vandenoever
Copy link
Contributor

vandenoever commented Aug 23, 2018

The nom code for parsing would be easier to read if the grammar rules from https://tools.ietf.org/html/rfc3501#section-9 would be placed in comments above each rule.

Here is an example of what that would look like:

https://github.com/vandenoever/rome/blob/master/src/io/turtle/grammar.rs

@djc
Copy link
Owner

djc commented Aug 24, 2018

I'm honestly not very motivated to work on this myself. I've tried to keep the parser names themselves close to the formal syntax names, which works well enough for me to keep track of what's going on.

In addition, there's not a one to one mapping between nom parsers and the RFC syntax, because sometimes I felt the implementation would be simpler by refactoring the grammar somewhat.

@vandenoever
Copy link
Contributor Author

I'm trying to get imap-rust, which uses imap-proto 0.8.1 (nom 3) to work with DavMail and hope to be sending some patches. So far no big ones, but perhaps I'll quote some grammar from the RFC in those patches.

@djc
Copy link
Owner

djc commented Aug 24, 2018

Sounds great! I'll review your changes as they come in.

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

No branches or pull requests

2 participants