Skip to content
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

Merged
merged 4 commits into from
Aug 23, 2019
Merged

Conversation

Alhadis
Copy link
Collaborator

@Alhadis Alhadis commented Aug 22, 2019

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 🚀

@Alhadis Alhadis requested a review from pchaigno August 22, 2019 11:53
@Alhadis
Copy link
Collaborator Author

Alhadis commented Aug 22, 2019

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

@pchaigno
Copy link
Contributor

@Alhadis Is it expected that the new grammar for ABNF highlights so little code? In particular, it doesn't seem to properly recognize comments.

@Alhadis
Copy link
Collaborator Author

Alhadis commented Aug 22, 2019

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

@Alhadis
Copy link
Collaborator Author

Alhadis commented Aug 22, 2019

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?

Copy link
Contributor

@pchaigno pchaigno left a comment

Choose a reason for hiding this comment

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

LGTM!

@pchaigno
Copy link
Contributor

Also, this message keeps giving me a heart-attack. Is anybody else experiencing this when they go to post a comment?

I don't remember ever seeing this.

@Alhadis
Copy link
Collaborator Author

Alhadis commented Aug 22, 2019

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

@pchaigno
Copy link
Contributor

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.

@Alhadis
Copy link
Collaborator Author

Alhadis commented Aug 22, 2019

If that happens, you can always send me patches by email and I'll apply them :p

I wonder if Ghost Mail is called Gmail in the afterlife...

More seriously, you should perhaps contact GitHub's support.

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)

Copy link
Member

@lildude lildude left a 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. 🙇

@Alhadis Alhadis merged commit ee6172a into master Aug 23, 2019
@Alhadis Alhadis deleted the preflight branch August 23, 2019 08:45
@github-linguist github-linguist locked as resolved and limited conversation to collaborators Jun 17, 2024
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.

Linguist grammar compilation error
3 participants