rouge icon indicating copy to clipboard operation
rouge copied to clipboard

Coq unicode improvements

Open cormacrelf opened this issue 4 years ago • 7 comments

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 avatar Nov 14 '21 06:11 cormacrelf

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 avatar Nov 14 '21 06:11 cormacrelf

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 avatar Nov 14 '21 06:11 cormacrelf

I'll push the work anyway, have a look

cormacrelf avatar Nov 14 '21 07:11 cormacrelf

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

Lysxia avatar Jun 06 '22 02:06 Lysxia

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

gmalecha avatar Sep 11 '22 16:09 gmalecha

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.

tancnle avatar Sep 12 '22 11:09 tancnle

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

gmalecha avatar Sep 13 '22 23:09 gmalecha

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

tancnle avatar Sep 24 '22 07:09 tancnle