Add support for overlay/fragments in DevicetreeLexer and update example file#3021
Merged
birkenfeld merged 1 commit intopygments:masterfrom Feb 20, 2026
Merged
Add support for overlay/fragments in DevicetreeLexer and update example file#3021birkenfeld merged 1 commit intopygments:masterfrom
birkenfeld merged 1 commit intopygments:masterfrom
Conversation
d233cd8 to
1c0611e
Compare
…le DTS file
The DTS lexer had issues with recognizing overlay/fragment syntax, whereby in
the following snippet:
&i2c1 {
serlcd@72 {
compatible = "sparkfun,serlcd";
reg = <0x72>;
columns = <16>;
rows = <2>;
command-delay-ms = <10>;
special-command-delay-ms = <50>;
};
};
the "i2c1" was being tokenized as a Name.Attribute instead of a Name.Function,
causing the rest of the lexing to fail as it encountered the "@" character.
This fixes the issue by adding proper support for overlay/fragment syntax.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
1c0611e to
bbc7d11
Compare
kartben
added a commit
to kartben/zephyr
that referenced
this pull request
Feb 19, 2026
Until pygments/pygments#3021 is accepted and merged in upstream Pygments we need to workaround some of the current limitations of the lexer with overlay syntax. This fixes a doc build failure in main Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
aescolar
pushed a commit
to zephyrproject-rtos/zephyr
that referenced
this pull request
Feb 19, 2026
Until pygments/pygments#3021 is accepted and merged in upstream Pygments we need to workaround some of the current limitations of the lexer with overlay syntax. This fixes a doc build failure in main Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Member
|
Thanks, LGTM! |
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.
The DTS lexer had issues with recognizing overlay/fragment syntax, whereby in the following snippet i2c1 wouldn't be seen as a "node"
and "i2c1" was being tokenized as a Name.Attribute instead of a Name.Function, causing the rest of the lexing to fail as it encountered the "@" character in an unexpected location.
This fixes the issue by adding proper support for overlay/fragment syntax, both
&labelform as well as&{node/full/path}.Note that as can be seen from the diff this doesn't change anything else in the tokenization, so there's that :)
Before:
After: