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

Generate syntax highlighters #422

Open
masaeedu opened this issue Apr 25, 2022 · 4 comments
Open

Generate syntax highlighters #422

masaeedu opened this issue Apr 25, 2022 · 4 comments

Comments

@masaeedu
Copy link

Hi there. I was wondering if it would be considered part of the scope of this project to deal with syntax highlighting in a language agnostic way. For example, would it make sense to generate a TextMate grammar (or something akin to it)?

@masaeedu masaeedu changed the title Syntax highlighting Generate syntax highlighters Apr 25, 2022
@andreasabel
Copy link
Member

There is the pygments backend to that end. Other backends would be thinkable.
Caveat: there is a reimplementation of BNFC in progress, so extending the present implementation by a new backend would then need a port to the new implementation.
If you are very keen to get to work, I could give you access to the new repo so you can make a proposal.

@masaeedu
Copy link
Author

masaeedu commented Apr 27, 2022

Hi @andreasabel. Interesting, does the reimplementation significantly depart from or augment the LBNF language as specified in the docs?

I was thinking about this a bit more today and realized you would need some additional metadata to ascribe syntactic categories to productions.

@andreasabel
Copy link
Member

The reimplementation aims at being conservative in the first step, meaning, backwards-compatible. So the LBNF language stays the same.

@ejconlon
Copy link

I was also curious about this in the context of generating VSCode grammars (which use TextMate grammars, as detailed here). Though if you are planning on writing an LSP, you may be able to have your LSP process emit semantic highlighting information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants