-
Notifications
You must be signed in to change notification settings - Fork 902
Support for IETF ABNF (RFC 5234 and extensions) #542
base: master
Are you sure you want to change the base?
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here (e.g. What to do if you already signed the CLAIndividual signers
Corporate signers
|
I submitted the CLA. |
CLAs look good, thanks! |
This reverts commit acd3dfe.
src/lang-ietfabnf.js
Outdated
], | ||
[ | ||
// string, binary, decimal and hex literals | ||
[PR['PR_LITERAL'], /((\%s)?"[^"]*"|(\%x[A-Za-z0-9]+(-[A-Za-z0-9]+|[\.[A-Za-z0-9]+]*))|(\%d[0-9]+(-[0-9]+|[\.[0-9]+]*))|(\%b[01]+(-[01]+|[\.[01]+]*)))/, null], |
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 pretty sure (-[A-Za-z0-9]+|[\.[A-Za-z0-9]+]*)
doesn't do what you want. Notice the [
and ]
around \.[A-Za-z0-9]+
instead of parentheses.
Maybe (?:[-.][A-Za-z0-9]+)*
does what you want.
If so, this problem occurs thrice.
Also, AFAICT, %s
doesn't appear in RFC 5234. Is that part of an extension? Do those conventions include an escaping convention for strings?
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.
- Will check.
- %s is defined in https://tools.ietf.org/html/rfc7405#section-2.1 (but so is "%i" which I should include as well)
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 tried to address this in d8a2671 - note that the simplified expression would match things like
%x31-39-49
which it should not (but then one could argue that it's not the job of the highlighter to spot errors like these).
- detect control characters in string literals and prose - tune character classes
Note I have added a few tests/examples in https://greenbytes.de/tech/webdav/rfc2629xslt/testcase.html#abnf.support |
@mikesamuel - anything else that needs to be done to get this PR accepted? For now, in my IETF doc generation tool, I simply add the code in the generated document; see reschke/xml2rfc@1b0a090 |
Ping? |
No description provided.