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

Add improved grammars for Yacc and Lex #4595

Merged
merged 1 commit into from
Aug 12, 2019
Merged

Add improved grammars for Yacc and Lex #4595

merged 1 commit into from
Aug 12, 2019

Conversation

Alhadis
Copy link
Collaborator

@Alhadis Alhadis commented Jul 30, 2019

This PR adds a grammar for Lex/Flex, files, and replaces the one used to highlight Yacc/Bison.

Yacc/Bison

We're still using the old TextMate bundle, which hasn't had an update in 12 years. Furthermore, the bundle was only an unfinished stub, according to the commit notes of textmate/bison.tmbundle@7ffa521:

Commit a bare-bones start at a Bison bundle that I've had sitting around for a while

git-svn-id: http://svn.textmate.org/trunk/Bundles/Bison.tmbundle@7733 dfb7d73b-c2ec-0310-8fea-fb051d288c6d

I've rewritten it from scratch. The improvements are immediately apparent; I doubt this PR will take very long to review. 😜

/cc @pchaigno

Checklist:

  • I am changing the source of a syntax highlighting grammar

@Alhadis
Copy link
Collaborator Author

Alhadis commented Jul 30, 2019

On a sidenote, I had to use source.c++ as the embedded grammar's scope, instead of source.cpp. The former is used by the old TextMate bundle; the latter by Atom (changed by @maxbrunsfeld in atom/language-c@f74f7b3).

I'd like the language-grammars package to support both GitHub and Atom users, but that would necessitate two different scope-names, which will raise a complaint from our grammar compiler. @vmg, is this something we can avoid?

@pchaigno
Copy link
Contributor

The Lex grammar seems to be having issues "parsing" the middle of the preview file. Is that expected?

@Alhadis
Copy link
Collaborator Author

Alhadis commented Aug 1, 2019

(I see I was a bit too hasty with selecting a preview file...😂) Yes, that is to be expected, as the file isn't completely valid Lex source. In fact, it almost appears as if it were copied from an HTML rendering of a Lex file's source code... 😕

I'll pick another...

@Alhadis
Copy link
Collaborator Author

Alhadis commented Aug 1, 2019

I was also using the wrong highlighting grammar (jlex.cson instead of lex.cson), which probably wasn't helping...

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!

@Alhadis Alhadis merged commit 9534a4e into master Aug 12, 2019
@Alhadis Alhadis deleted the yagg branch August 12, 2019 10:41
@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.

None yet

3 participants