aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephan Seitz <stephan.seitz@fau.de>2021-07-25 15:27:51 +0200
committerThomas Vigouroux <tomvig38@gmail.com>2021-08-02 15:20:07 +0200
commitf96c409e3d2b5c4f8fe76f3e049958a293f13167 (patch)
treea94580c3a1d5d423df8daa61b97fc1dbd90ec76d
parentUpdate lockfile.json (diff)
downloadnvim-treesitter-f96c409e3d2b5c4f8fe76f3e049958a293f13167.tar
nvim-treesitter-f96c409e3d2b5c4f8fe76f3e049958a293f13167.tar.gz
nvim-treesitter-f96c409e3d2b5c4f8fe76f3e049958a293f13167.tar.bz2
nvim-treesitter-f96c409e3d2b5c4f8fe76f3e049958a293f13167.tar.lz
nvim-treesitter-f96c409e3d2b5c4f8fe76f3e049958a293f13167.tar.xz
nvim-treesitter-f96c409e3d2b5c4f8fe76f3e049958a293f13167.tar.zst
nvim-treesitter-f96c409e3d2b5c4f8fe76f3e049958a293f13167.zip
Update teal highlights
-rw-r--r--queries/teal/folds.scm7
-rw-r--r--queries/teal/highlights.scm30
-rw-r--r--queries/teal/indents.scm2
-rw-r--r--queries/teal/locals.scm14
4 files changed, 27 insertions, 26 deletions
diff --git a/queries/teal/folds.scm b/queries/teal/folds.scm
index 8820a67fa..4583057cf 100644
--- a/queries/teal/folds.scm
+++ b/queries/teal/folds.scm
@@ -1,6 +1,7 @@
[
(do_statement)
-(for_statement)
+(numeric_for_statement)
+(generic_for_statement)
(while_statement)
(repeat_statement)
(if_statement)
@@ -10,7 +11,3 @@
(anon_function)
(table_constructor)
] @fold
-
-(record_body
- (record_entry
- value: (record_body)) @fold)
diff --git a/queries/teal/highlights.scm b/queries/teal/highlights.scm
index 8e9621242..04d4306db 100644
--- a/queries/teal/highlights.scm
+++ b/queries/teal/highlights.scm
@@ -19,8 +19,8 @@
;; Basic statements/Keywords
[ "if" "then" "elseif" "else" ] @conditional
[ "for" "while" "repeat" "until" ] @repeat
-[ "in" "local" (break) (goto) "do" "end" ] @keyword
"return" @keyword.return
+[ "in" "local" (break) (goto) "do" "end" ] @keyword
(label) @label
;; Global isn't a real keyword, but it gets special treatment in these places
@@ -69,13 +69,17 @@
name: (identifier) @type)
(anon_record . "record" @keyword)
(record_body
- (record_entry
- . [ "record" "enum" ] @keyword
- . key: (identifier) @type))
+ (record_declaration
+ . [ "record" ] @keyword
+ . name: (identifier) @type))
+(record_body
+ (enum_declaration
+ . [ "enum" ] @keyword
+ . name: (identifier) @type))
(record_body
- (record_entry
+ (typedef
. "type" @keyword
- . key: (identifier) @type . "="))
+ . name: (identifier) @type . "="))
(record_body
(metamethod "metamethod" @keyword))
(record_body
@@ -86,7 +90,7 @@
name: (identifier) @type)
(type_declaration "type" @keyword)
-(type_declaration (type_name) @type)
+(type_declaration (identifier) @type)
(simple_type) @type
(type_index) @type
(type_union "|" @operator)
@@ -94,12 +98,14 @@
;; The rest of it
(var_declaration
- (var name: (identifier) @variable))
+ declarators: (var_declarators
+ (var name: (identifier) @variable)))
(var_declaration
- (var
- "<" @punctuation.bracket
- . attribute: (attribute) @attribute
- . ">" @punctuation.bracket))
+ declarators: (var_declarators
+ (var
+ "<" @punctuation.bracket
+ . attribute: (attribute) @attribute
+ . ">" @punctuation.bracket)))
[ "(" ")" "[" "]" "{" "}" ] @punctuation.bracket
;; Only highlight format specifiers in calls to string.format
diff --git a/queries/teal/indents.scm b/queries/teal/indents.scm
index ede388186..b199015a6 100644
--- a/queries/teal/indents.scm
+++ b/queries/teal/indents.scm
@@ -1,11 +1,9 @@
[
(record_declaration)
- (record_entry)
(anon_function)
(function_body)
(table_constructor)
(if_statement)
- (for_statement)
(return_statement)
(while_statement)
] @indent
diff --git a/queries/teal/locals.scm b/queries/teal/locals.scm
index 86b6a9354..431e659a1 100644
--- a/queries/teal/locals.scm
+++ b/queries/teal/locals.scm
@@ -1,23 +1,23 @@
-
(var_declaration
- (var (identifier)) @definition.var)
+ declarators: (var_declarators
+ (var (identifier)) @definition.var))
(var_assignment
- (var (identifier) @definition.var) @definition.associated)
+ variables: (assignment_variables
+ (var (identifier) @definition.var) @definition.associated))
(arg name: (identifier) @definition.parameter)
(anon_function) @scope
((function_statement
- (function_name) @definition.function) @scope
- (#set! definition.function.scope "parent"))
+ (function_name) @definition.function) @scope)
(program) @scope
(if_statement) @scope
-(for_statement (for_body) @scope)
+(generic_for_statement (for_body) @scope)
+(numeric_for_statement (for_body) @scope)
(repeat_statement) @scope
(while_statement (while_body) @scope)
(do_statement) @scope
(identifier) @reference
-