Open mikewest opened 9 years ago
It is absolutely a patch I'd accept.
The way to do it is in the datablocks.py file. Write a transformABNF()
function, add it to the blockTypes
dict at the top of transformDataBlocks
with the class that should trigger it (abnf
, looks like).
Please put the actual parser into a fresh file and just invoke it in datablocks, like transformRailroad
and friends do.
(It would also be nice to validate ABNF, if only so that @reschke won't be upset with me (https://lists.w3.org/Archives/Public/ietf-http-wg/2017AprJun/0216.html). :) )
Do you have a preferred abnf reference? I know the W3C maintains one.
There are different kinds of ABNF. @mikewest likely refers to https://www.greenbytes.de/tech/webdav/rfc5234.html (but beware, has optional extensions)
The W3C one I was referring to is https://www.w3.org/Notation.html, which is RFC 822 plus some changes and additions.
Well, when ABNF is used to define HTTP header fields, it's IMHO strictly better to use some version of IETF ABNF.
Right now, I'm marking up ABNF grammar as something like:
I'd like to mark it up as the following, and have the
<a>
and<dfn>
s added magically:This seems like it will be a lot of work (though I think we could get away with much less rigor than the WebIDL parser), so before I start poking at it in my copious free time, is it a patch you'd accept in the first place, @tabatkins?