mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-18 03:10:04 -04:00
Update teal highlights
This commit is contained in:
parent
06a6510637
commit
548a0d8d7f
3 changed files with 44 additions and 19 deletions
|
|
@ -385,7 +385,6 @@ list.teal = {
|
||||||
install_info = {
|
install_info = {
|
||||||
url = "https://github.com/euclidianAce/tree-sitter-teal",
|
url = "https://github.com/euclidianAce/tree-sitter-teal",
|
||||||
files = { "src/parser.c", "src/scanner.c" },
|
files = { "src/parser.c", "src/scanner.c" },
|
||||||
requires_generate_from_grammar = true,
|
|
||||||
},
|
},
|
||||||
maintainers = {'@euclidianAce'},
|
maintainers = {'@euclidianAce'},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -10,3 +10,7 @@
|
||||||
(anon_function)
|
(anon_function)
|
||||||
(table_constructor)
|
(table_constructor)
|
||||||
] @fold
|
] @fold
|
||||||
|
|
||||||
|
(record_body
|
||||||
|
(record_entry
|
||||||
|
value: (record_body)) @fold)
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,21 @@
|
||||||
|
|
||||||
|
;; Primitives
|
||||||
|
(boolean) @boolean
|
||||||
|
(comment) @comment
|
||||||
|
(shebang_comment) @comment
|
||||||
|
(identifier) @variable
|
||||||
|
((identifier) @variable.builtin
|
||||||
|
(#eq? @variable.builtin "self"))
|
||||||
|
(nil) @constant.builtin
|
||||||
|
(number) @number
|
||||||
|
(string) @string
|
||||||
|
(table_constructor ["{" "}"] @constructor)
|
||||||
|
(varargs "..." @constant.builtin)
|
||||||
|
[ "," "." ":" ";" ] @punctuation.delimiter
|
||||||
|
|
||||||
|
(escape_sequence) @string.escape
|
||||||
|
(format_specifier) @string.escape
|
||||||
|
|
||||||
;; Basic statements/Keywords
|
;; Basic statements/Keywords
|
||||||
[ "if" "then" "elseif" "else" ] @conditional
|
[ "if" "then" "elseif" "else" ] @conditional
|
||||||
[ "for" "while" "repeat" "until" ] @repeat
|
[ "for" "while" "repeat" "until" ] @repeat
|
||||||
|
|
@ -13,12 +30,9 @@
|
||||||
(enum_declaration "global" @keyword)
|
(enum_declaration "global" @keyword)
|
||||||
|
|
||||||
;; Ops
|
;; Ops
|
||||||
[ "not" "and" "or" "as" "is" ] @keyword.operator
|
(bin_op (op) @operator)
|
||||||
|
(unary_op (op) @operator)
|
||||||
[ "=" "~=" "==" "<=" ">=" "<" ">"
|
[ "=" "as" ] @operator
|
||||||
"+" "-" "%" "/" "//" "*" "^"
|
|
||||||
"&" "~" "|" ">>" "<<"
|
|
||||||
".." "#" ] @operator
|
|
||||||
|
|
||||||
;; Functions
|
;; Functions
|
||||||
(function_statement
|
(function_statement
|
||||||
|
|
@ -86,17 +100,25 @@
|
||||||
. attribute: (attribute) @attribute
|
. attribute: (attribute) @attribute
|
||||||
. ">" @punctuation.bracket))
|
. ">" @punctuation.bracket))
|
||||||
[ "(" ")" "[" "]" "{" "}" ] @punctuation.bracket
|
[ "(" ")" "[" "]" "{" "}" ] @punctuation.bracket
|
||||||
(boolean) @boolean
|
|
||||||
(comment) @comment
|
;; Only highlight format specifiers in calls to string.format
|
||||||
(shebang_comment) @comment
|
;; string.format('...')
|
||||||
(identifier) @variable
|
;(function_call
|
||||||
((identifier) @variable.builtin
|
; called_object: (index
|
||||||
(#eq? @variable.builtin "self"))
|
; (identifier) @base
|
||||||
(nil) @constant.builtin
|
; key: (identifier) @entry)
|
||||||
(number) @number
|
; arguments: (arguments .
|
||||||
(string) @string
|
; (string (format_specifier) @string.escape))
|
||||||
(table_constructor ["{" "}"] @constructor)
|
;
|
||||||
(varargs "..." @constant.builtin)
|
; (#eq? @base "string")
|
||||||
[ "," "." ":" ";" ] @punctuation.delimiter
|
; (#eq? @entry "format"))
|
||||||
|
|
||||||
|
;; ('...'):format()
|
||||||
|
;(function_call
|
||||||
|
; called_object: (method_index
|
||||||
|
; (string (format_specifier) @string.escape)
|
||||||
|
; key: (identifier) @func-name)
|
||||||
|
; (#eq? @func-name "format"))
|
||||||
|
|
||||||
|
|
||||||
(ERROR) @error
|
(ERROR) @error
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue