ABNF - rule allowing literal DQUOTE breaks highlighting

#2 · closed · 3 comments

View on GitHub ↗

jchook

How do I specify a production rule allowing a literal `DQUOTE`? For example, check out [RFC 2045](https://tools.ietf.org/html/rfc2045#appendix-A). They appear to use `prose-val` to specify a literal double quote `<">`, but it would seem that `char-val` otherwise allows `"""`. Both options cause a "run-on" quoted string in the syntax highlighting (see screenshot). The formal [ABNF](https://tools.ietf.org/html/rfc5234) specification specifies: ``` char-val = DQUOTE *(%x20-21 / %x23-7E) DQUOTE prose-val = "<" *(%x20-3D / %x3F-7E) ">" ``` Also, thanks a lot for making this! ![image](https://user-images.githubusercontent.com/193530/69927944-fd3d1280-1487-11ea-8070-ef8af3a23802.png)

Comments

Alhadis

Weird that I completely missed `prose-val` while going through RFC 5234. 🤔 I've amended this in 422d721; thanks for bringing it to my attention. > but it would seem that `char-val` otherwise allows `"""` Where did you read that? The formal definition of `char-val` explicitly excludes `DQUOTE` (U+0022) from its permitted character range: ~~~abnf char-val = DQUOTE *(%x20-21 / %x23-7E) DQUOTE ; quoted string of SP and VCHAR ; without DQUOTE ~~~

jchook

> I've amended this in 422d721; thanks for bringing it to my attention. Thank you! :) > The formal definition of char-val explicitly excludes DQUOTE. Yep, good point. I misread the definition. Thanks again!

Alhadis

Glad to help! I've just [cut a release](https://github.com/Alhadis/language-grammars/releases/tag/v1.0.2), so the recent fixes should be available to you immediately.