-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Switch *BNF grammars and fix grammar compilation errors #4617
Conversation
@lildude Hope you don't mind if I squeeze in a just-in-time update of the Vim script grammar, which adds roughly 134 new keywords to the language. 😉 (I literally upgraded Vim earlier before and remembered I hadn't pulled updates from Vim's repo in a while...) |
@Alhadis Is it expected that the new grammar for ABNF highlights so little code? In particular, it doesn't seem to properly recognize comments. |
That's because the file I linked to isn't a valid ABNF file. This one is, and you can see the difference in both the file's syntax and its highlighting. (I forgot to include a valid ABNF example in addition to an invalid one... sorry, I was rushing to get this PR up 😓) |
It's worth noting that *BNF notations are notoriously inconsistent in their usage, as the formats are designed to be digested by human readers and specification authors, not machines. So authors inevitably stray from the formal BNF syntax and invent their own twists... sometimes mixing elements of other notations, generally without rhyme or reason... Also, this message keeps giving me a heart-attack. Is anybody else experiencing this when they go to post a comment? |
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.
LGTM!
I've seen it a number of times tonight, each on different repositories. Sometimes the comment went through after I refreshed. No idea what's going on, but it keeps scaring me into thinking I've suddenly been banned. Which, if that ever happens, will lead to my soul wither and waning, and my inevitable departure from this world to write TextMate grammars in the afterlife. 😢 |
If that happens, you can always send me patches by email and I'll apply them :p More seriously, you should perhaps contact GitHub's support. |
I wonder if Ghost Mail is called Gmail in the afterlife...
Doubt they'd be enlightened by a "Hey, your thing broke", so i have my browser's devtools primed to catch any front-end issues I can spot. 😜 (I'm only posting this spammy reply in the hopes of having something to catch) |
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.
LGTM. Thanks for the quick turnaround. 🙇
Fixes Alhadis/language-regexp#1 and Alhadis/language-grammars#1, both of which are issues @lildude reported after encountering problems while preparing Linguist 7.6.0.
Description
This PR addresses some silly oversights on my behalf, and switches out our current ABNF and EBNF grammars to accommodate two grammars I wrote for each of those formats. The only reason I didn't propose them for replacement in #4595 is because I wanted to improve their handling of non-standard BNF syntax (something the existing grammars don't do well either...), but since it's blocking a release, I figure there's no room for my perfectionism here. 😅
Checklist:
I am changing the source of a syntax highlighting grammar
I am updating a grammar submodule
/cc @lildude 🚀