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

Add a lexer for Schemas for Minecraft Add-ons and 4 examples, merging lexers #2276

Merged
merged 6 commits into from Nov 29, 2022

Conversation

MiemieMethod
Copy link
Contributor

@MiemieMethod MiemieMethod commented Nov 13, 2022

Schema is a formal language for the game Minecraft official staff and docs to show data file structures and interface formats, and also for Minecraft Add-ons creators to communicate or teach with each other.

Reference: https://learn.microsoft.com/en-us/minecraft/creator/reference/content/schemasreference/
Community usage example: https://www.mcbe-dev.net/addons/data-driven/manifest.html

This lexer is summarized from official and some community examples for maximum coverage.

Four examples are provided for lexer tests.

Moreover, this commit merged the existing MCFunction and SNBT with the newly added MCSchema language.

@jeanas
Copy link
Contributor

jeanas commented Nov 27, 2022

Re CI failure: apparently, you did not make mapfiles, but edited pygments/lexers/_mapping.py directly. In doing so, you forgot the trailing comma in the 1-element tuple ('*.mcschema',). The expression ('*.mcschema') is the same as '*.mcschema', and since a string is iterable, Pygments sees a series of patterns, the first of which is *, hence the strangeness that pygmentize -N test.unknown is recognized as mcschema.

Thus please run make mapfiles and commit the result.

pygments/lexers/minecraft.py Outdated Show resolved Hide resolved
pygments/lexers/minecraft.py Outdated Show resolved Hide resolved
pygments/lexers/minecraft.py Outdated Show resolved Hide resolved
pygments/lexers/minecraft.py Outdated Show resolved Hide resolved
pygments/lexers/minecraft.py Show resolved Hide resolved
Copy link
Contributor

@jeanas jeanas left a comment

Choose a reason for hiding this comment

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

Please check the CI failure, I think you need to update goldens.

pygments/lexers/minecraft.py Outdated Show resolved Hide resolved
@jeanas jeanas merged commit 7e2ae04 into pygments:master Nov 29, 2022
@jeanas
Copy link
Contributor

jeanas commented Nov 29, 2022

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants