-
Notifications
You must be signed in to change notification settings - Fork 663
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
LilyPond: slightly improve lexing #2283
Merged
Merged
Conversation
This file contains 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
jeanas
reviewed
Nov 26, 2022
jeanas
requested changes
Nov 26, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please also update the test.
lemzwerg
force-pushed
the
master
branch
2 times, most recently
from
November 26, 2022 18:16
1cd255e
to
fbc4af2
Compare
lemzwerg
force-pushed
the
master
branch
2 times, most recently
from
November 27, 2022 15:44
12c34ff
to
6ef8036
Compare
jeanas
reviewed
Nov 27, 2022
* Handle `--` and `__` as `Token.Punctuation` only if preceded by whitespace: ``` <whitespace> -- ==> hyphen (in lyrics mode) <whitespace> __ ==> extender line (in lyrics mode) -- ==> tenuto, neutral attachment (in music mode) __ ==> portato, down attachment (in music mode) ``` * Handle `-` followed by a number as `Token.Number` only if preceded by whitespace. This is purely heuristic, derived from the coding style shown in the LilyPond manuals. ``` <whitespace> -3 ==> integer (e.g., as a function argument) -3 ==> fingering instruction ``` * Add forgotten `\maxima` note duration. * Some legibility improvements by using verbose mode for regular expressions. * Some comment additions and fixes. * Update tests.
LGTM now. |
Thanks! |
hahnjo
pushed a commit
to lilypond/lilypond
that referenced
this pull request
Dec 1, 2022
A [forthcoming change in Pygments] (pygments/pygments#2283) improves rendering of `--`, if representing an attached tenuto, as bold using LilyPond's `@tb` macro instead of `@t`. Previously, the `@tb` (and `@tbsl`) macro did nothing for non-PDF output, simply passing through its argument. However, within the `@pygments` environment, which in turn is based on the `@format` environment, `makeinfo` converts blank `--` to en-dashes (U+2013), which we don't want for LilyPond code listings.
tarsius
pushed a commit
to emacsmirror/lilypond
that referenced
this pull request
Apr 16, 2023
Run $ python scripts/auxiliar/update_pygments.py 2.14.0 and update python/auxiliar/vendored/README.md. Pygments 2.14.0 contains improvements to LilyPond lexing, see pygments/pygments#2283
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.
Handle
--
and__
asToken.Punctuation
only if preceded by whitespace:Handle
-
followed by a number asToken.Number
only if preceded by whitespace. This is purely heuristic, derived from the coding style shown in the LilyPond manuals.Add forgotten
\maxima
note duration.Some legibility improvements by using verbose mode for regular expressions.
Some comment additions and fixes.