Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add explicit whitespace definitions #344
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
Add explicit whitespace definitions #344
Changes from all commits
8106286
05d0da5
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
For the rule on this line, another point to consider is the name of the rule. It's the singular word "Selector" when it includes 1 or more things that we have been casually referring to as selectors. So I think it would be clearer to use the plural word "Selectors" and separate out a rule for the syntax of that individual concept named using the singular word "Selector":
If doing so, then rename the reference to this rule within the
Body
rule accordingly.(This suggested change also incorporates @eemeli's suggested change in a parallel comment that LGTM.)
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.
Thanks, @echeran. I tried to limit the changes in this PR to only those related to whitespace. That's why in the description I wrote: Please review this PR without paying too much attention to naming. :)
The exact change you're suggesting is implemented in #347. Glad to see that we agree :)
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.
Use
LWSP
, which is built-in, instead of defining our own?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.
Looking at the definition in https://datatracker.ietf.org/doc/html/rfc5234#appendix-B,
LWSP
excludes standaloneLF
, which I don't think we want to do?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.
Also, the same appendix says that it contains some basic rules that are in common use and that [b]asic rules are in uppercase. Does common use mean that they're built-in, or perhaps that they're expected to be defined in a certain way?
The reason I'm asking is that I found an ABNF parser at https://author-tools.ietf.org/abnf and it complained about
DIGIT
andALPHA
being undefined. Bug or intended behavior?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.
I would prefer keeping an explicit whitespace definition within the spec, rather than introducing an external dependency.
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.
I think in an RFC, you would usually say that the following rules are imported from RFC 5234, and give a list of the rules you need.
DIGIT and ALPHA are too frequent for such a bug not having been detected. I'd guess you have to add the rules you reference from RFC 5234 by hand.
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.
Bill's parser (which powers author-tools) has always complained about the built-ins. I think most I-D authors ignore the warnings (I know I learned to). For example, if you run BCP47's ABNF in the tool, it complains about all of the built-ins (and BCP47 is a published set of RFCs blessed by the editor):
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.
I'm curious about the
LF
and its exclusion fromLWSP
. In addition to +1 on @eemeli's comment to allow for whitespace betweenDeclaration
s (thelet ...
), I think it would be natural for people who want to serialize messages to a file to want to put a newline in between them. Same applies to the comment for whitespace between each variant in a selection message. At least, by "natural", I mean that I think this is how we have already written all of our example messages in our documentation so far.What are the reasons for
LWSP
not includingLF
(what use cases does it support, and do those apply here)?However we decide this, I think our examples in our documentation should match our syntax, and we just have to update one or both to ensure that.
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.
Did you mean to say "to allow" or "to require"? @eemeli's comment uses a stronger language.
I agree about the "natural". I think we should recommend readable formatting and lead by example. This PR is more about defining the bounds of what's considered valid, even if it's formatted horribly.
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.
@stasm Ah, yep, I meant "require".