Merged
Conversation
e0e4be3 to
a2266d1
Compare
…f53542814c79469711ceff19fbf/doc/latex/lean4.py This is based off an old version of the Lean 3 lexer.
There is no need for `re.UNICODE` any more, or `u` prefixes.
The version and url information no longer lives in the docstring.
58b75ee to
843b426
Compare
This allows a lean4 version of the lean3 test to be committed
* Use `Whitespace` not `Text` for Whitespace * Use a single token for an entire multiline comment, not one per character * Fix brace-matching for `@[attr]` syntax * Add docstring highlighting
843b426 to
83209aa
Compare
Julian
reviewed
Jan 8, 2024
Julian
left a comment
There was a problem hiding this comment.
Nice! This looks pretty good. I'm sure I've missed a thing or two, but I tried to double check the keyword list and give a cursory look over the token list which pretty much looks good!
Contributor
|
Maybe also add a line to the |
This also corrects the integer parser to not include field projections
7b89197 to
57f88c3
Compare
Julian
approved these changes
Jan 9, 2024
Julian
left a comment
There was a problem hiding this comment.
Nice. This LGTM at this point I think (with or without the operator tweaking)!
jeanas
reviewed
Jan 13, 2024
jeanas
reviewed
Jan 13, 2024
jeanas
reviewed
Jan 13, 2024
jeanas
reviewed
Jan 13, 2024
jeanas
reviewed
Jan 13, 2024
| (r'\d+', Number.Integer), | ||
| (r'"', String.Double, 'string'), | ||
| (r'[~?][a-z][\w\']*:', Name.Variable), | ||
| (r'\S', Name.Builtin.Pseudo), |
Contributor
Author
There was a problem hiding this comment.
Arbitrary notation defined by the user; without it, all such notation would be marked as invalid
jeanas
reviewed
Jan 13, 2024
Contributor
|
This looks generally good, only a couple minor questions above. |
Contributor
Author
|
Thanks! I've made a small follow-up in #2626; it would be great if they could both land in the coming release. |
Contributor
|
Sure, this will all be in 2.18. |
github-merge-queue bot
pushed a commit
to leanprover/lean4
that referenced
this pull request
May 20, 2024
An improved `lean4` lexer is now part of pygments. This depends on pygments/pygments#2618 (now merged), and [a subsequent release](https://github.com/pygments/pygments/milestone/23)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is taken from https://github.com/leanprover/lean4/blob/d92948bc20b12f53542814c79469711ceff19fbf/doc/latex/lean4.py, with subsequent commits showing the changes made on top of this file
For that reason, I'd prefer if the history could be preserved; though I'd be happy to rewrite it if you want fewer commits / different message conventions.
The test file I'd added is the lean4 translation of the test file that was being used for Lean 3.
Since lean3 and lean4 files share a file extension, this adds
analyse_textmethods that discriminate based onimport Foovsimport foo; this is the same heuristic used by GitHub linguist.cc @Kha