immerrr / lua-mode

Emacs major mode for editing Lua
http://immerrr.github.io/lua-mode
GNU General Public License v3.0
314 stars 74 forks source link

Enable variable name fontification in "for" stmts and function arguments #177

Closed immerrr closed 3 years ago

immerrr commented 3 years ago

This PR removes the overly magical lua-make-delimited-matcher function, and replaces it with a hand-crafted macro for lua-rx that matches up to 9 comma separated variable names. That macro enables matching all variables in one go, with a slightly repetitive, but much more readable list of variables

...
     (1 font-lock-variable-name-face)
     (2 font-lock-variable-name-face nil noerror)
     (3 font-lock-variable-name-face nil noerror)
...

It should also fix issues #157 and #163.