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

pygment style for elpi #61

Closed
wants to merge 1 commit into from
Closed

Conversation

gares
Copy link

@gares gares commented Aug 20, 2021

This works for me, but it is the ugliest option we discussed by mail.
I tried the other options, but I could not get it working :-/

Given the entry point is really small, I wonder if "monkey patching" could be an option.
I mean, the _quotation and antiquotation non terminals could be there and empty, and one could inject all the rest (and keep it out of alectryon, which is probably a good thing, unless you like elpi so much).

@gares
Copy link
Author

gares commented Aug 21, 2021

This is a screenshot of how it looks like with this patch plus a bunch of CSS rules. The think is very very close to how it looks in vscode, which was my objective.

Screenshot from 2021-08-21 12-05-45

@cpitclaudel
Copy link
Owner

This looks very nice, thanks for sharing!

Given the entry point is really small, I wonder if "monkey patching" could be an option. I mean, the _quotation and antiquotation non terminals could be there and empty, and one could inject all the rest (and keep it out of alectryon, which is probably a good thing, unless you like elpi so much).

But if that works, then wouldn't it work to also inject the nonterminals?

@gares
Copy link
Author

gares commented Aug 22, 2021

I did not try but yes. I was suggesting to keep a quotation and antiquotation nonterminals because they could/should be used by ltac1 and ltac2 as well. I mean ltac:(...) is really like lp:{{ ... }}.

@cpitclaudel
Copy link
Owner

they could/should be used by ltac1 and ltac2 as well. I mean ltac:(...) is really like lp:{{ ... }}.

Fair, although ltac1 can contain Gallina in a bunch of places, so it's tricky to know when you exit the quotation (that's why I handle both together at the moment).

@gares
Copy link
Author

gares commented Aug 23, 2021

I managed to separate the elpi lexer in this way (I pushed it ontop of the other PR because I wanted to test it on the actual doc).

7c226b6

I could not monkey patch all the way trough, so I'd like the --plugin option (or another one) to let me override the coq lexer as I do here.

@gares
Copy link
Author

gares commented Aug 23, 2021

I close this one, since what I really need now is an "plugin mechanism" hence the other PR is more appropriate to discuss it.

@gares gares closed this Aug 23, 2021
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

Successfully merging this pull request may close these issues.

2 participants