Skip to content

Import Luau lexer#1209

Open
JakobDev wants to merge 1 commit intoalecthomas:masterfrom
JakobDev:luau
Open

Import Luau lexer#1209
JakobDev wants to merge 1 commit intoalecthomas:masterfrom
JakobDev:luau

Conversation

@JakobDev
Copy link
Contributor

This imports pygments.lexers.scripting.LuauLexer from Pygments.

Some notes:

  • The generated XML file is not 100% valid as as some elements have 2 state attributes, but it does work
  • I needed to tweak the import script to correctly convert the RegEx
  • I needed to add OperatorReserved as a TokenType
  • .luaurc is added as a filename to the JSON Lexer, as it's used by Luau

Implements #1062

Copy link
Owner

@alecthomas alecthomas left a comment

Choose a reason for hiding this comment

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

Would it make more sense to integrate this into the Lua lexer?

@JakobDev
Copy link
Contributor Author

JakobDev commented Feb 3, 2026

Would it make more sense to integrate this into the Lua lexer?

Luau is based on Lua but it's a separate Language. See the documentation for more details.

Also Pygments has this as a separate lexer. It would be to much work to integrate this into the existing Lua lexer.

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