mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-02 19:46:58 -04:00
feat(awk): highlight builtin variables & shebang
This commit is contained in:
parent
13c72dddb7
commit
20a6c66b76
1 changed files with 41 additions and 0 deletions
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue