feat(awk): highlight builtin variables & shebang

This commit is contained in:
ObserverOfTime 2023-06-24 21:35:51 +03:00
parent 13c72dddb7
commit 20a6c66b76

View file

@ -6,6 +6,44 @@
] @variable
(field_ref (_) @variable)
; https://www.gnu.org/software/gawk/manual/html_node/Auto_002dset.html
((identifier) @constant.builtin
(#any-of? @constant.builtin
"ARGC"
"ARGV"
"ARGIND"
"ENVIRON"
"ERRNO"
"FILENAME"
"FNR"
"NF"
"FUNCTAB"
"NR"
"PROCINFO"
"RLENGTH"
"RSTART"
"RT"
"SYMTAB"))
; https://www.gnu.org/software/gawk/manual/html_node/User_002dmodified.html
((identifier) @variable.builtin
(#any-of? @variable.builtin
"BINMODE"
"CONVFMT"
"FIELDWIDTHS"
"FPAT"
"FS"
"IGNORECASE"
"LINT"
"OFMT"
"OFS"
"ORS"
"PREC"
"ROUNDMODE"
"RS"
"SUBSEP"
"TEXTDOMAIN"))
(number) @number
(string) @string
@ -14,6 +52,9 @@
(comment) @comment @spell
((program . (comment) @preproc)
(#lua-match? @preproc "^#!/"))
(ns_qualified_name (namespace) @namespace)
(ns_qualified_name "::" @punctuation.delimiter)