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.
Define the grammar as an ABNF (RFC 5234) #347
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
Define the grammar as an ABNF (RFC 5234) #347
Changes from all commits
7d193e7
8c3a4e5
27edd64
ec6c07e
52fe0ca
fe29172
18ec7c1
6ffc08d
8a00351
7ef8a11
f3a73d8
ad48d07
4787729
4205cd2
517612d
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.
Similar to my comment below, I think these rules would be more readable with conventional OWS and RWS (as in "{optional,required} white space") rules, and column-aligned as in RFC 5234.
and so on.
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.
Can we discuss using
RWS
andOWS
in a separate PR? They touch every production in the ABNF.I'm against column alignment for as long as we expect the grammar to change. They generate needless diffs. Let's do it once when the grammar stabilizes.
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.
Thanks for suggesting this. As I said above, I'd prefer to not column-align the ABNF for now because I don't think the names of production are final and I expect the next few weeks to bring a few changes.
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.
What are the expected semantics of an option value that is a
nmtoken
but not aname
, as in e.g.{:func foo=1}
?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.
It parses as a literal,
"1"
. The implementation of:func
can interpret it as a number if it makes sense to do so for thefoo
option.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.
Hrm, so the value of an option is either a variable or a literal, but the literal can be implicit rather than quoted? Are
{:func foo=|1|}
and{:func foo=1}
therefore indistinguishable?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's a super-subtle difference between
nmtoken
andliteral
values.An
nmtoken
value might be validated at parse time and the values that can be present in annmtoken
are restricted vs. the values permitted in a literal. The use of numbers is fairly common in existing formatters, Cf.Intl.NumberFormat
options such asmaximumSignificantDigits
. But other values have limited (and enumerated) values which might be validated at parse time.A
literal
value probably is a parsing error (invalid argument) when the function wants a number or enumerated value. MF's options are untyped, but the underlying implementation might not be.There may be a "tripping hazard" here for users who can't see the difference between:
{:func symbol=US$}
(invalid, as$
is reserved) and{:func symbol=|US$|}
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.
Yes.
As far as I recall we have not had an explicit discussion on this, but my position would be that during formatting the
:func
handler should not be able to distinguish these two from each other.This file was deleted.