aboutsummaryrefslogtreecommitdiffstats
path: root/runtime/queries/tiger/highlights.scm
diff options
context:
space:
mode:
authorChristian Clason <c.clason@uni-graz.at>2023-06-12 09:54:30 -0600
committerChristian Clason <c.clason@uni-graz.at>2025-05-12 18:43:40 +0200
commit692b051b09935653befdb8f7ba8afdb640adf17b (patch)
tree167162b6b129ae04f68c5735078521a72917c742 /runtime/queries/tiger/highlights.scm
parentfeat(c-family): inherit injections (diff)
downloadnvim-treesitter-692b051b09935653befdb8f7ba8afdb640adf17b.tar
nvim-treesitter-692b051b09935653befdb8f7ba8afdb640adf17b.tar.gz
nvim-treesitter-692b051b09935653befdb8f7ba8afdb640adf17b.tar.bz2
nvim-treesitter-692b051b09935653befdb8f7ba8afdb640adf17b.tar.lz
nvim-treesitter-692b051b09935653befdb8f7ba8afdb640adf17b.tar.xz
nvim-treesitter-692b051b09935653befdb8f7ba8afdb640adf17b.tar.zst
nvim-treesitter-692b051b09935653befdb8f7ba8afdb640adf17b.zip
feat!: drop modules, general refactor and cleanup
Diffstat (limited to 'runtime/queries/tiger/highlights.scm')
-rw-r--r--runtime/queries/tiger/highlights.scm121
1 files changed, 121 insertions, 0 deletions
diff --git a/runtime/queries/tiger/highlights.scm b/runtime/queries/tiger/highlights.scm
new file mode 100644
index 000000000..cbb1f2310
--- /dev/null
+++ b/runtime/queries/tiger/highlights.scm
@@ -0,0 +1,121 @@
+; Built-ins {{{
+((function_call
+ function: (identifier) @function.builtin)
+ (#any-of? @function.builtin
+ "chr" "concat" "exit" "flush" "getchar" "not" "ord" "print" "print_err" "print_int" "size"
+ "strcmp" "streq" "substring"))
+
+((type_identifier) @type.builtin
+ (#any-of? @type.builtin "int" "string" "Object"))
+
+((identifier) @variable.builtin
+ (#eq? @variable.builtin "self"))
+
+; }}}
+; Keywords {{{
+[
+ "function"
+ "primitive"
+ "method"
+] @keyword.function
+
+[
+ "do"
+ "for"
+ "to"
+ "while"
+] @keyword.repeat
+
+"new" @keyword.operator
+
+"import" @keyword.import
+
+[
+ "array"
+ (break_expression)
+ "else"
+ "end"
+ "if"
+ "in"
+ "let"
+ "of"
+ "then"
+ "type"
+ "var"
+ "extends"
+ "_cast"
+ "_chunks"
+ "_exp"
+ "_lvalue"
+ "_namety"
+] @keyword
+
+"class" @keyword.type
+
+; }}}
+; Operators {{{
+(operator) @operator
+
+[
+ ","
+ ";"
+ ":"
+ "."
+] @punctuation.delimiter
+
+[
+ "("
+ ")"
+ "["
+ "]"
+ "{"
+ "}"
+] @punctuation.bracket
+
+; }}}
+; Functions and methods {{{
+(function_call
+ function: (identifier) @function)
+
+(function_declaration
+ name: (identifier) @function)
+
+(primitive_declaration
+ name: (identifier) @function)
+
+(method_call
+ method: (identifier) @function.method)
+
+(method_declaration
+ name: (identifier) @function.method)
+
+(parameters
+ name: (identifier) @variable.parameter)
+
+; }}}
+; Declarations {{{
+(import_declaration
+ file: (string_literal) @string.special.path)
+
+; }}}
+; Literals {{{
+(nil_literal) @constant.builtin
+
+(integer_literal) @number
+
+(string_literal) @string
+
+(escape_sequence) @string.escape
+
+; }}}
+; Misc {{{
+(comment) @comment @spell
+
+(type_identifier) @type
+
+(field_identifier) @variable.member
+
+(identifier) @variable
+
+; }}}
+; vim: sw=2 foldmethod=marker