Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Lexer cleanup: naming, metadata, correctness, and Python/CSS/Lua updates#3151

Open
Berat121 wants to merge 45 commits into
pygments:masterfrom
Berat121:fix/add-lexers-fix-bugs
Open

Lexer cleanup: naming, metadata, correctness, and Python/CSS/Lua updates#3151
Berat121 wants to merge 45 commits into
pygments:masterfrom
Berat121:fix/add-lexers-fix-bugs

Conversation

@Berat121

Copy link
Copy Markdown

Summary

This PR addresses naming inconsistencies, metadata errors, and correctness issues across the lexer codebase. Each change is a separate commit for easy review.

File Renaming

  • nim_rename: Rename NimrodLexer → NimLexer, nim.py, add Nim 2.x keywords
  • apdlexer: Rename apdlexer.py → apd.py, class apdlexer → ApdLexer (PEP 8)
  • gcode_rename: Rename gcodelexer.py → gcode.py (remove 'lexer' from filename)
  • inferno_rename: Rename inferno.py → limbo.py (file matches its content: LimboLexer)
  • oberon_rename: Rename oberon.py → component_pascal.py (matches ComponentPascalLexer)
  • dalvik_rename: Rename dalvik.py → smali.py (file matches its content: SmaliLexer)

Correctness Fixes

  • dax_indent: dax.py: remove trailing tabs in inline comments (mixed indent)

Language Updates

  • python_updates: python.py: StarlarkLexer, remove starlark/bazel from PythonLexer, add frozendict/sentinel builtins, add lazy keyword (PEP 690)
  • css_modern: css.py: add @layer @container @Property @scope, oklch/oklab/color-mix, :has/:is/:where
  • lua_refactor: Move Lua/Luau from scripting.py → lua.py, introduce _LuaBaseLexer

Testing

tox -e mapfiles   # regenerate _mapping.py
tox               # full test suite

Notes

  • All file renames keep the original aliases intact for backwards compatibility.
  • lazy keyword added for Python 3.15 (PEP 690).
  • StarlarkLexer extracted from PythonLexer aliases into its own class.
  • LuaLexer/LuauLexer moved to dedicated lua.py following the pattern of python.py, go.py, ruby.py, etc.

Berat121 added 30 commits May 31, 2026 06:08
@birkenfeld

Copy link
Copy Markdown
Member

Hi and thanks for your contribution. This is a large PR that's getting harder to review especially since you're adding more commits. Please split it into separate PRs for the different concerns - e.g. one for the all changes, one for the CSS updates etc.

As for the file renames, I'm not too keen on them since they just cause churn (and the original module needs to be kept for compatibility anyway).

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.

2 participants