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

Coq unicode improvements #1764

Merged
merged 10 commits into from
Sep 24, 2022
Merged

Coq unicode improvements #1764

merged 10 commits into from
Sep 24, 2022

Conversation

cormacrelf
Copy link
Contributor

Fixes #1312 for coq.

Unfortunately it does not fix this for every language, but as a general rule for fixing other languages that should support unicode identifiers, replace [a-z]/\w or similar with Ruby's regex unicode classes e.g. \p{L} for any unicode letter. The Coq version here makes use of \p{S}|\p{Pc} to cover all symbols and non-parenthetical punctuation, makes them all operators (with some nuances/overrides).

@cormacrelf
Copy link
Contributor Author

Screen Shot 2021-11-14 at 5 30 15 pm

There's even a little nuance that's hard to see in the Github theme, which you get back with monokai etc

image

@cormacrelf
Copy link
Contributor Author

cormacrelf commented Nov 14, 2021

One choice that I made is that the big list of first/second-order logic symbols from the previous effort are now Operator instead of Punctuation. This is basically because most of them are indeed operators. If you want +-* (from the bullet point goal selection syntax) to be Punctuation like all the braces are, then the way to go is differentiating between proof mode sentence-initial symbols (ie bullets) and symbols anywhere else. You can push/pop proof mode with Proof. and Qed. (et al). It works but is obviously going to be slightly more fragile to invalid syntax.

@cormacrelf
Copy link
Contributor Author

I'll push the work anyway, have a look

@Lysxia
Copy link

Lysxia commented Jun 6, 2022

This would be very nice to have for Coq projects on gitlab to render better.

@tancnle tancnle added the needs-review The PR needs to be reviewed label Jun 6, 2022
@tancnle tancnle self-assigned this Jun 30, 2022
Copy link
Collaborator

@tancnle tancnle left a comment

Choose a reason for hiding this comment

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

Thanks a lot for your contribution @cormacrelf ❤️ Sorry to get back to this PR late 🙏🏼

It looks great to me overall 👍🏼 I have added some suggestions for your consideration. Please let me know what you think.

If possible, could you also rebase this branch of upstream/master to initiate the CI 🙏🏼?

Gemfile Outdated Show resolved Hide resolved
lib/rouge/lexers/coq.rb Outdated Show resolved Hide resolved
lib/rouge/lexers/coq.rb Outdated Show resolved Hide resolved
lib/rouge/lexers/coq.rb Outdated Show resolved Hide resolved
@tancnle tancnle added the author-action The PR has been reviewed but action by the author is needed label Jul 9, 2022
@gmalecha
Copy link
Contributor

It would be really good to get this merged. @tancnle can you apply the changes and merge it?

@tancnle
Copy link
Collaborator

tancnle commented Sep 12, 2022

It would be really good to get this merged. @tancnle can you apply the changes and merge it?

👋🏼 @gmalecha I can go over the PR again and apply these changes.

@gmalecha
Copy link
Contributor

Thank you so much @tancnle!

Who can approve to merge? I have another PR that I'd also like to merge related to Coq string parsing (#1116).

@tancnle
Copy link
Collaborator

tancnle commented Sep 24, 2022

@gmalecha Sorry for the delay. Let's merge and follow up with some improvement 👍🏼

@tancnle tancnle merged commit 7c96207 into rouge-ruby:master Sep 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author-action The PR has been reviewed but action by the author is needed needs-review The PR needs to be reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unicode highlight in Coq (or other lang)
5 participants