Variable: lua-font-lock-keywords
lua-font-lock-keywords is a variable defined in lua-mode.el.gz.
Value
Large value
(("^#!.*$" . font-lock-comment-face)
("\\_<\\(?:false\\|nil\\|true\\)\\_>" . font-lock-constant-face)
("\\_<\\(?:break\\|do\\|e\\(?:lse\\(?:if\\)?\\|nd\\)\\|f\\(?:or\\|unction\\)\\|goto\\|i[fn]\\|local\\|re\\(?:peat\\|turn\\)\\|then\\|until\\|while\\)\\_>\\|\\_<\\(?:and\\|not\\|or\\)\\_>"
. font-lock-keyword-face)
("::[ ]*\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>[ ]*::"
. font-lock-constant-face)
("\\_<goto[ ]+\\(?1:\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)\\_>"
(1 font-lock-constant-face))
("\\(?:^\\|[^:. ]\\|[.][.]\\)[ ]*\\(?:\\(?1:\\_<_G\\_>\\)\\|\\(?1:\\_<_VERSION\\_>\\)\\|\\(?1:\\_<assert\\_>\\)\\|\\(?1:\\_<collectgarbage\\_>\\)\\|\\(?1:\\_<dofile\\_>\\)\\|\\(?1:\\_<error\\_>\\)\\|\\(?1:\\_<getfenv\\_>\\)\\|\\(?1:\\_<getmetatable\\_>\\)\\|\\(?1:\\_<ipairs\\_>\\)\\|\\(?1:\\_<load\\_>\\)\\|\\(?1:\\_<loadfile\\_>\\)\\|\\(?1:\\_<loadstring\\_>\\)\\|\\(?1:\\_<module\\_>\\)\\|\\(?1:\\_<next\\_>\\)\\|\\(?1:\\_<pairs\\_>\\)\\|\\(?1:\\_<pcall\\_>\\)\\|\\(?1:\\_<print\\_>\\)\\|\\(?1:\\_<rawequal\\_>\\)\\|\\(?1:\\_<rawget\\_>\\)\\|\\(?1:\\_<rawlen\\_>\\)\\|\\(?1:\\_<rawset\\_>\\)\\|\\(?1:\\_<require\\_>\\)\\|\\(?1:\\_<select\\_>\\)\\|\\(?1:\\_<setfenv\\_>\\)\\|\\(?1:\\_<setmetatable\\_>\\)\\|\\(?1:\\_<tonumber\\_>\\)\\|\\(?1:\\_<tostring\\_>\\)\\|\\(?1:\\_<type\\_>\\)\\|\\(?1:\\_<unpack\\_>\\)\\|\\(?1:\\_<xpcall\\_>\\)\\|\\(?1:\\_<self\\_>\\)\\|\\(?1:\\_<warn\\_>\\)\\|\\(?1:\\_<bit32\\_>\\)\\(?:[ ]*\\.[ ]*\\_<\\(?2:\\(?:arshift\\|b\\(?:and\\|not\\|or\\|test\\|xor\\)\\|extract\\|l\\(?:rotate\\|shift\\)\\|r\\(?:eplace\\|rotate\\|shift\\)\\)\\)\\_>\\)?\\|\\(?1:\\_<coroutine\\_>\\)\\(?:[ ]*\\.[ ]*\\_<\\(?2:\\(?:create\\|isyieldable\\|r\\(?:esume\\|unning\\)\\|status\\|wrap\\|yield\\)\\)\\_>\\)?\\|\\(?1:\\_<debug\\_>\\)\\(?:[ ]*\\.[ ]*\\_<\\(?2:\\(?:debug\\|get\\(?:fenv\\|hook\\|info\\|local\\|metatable\\|registry\\|u\\(?:\\(?:p\\|ser\\)value\\)\\)\\|set\\(?:fenv\\|hook\\|local\\|\\(?:metatabl\\|u\\(?:\\(?:p\\|ser\\)valu\\)\\)e\\)\\|traceback\\|upvalue\\(?:id\\|join\\)\\)\\)\\_>\\)?\\|\\(?1:\\_<io\\_>\\)\\(?:[ ]*\\.[ ]*\\_<\\(?2:\\(?:close\\|flush\\|input\\|lines\\|o\\(?:pen\\|utput\\)\\|popen\\|read\\|std\\(?:err\\|in\\|out\\)\\|\\(?:t\\(?:mpfil\\|yp\\)\\|writ\\)e\\)\\)\\_>\\)?\\|\\(?1:\\_<math\\_>\\)\\(?:[ ]*\\.[ ]*\\_<\\(?2:\\(?:a\\(?:bs\\|cos\\|sin\\|tan2?\\)\\|c\\(?:eil\\|osh?\\)\\|deg\\|exp\\|f\\(?:loor\\|mod\\|rexp\\)\\|huge\\|l\\(?:dexp\\|og\\(?:10\\)?\\)\\|m\\(?:ax\\(?:integer\\)?\\|in\\(?:integer\\)?\\|odf\\)\\|p\\(?:i\\|ow\\)\\|ra\\(?:d\\|ndom\\(?:seed\\)?\\)\\|s\\(?:inh?\\|qrt\\)\\|t\\(?:anh?\\|ointeger\\|ype\\)\\|ult\\)\\)\\_>\\)?\\|\\(?1:\\_<os\\_>\\)\\(?:[ ]*\\.[ ]*\\_<\\(?2:\\(?:clock\\|d\\(?:\\(?:at\\|ifftim\\)e\\)\\|ex\\(?:ecute\\|it\\)\\|getenv\\|\\(?:re\\(?:mov\\|nam\\)\\|setlocal\\|t\\(?:\\(?:i\\|mpna\\)m\\)\\)e\\)\\)\\_>\\)?\\|\\(?1:\\_<package\\_>\\)\\(?:[ ]*\\.[ ]*\\_<\\(?2:\\(?:c\\(?:onfig\\|path\\)\\|load\\(?:e\\(?:d\\|rs\\)\\|lib\\)\\|p\\(?:ath\\|reload\\)\\|se\\(?:arch\\(?:ers\\|path\\)\\|eall\\)\\)\\)\\_>\\)?\\|\\(?1:\\_<string\\_>\\)\\(?:[ ]*\\.[ ]*\\_<\\(?2:\\(?:byte\\|char\\|dump\\|f\\(?:ind\\|ormat\\)\\|g\\(?:match\\|sub\\)\\|l\\(?:en\\|ower\\)\\|match\\|pack\\(?:size\\)?\\|re\\(?:p\\|verse\\)\\|sub\\|u\\(?:npack\\|pper\\)\\)\\)\\_>\\)?\\|\\(?1:\\_<table\\_>\\)\\(?:[ ]*\\.[ ]*\\_<\\(?2:\\(?:concat\\|insert\\|m\\(?:axn\\|ove\\)\\|pack\\|remove\\|sort\\|unpack\\)\\)\\_>\\)?\\|\\(?1:\\_<utf8\\_>\\)\\(?:[ ]*\\.[ ]*\\_<\\(?2:\\(?:c\\(?:har\\(?:pattern\\)?\\|ode\\(?:point\\|s\\)\\)\\|len\\|offset\\)\\)\\_>\\)?\\)"
(1 font-lock-builtin-face) (2 font-lock-builtin-face nil noerror))
("\\_<for\\_>[ ]+\\(?1:\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)[ ]*\\(?:,[ ]*\\(?2:\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)[ ]*\\(?:,[ ]*\\(?3:\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)[ ]*\\(?:,[ ]*\\(?4:\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)[ ]*\\(?:,[ ]*\\(?5:\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)[ ]*\\(?:,[ ]*\\(?6:\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)[ ]*\\(?:,[ ]*\\(?7:\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)[ ]*\\(?:,[ ]*\\(?8:\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)[ ]*\\(?:,[ ]*\\(?9:\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)[ ]*\\)?\\)?\\)?\\)?\\)?\\)?\\)?\\)?"
(1 font-lock-variable-name-face)
(2 font-lock-variable-name-face nil noerror)
(3 font-lock-variable-name-face nil noerror)
(4 font-lock-variable-name-face nil noerror)
(5 font-lock-variable-name-face nil noerror)
(6 font-lock-variable-name-face nil noerror)
(7 font-lock-variable-name-face nil noerror)
(8 font-lock-variable-name-face nil noerror)
(9 font-lock-variable-name-face nil noerror))
("\\_<function\\_>\\(?:[ ]+\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\(?:[ ]*\\.[ ]*\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)*\\(?:[ ]*:[ ]*\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)?\\)?[ ]*([ ]*\\(?1:\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)[ ]*\\(?:,[ ]*\\(?2:\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)[ ]*\\(?:,[ ]*\\(?3:\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)[ ]*\\(?:,[ ]*\\(?4:\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)[ ]*\\(?:,[ ]*\\(?5:\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)[ ]*\\(?:,[ ]*\\(?6:\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)[ ]*\\(?:,[ ]*\\(?7:\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)[ ]*\\(?:,[ ]*\\(?8:\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)[ ]*\\(?:,[ ]*\\(?9:\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)[ ]*\\)?\\)?\\)?\\)?\\)?\\)?\\)?\\)?"
(1 font-lock-variable-name-face)
(2 font-lock-variable-name-face nil noerror)
(3 font-lock-variable-name-face nil noerror)
(4 font-lock-variable-name-face nil noerror)
(5 font-lock-variable-name-face nil noerror)
(6 font-lock-variable-name-face nil noerror)
(7 font-lock-variable-name-face nil noerror)
(8 font-lock-variable-name-face nil noerror)
(9 font-lock-variable-name-face nil noerror))
("\\_<function\\_>[ ]*\\(?1:\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\(?:[ ]*\\.[ ]*\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)*\\(?:[ ]*:[ ]*\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)?\\)\\|\\(?1:\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\(?:[ ]*\\.[ ]*\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)*\\(?:[ ]*:[ ]*\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)?\\)[ ]*=[ ]*\\_<function\\_>"
(1 font-lock-function-name-face))
("\\_<local\\_>[ ]+\\(?1:\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)[ ]*\\(?:,[ ]*\\(?2:\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)[ ]*\\(?:,[ ]*\\(?3:\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)[ ]*\\(?:,[ ]*\\(?4:\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)[ ]*\\(?:,[ ]*\\(?5:\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)[ ]*\\(?:,[ ]*\\(?6:\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)[ ]*\\(?:,[ ]*\\(?7:\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)[ ]*\\(?:,[ ]*\\(?8:\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)[ ]*\\(?:,[ ]*\\(?9:\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)[ ]*\\)?\\)?\\)?\\)?\\)?\\)?\\)?\\)?"
(1 font-lock-variable-name-face)
(2 font-lock-variable-name-face nil noerror)
(3 font-lock-variable-name-face nil noerror)
(4 font-lock-variable-name-face nil noerror)
(5 font-lock-variable-name-face nil noerror)
(6 font-lock-variable-name-face nil noerror)
(7 font-lock-variable-name-face nil noerror)
(8 font-lock-variable-name-face nil noerror)
(9 font-lock-variable-name-face nil noerror))
("\\(?1:@\\_<\\(?:author\\|copyright\\|description\\|field\\|re\\(?:lease\\|turn\\)\\|\\(?:se\\|usag\\)e\\)\\_>\\)\\|\\(?1:@\\_<\\(?:class\\|name\\|param\\)\\_>\\)[ ]+\\(?2:\\_<[_[:alpha:]]+[_[:alnum:]]*\\_>\\)"
(1 font-lock-keyword-face t)
(2 font-lock-variable-name-face t noerror)))
Documentation
Default expressions to highlight in Lua mode.
Source Code
;; Defined in /usr/src/emacs/lisp/progmodes/lua-mode.el.gz
(defvar lua-font-lock-keywords
`(;; Highlight the hash-bang line "#!/foo/bar/lua" as comment
("^#!.*$" . font-lock-comment-face)
;; Builtin constants
(,(lua-rx (symbol "true" "false" "nil"))
. font-lock-constant-face)
;; Keywords
(,(lua-rx (or lua-keyword lua-keyword-operator))
. font-lock-keyword-face)
;; Labels used by the "goto" statement
;; Highlights the following syntax: ::label::
(,(lua-rx "::" ws lua-name ws "::")
. font-lock-constant-face)
;; Highlights the name of the label in the "goto" statement like
;; "goto label"
(,(lua-rx (symbol (seq "goto" ws+ (group-n 1 lua-name))))
(1 font-lock-constant-face))
;; Highlight Lua builtin functions and variables
(,lua--builtins
(1 font-lock-builtin-face) (2 font-lock-builtin-face nil noerror))
(,(lua-rx (symbol "for") ws+ lua-up-to-9-variables)
(1 font-lock-variable-name-face)
(2 font-lock-variable-name-face nil noerror)
(3 font-lock-variable-name-face nil noerror)
(4 font-lock-variable-name-face nil noerror)
(5 font-lock-variable-name-face nil noerror)
(6 font-lock-variable-name-face nil noerror)
(7 font-lock-variable-name-face nil noerror)
(8 font-lock-variable-name-face nil noerror)
(9 font-lock-variable-name-face nil noerror))
(,(lua-rx (symbol "function") (? ws+ lua-funcname)
ws "(" ws lua-up-to-9-variables)
(1 font-lock-variable-name-face)
(2 font-lock-variable-name-face nil noerror)
(3 font-lock-variable-name-face nil noerror)
(4 font-lock-variable-name-face nil noerror)
(5 font-lock-variable-name-face nil noerror)
(6 font-lock-variable-name-face nil noerror)
(7 font-lock-variable-name-face nil noerror)
(8 font-lock-variable-name-face nil noerror)
(9 font-lock-variable-name-face nil noerror))
(,(lua-rx lua-funcheader)
(1 font-lock-function-name-face))
;; local x, y, z
;; local x = .....
;;
;; NOTE: this is intentionally below funcheader matcher, so that in
;;
;; local foo = function() ...
;;
;; "foo" is fontified as function-name-face, and variable-name-face
;; is not applied.
(,(lua-rx (symbol "local") ws+ lua-up-to-9-variables)
(1 font-lock-variable-name-face)
(2 font-lock-variable-name-face nil noerror)
(3 font-lock-variable-name-face nil noerror)
(4 font-lock-variable-name-face nil noerror)
(5 font-lock-variable-name-face nil noerror)
(6 font-lock-variable-name-face nil noerror)
(7 font-lock-variable-name-face nil noerror)
(8 font-lock-variable-name-face nil noerror)
(9 font-lock-variable-name-face nil noerror))
(,(lua-rx (or (group-n 1
"@" (symbol "author" "copyright" "field" "release"
"return" "see" "usage" "description"))
(seq (group-n 1 "@" (symbol "param" "class" "name")) ws+
(group-n 2 lua-name))))
(1 font-lock-keyword-face t)
(2 font-lock-variable-name-face t noerror)))
"Default expressions to highlight in Lua mode.")