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

Skip to content

Conversation

@Nerixyz
Copy link
Contributor

@Nerixyz Nerixyz commented Dec 4, 2024

This PR improves the LuaLexer in that it can now detect variables, properties, and function calls. Accesses and/or calls like foo.bar:baz() now yield (excluding punctuation) variable, property, function. This required refactoring the detection of builtins (first commit).

One thing the lexer gets slightly wrong is that it will yield "variable" for table properties ({ foo = 1 }). Detecting this would require much more state (essentially for every scope).

The lexer now also makes use of Text.Whitespace.

@Nerixyz Nerixyz force-pushed the fix/more-granular-lua branch from 05a3dcc to 10bce1f Compare December 4, 2024 18:48
@Anteru Anteru added the A-lexing area: changes to individual lexers label Jan 5, 2025
@Anteru Anteru added this to the 2.19.0 milestone Jan 5, 2025
@Anteru Anteru merged commit dcc6be4 into pygments:master Jan 5, 2025
15 checks passed
@Nerixyz Nerixyz deleted the fix/more-granular-lua branch January 5, 2025 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-lexing area: changes to individual lexers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants