Skip to content
This repository has been archived by the owner on Apr 22, 2020. It is now read-only.

Support for IETF ABNF (RFC 5234 and extensions) #542

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

reschke
Copy link

@reschke reschke commented May 14, 2018

No description provided.

@googlebot
Copy link

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. I signed it!) and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

@reschke
Copy link
Author

reschke commented May 14, 2018

I submitted the CLA.

@googlebot
Copy link

CLAs look good, thanks!

],
[
// 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],
Copy link
Contributor

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?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Will check.
  2. %s is defined in https://tools.ietf.org/html/rfc7405#section-2.1 (but so is "%i" which I should include as well)

Copy link
Author

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).

@reschke
Copy link
Author

reschke commented May 15, 2018

Note I have added a few tests/examples in https://greenbytes.de/tech/webdav/rfc2629xslt/testcase.html#abnf.support

@reschke
Copy link
Author

reschke commented Jun 15, 2018

@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

@reschke
Copy link
Author

reschke commented Mar 9, 2019

Ping?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants