update runtime for teal language

pull/12081/head
barsoosayque 2 days ago
parent 48fbf095f6
commit 2b1cd48820

@ -1283,7 +1283,6 @@ source = { git = "https://github.com/euclidianAce/tree-sitter-teal", rev = "485f
[[language]] [[language]]
name = "teal" name = "teal"
auto-format = false
scope = "source.tl" scope = "source.tl"
injection-regex = "teal" injection-regex = "teal"
file-types = ["tl"] file-types = ["tl"]
@ -1291,7 +1290,6 @@ comment-tokens = "--"
block-comment-tokens = { start = "--[[", end = "--]]" } block-comment-tokens = { start = "--[[", end = "--]]" }
roots = [ "tlconfig.lua" ] roots = [ "tlconfig.lua" ]
language-servers = [ "teal-lsp" ] language-servers = [ "teal-lsp" ]
grammar = "teal"
[[language]] [[language]]
name = "svelte" name = "svelte"

@ -1,34 +1,38 @@
;; Primitives ;; Primitives
(boolean) @boolean (boolean) @constant.builtin.boolean
(comment) @comment (comment) @comment
(shebang_comment) @comment (shebang_comment) @comment
(identifier) @variable (identifier) @variable
((identifier) @variable.builtin ((identifier) @variable.builtin
(#eq? @variable.builtin "self")) (#eq? @variable.builtin "self"))
(nil) @constant.builtin (nil) @constant.builtin
(number) @number (number) @constant.numeric
(string) @string (string) @string
(table_constructor ["{" "}"] @constructor) (table_constructor ["{" "}"] @constructor)
(varargs "..." @constant.builtin) (varargs "..." @constant.builtin)
[ "," "." ":" ";" ] @punctuation.delimiter [ "," "." ":" ";" ] @punctuation.delimiter
(escape_sequence) @string.escape (escape_sequence) @constant.character.escape
(format_specifier) @string.escape (format_specifier) @constant.character.escape
;; Basic statements/Keywords ;; Basic statements/Keywords
[ "if" "then" "elseif" "else" ] @conditional [ "if" "then" "elseif" "else" ] @keyword.control.conditional
[ "for" "while" "repeat" "until" ] @repeat [ "for" "while" "repeat" "until" "do" ] @keyword.control.repeat
[ "in" "local" "return" (break) (goto) "do" "end" ] @keyword [ "end" ] @keyword
[ "in" ] @keyword.operator
[ "local" ] @keyword.storage.type
[ (break) (goto) ] @keyword.control
[ "return" ] @keyword.control.return
(label) @label (label) @label
;; Global isn't a real keyword, but it gets special treatment in these places ;; Global isn't a real keyword, but it gets special treatment in these places
(var_declaration "global" @keyword) (var_declaration "global" @keyword.storage.type)
(type_declaration "global" @keyword) (type_declaration "global" @keyword.storage.type)
(function_statement "global" @keyword) (function_statement "global" @keyword.storage.type)
(record_declaration "global" @keyword) (record_declaration "global" @keyword.storage.type)
(interface_declaration "global" @keyword) (interface_declaration "global" @keyword.storage.type)
(enum_declaration "global" @keyword) (enum_declaration "global" @keyword.storage.type)
(macroexp_statement "macroexp" @keyword) (macroexp_statement "macroexp" @keyword)
@ -45,7 +49,7 @@
"function" @keyword.function) "function" @keyword.function)
(function_body "end" @keyword.function) (function_body "end" @keyword.function)
(arg name: (identifier) @parameter) (arg name: (identifier) @variable.parameter)
(function_signature (function_signature
(arguments (arguments
@ -54,8 +58,8 @@
(typeargs (typeargs
"<" @punctuation.bracket "<" @punctuation.bracket
. (_) @parameter . (_) @type.parameter
. ("," . (_) @parameter)* . ("," . (_) @type.parameter)*
. ">" @punctuation.bracket) . ">" @punctuation.bracket)
(function_call (function_call
@ -69,63 +73,63 @@
; Contextual keywords in record bodies ; Contextual keywords in record bodies
(record_declaration (record_declaration
. [ "record" ] @keyword . [ "record" ] @keyword.storage.type
name: (identifier) @type) name: (identifier) @type)
(anon_record . "record" @keyword) (anon_record . "record" @keyword.storage.type)
(record_body (record_body
(record_declaration (record_declaration
. [ "record" ] @keyword . [ "record" ] @keyword.storage.type
. name: (identifier) @type)) . name: (identifier) @type))
(record_body (record_body
(enum_declaration (enum_declaration
. [ "enum" ] @keyword . [ "enum" ] @keyword.storage.type
. name: (identifier) @type)) . name: (identifier) @type.enum))
(record_body (record_body
(interface_declaration (interface_declaration
. [ "interface" ] @keyword . [ "interface" ] @keyword.storage.type
. name: (identifier) @type)) . name: (identifier) @type))
(record_body (record_body
(typedef (typedef
. "type" @keyword . "type" @keyword.storage.type
. name: (identifier) @type . "=")) . name: (identifier) @type . "="))
(record_body (record_body
(macroexp_declaration (macroexp_declaration
. [ "macroexp" ] @keyword)) . [ "macroexp" ] @keyword.storage.type))
(record_body (metamethod "metamethod" @keyword)) (record_body (metamethod "metamethod" @keyword.storage.modifier))
(record_body (userdata) @keyword) (record_body (userdata) @keyword.storage.modifier)
; Contextual keywords in interface bodies ; Contextual keywords in interface bodies
(interface_declaration (interface_declaration
. [ "interface" ] @keyword . [ "interface" ] @keyword.storage.type
name: (identifier) @type) name: (identifier) @type)
(anon_interface . "interface" @keyword) (anon_interface . "interface" @keyword.storage.type)
(interface_body (interface_body
(record_declaration (record_declaration
. [ "record" ] @keyword . [ "record" ] @keyword.storage.type
. name: (identifier) @type)) . name: (identifier) @type))
(interface_body (interface_body
(enum_declaration (enum_declaration
. [ "enum" ] @keyword . [ "enum" ] @keyword.storage.type
. name: (identifier) @type)) . name: (identifier) @type.enum))
(interface_body (interface_body
(interface_declaration (interface_declaration
. [ "interface" ] @keyword . [ "interface" ] @keyword.storage.type
. name: (identifier) @type)) . name: (identifier) @type))
(interface_body (interface_body
(typedef (typedef
. "type" @keyword . "type" @keyword.storage.type
. name: (identifier) @type . "=")) . name: (identifier) @type . "="))
(interface_body (interface_body
(macroexp_declaration (macroexp_declaration
. [ "macroexp" ] @keyword)) . [ "macroexp" ] @keyword.storage.type))
(interface_body (metamethod "metamethod" @keyword)) (interface_body (metamethod "metamethod" @keyword.storage.modifier))
(interface_body (userdata) @keyword) (interface_body (userdata) @keyword.storage.modifier)
(enum_declaration (enum_declaration
"enum" @keyword "enum" @keyword.storage.type
name: (identifier) @type) name: (identifier) @type.enum)
(type_declaration "type" @keyword) (type_declaration "type" @keyword.storage.type)
(type_declaration (identifier) @type) (type_declaration (identifier) @type)
(simple_type) @type (simple_type) @type
(type_index) @type (type_index) @type

@ -1,26 +1,26 @@
(var_declaration (var_declaration
declarators: (var_declarators declarators: (var_declarators
(var (identifier)) @definition.var)) (var (identifier)) @local.definition.var))
(var_assignment (var_assignment
variables: (assignment_variables variables: (assignment_variables
(var (identifier) @definition.var) @definition.associated)) (var (identifier) @local.definition.var) @local.definition.associated))
(arg name: (identifier) @definition.parameter) (arg name: (identifier) @local.definition.parameter)
(anon_function) @scope (anon_function) @local.scope
((function_statement ((function_statement
(function_name) @definition.function) @scope (function_name) @local.definition.function) @local.scope
(#set! definition.function.scope "parent")) (#set! local.definition.function.local.scope "parent"))
(program) @scope (program) @local.scope
(if_statement) @scope (if_statement) @local.scope
(generic_for_statement (for_body) @scope) (generic_for_statement (for_body) @local.scope)
(numeric_for_statement (for_body) @scope) (numeric_for_statement (for_body) @local.scope)
(repeat_statement) @scope (repeat_statement) @local.scope
(while_statement (while_body) @scope) (while_statement (while_body) @local.scope)
(do_statement) @scope (do_statement) @local.scope
(identifier) @reference (identifier) @local.reference

Loading…
Cancel
Save