mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-03 03:56:52 -04:00
feat!: drop modules, general refactor and cleanup
This commit is contained in:
parent
c13e28f894
commit
2c8f2f2fad
829 changed files with 4905 additions and 8010 deletions
195
runtime/queries/awk/highlights.scm
Normal file
195
runtime/queries/awk/highlights.scm
Normal file
|
|
@ -0,0 +1,195 @@
|
|||
; adapted from https://github.com/Beaglefoot/tree-sitter-awk
|
||||
|
||||
[
|
||||
(identifier)
|
||||
(field_ref)
|
||||
] @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
|
||||
(regex) @string.regex
|
||||
(escape_sequence) @string.escape
|
||||
|
||||
(comment) @comment @spell
|
||||
|
||||
((program . (comment) @preproc)
|
||||
(#lua-match? @preproc "^#!/"))
|
||||
|
||||
(ns_qualified_name (namespace) @namespace)
|
||||
(ns_qualified_name "::" @punctuation.delimiter)
|
||||
|
||||
(func_def name: (_ (identifier) @function) @function)
|
||||
(func_call name: (_ (identifier) @function) @function)
|
||||
|
||||
(func_def (param_list (identifier) @parameter))
|
||||
|
||||
[
|
||||
"print"
|
||||
"printf"
|
||||
"getline"
|
||||
] @function.builtin
|
||||
|
||||
[
|
||||
(delete_statement)
|
||||
(break_statement)
|
||||
(continue_statement)
|
||||
(next_statement)
|
||||
(nextfile_statement)
|
||||
] @keyword
|
||||
|
||||
[
|
||||
"func"
|
||||
"function"
|
||||
] @keyword.function
|
||||
|
||||
[
|
||||
"return"
|
||||
"exit"
|
||||
] @keyword.return
|
||||
|
||||
[
|
||||
"do"
|
||||
"while"
|
||||
"for"
|
||||
"in"
|
||||
] @repeat
|
||||
|
||||
[
|
||||
"if"
|
||||
"else"
|
||||
"switch"
|
||||
"case"
|
||||
"default"
|
||||
] @conditional
|
||||
|
||||
[
|
||||
"@include"
|
||||
"@load"
|
||||
] @include
|
||||
|
||||
"@namespace" @preproc
|
||||
|
||||
[
|
||||
"BEGIN"
|
||||
"END"
|
||||
"BEGINFILE"
|
||||
"ENDFILE"
|
||||
] @label
|
||||
|
||||
(binary_exp [
|
||||
"^"
|
||||
"**"
|
||||
"*"
|
||||
"/"
|
||||
"%"
|
||||
"+"
|
||||
"-"
|
||||
"<"
|
||||
">"
|
||||
"<="
|
||||
">="
|
||||
"=="
|
||||
"!="
|
||||
"~"
|
||||
"!~"
|
||||
"in"
|
||||
"&&"
|
||||
"||"
|
||||
] @operator)
|
||||
|
||||
(unary_exp [
|
||||
"!"
|
||||
"+"
|
||||
"-"
|
||||
] @operator)
|
||||
|
||||
(assignment_exp [
|
||||
"="
|
||||
"+="
|
||||
"-="
|
||||
"*="
|
||||
"/="
|
||||
"%="
|
||||
"^="
|
||||
] @operator)
|
||||
|
||||
(ternary_exp [
|
||||
"?"
|
||||
":"
|
||||
] @conditional.ternary)
|
||||
|
||||
(update_exp [
|
||||
"++"
|
||||
"--"
|
||||
] @operator)
|
||||
|
||||
(redirected_io_statement [
|
||||
">"
|
||||
">>"
|
||||
] @operator)
|
||||
|
||||
(piped_io_statement [
|
||||
"|"
|
||||
"|&"
|
||||
] @operator)
|
||||
|
||||
(piped_io_exp [
|
||||
"|"
|
||||
"|&"
|
||||
] @operator)
|
||||
|
||||
(field_ref "$" @punctuation.delimiter)
|
||||
|
||||
(regex "/" @punctuation.delimiter)
|
||||
(regex_constant "@" @punctuation.delimiter)
|
||||
|
||||
[ ";" "," ] @punctuation.delimiter
|
||||
|
||||
[
|
||||
"("
|
||||
")"
|
||||
"["
|
||||
"]"
|
||||
"{"
|
||||
"}"
|
||||
] @punctuation.bracket
|
||||
5
runtime/queries/awk/injections.scm
Normal file
5
runtime/queries/awk/injections.scm
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
((comment) @injection.content
|
||||
(#set! injection.language "comment"))
|
||||
|
||||
((regex) @injection.content
|
||||
(#set! injection.language "regex"))
|
||||
Loading…
Add table
Add a link
Reference in a new issue