-
-
Notifications
You must be signed in to change notification settings - Fork 36
Port ABNF changes and fomatting to syntax document #657
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
Port ABNF changes and fomatting to syntax document #657
Conversation
eemeli
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While the actual rules should absolutely be the same, I don't think the whitespace changes make sense.
aphillips
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for doing this!
The changes look good to me. I'll admit that I didn't actually check them against the ABNF.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks @alerque! I looked at syntax.md from your branch and message.abnf from main side by side, and I think they're equivalent, modulo the ordering of productions.
| quoted-char = content-char / s / "." / "@" / "{" / "}" | ||
| reserved-char = content-char / "." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are already listed elsewhere in syntax.md. Is there a reason to bring them here, rather than keeping them in their current places?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The quoted-char is currently under Literals right after quoted, and reserved-char under Reserved Annotations right after reserved-body. The proposed change moves their listings from those places (which are their only users) to here.
As is, their meaning is obvious from context. If they're moved here, then we should add some text here explaining what they are.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those definitions moved in the abnf source too, and I found their new/current locations much easier to grok than the old ones the syntax explanations were using because they are now grouped with more related context with other similar definitions.
If consensuses is that isn't a good change they can go back to their original places, but the abnf snippets will no longer be all blocks where the whole snippet comes from a contiguous bit of source. Having all the snippets match some contiguous bit from the original file makes it quite a bit easier to verify that it is in sync.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As we do not intend to make further syntax changes, mirroring such changes in syntax.md as well as the ANBF should not need to be done later.
I have a weak preference for keeping these as they currently are, but I'm fine to go with whatever most people think.
|
I'm going to merge this. We can tweak the duplicates in the spec tomorrow, if we feel strongly enough about it. |
The ABNF has recieved a major overhaul with difrenet formatting, and also along the way several small changes and fixes landed. These changes are not reflected in the relevant snippets in the syntax document.
This brings all the snippets up to date with the actual ABNF. One could easily make a case that the formatting doesn't need to match and each snippet could have its own whitespace choices to match the local context, but it was much easier to find changes and reason about them if the lines exactly matched the ABNF file, so I went ahead and updated all the formatting.
In the process the actual changes showed through. Some changes are typo fixes (e.g.
reserve-escape→reserved-escape), others have more exact definitions (e.g.reserved-keywordandreserved-statement), and a couple items have just been moved around in the source. I moved a couple definitions when they were not relevant to the bit of the document to closer match where they are in the ABNF (e.g.gquoted-charandreserved-char).