aboutsummaryrefslogtreecommitdiff
path: root/runtime/queries
diff options
context:
space:
mode:
authorBlaž Hrastnik2021-11-21 11:06:45 +0000
committerBlaž Hrastnik2021-11-21 11:06:45 +0000
commitd1854d8e6af07cd78ab6c24c859a4471afb3514e (patch)
tree301e4212e7fc88dd5f626f884bd78b700cf3e4a6 /runtime/queries
parent8b85903116fdfdc177bf2ca171831674144de70a (diff)
parentb95c9470de9f9199f109fdbfb6ec9a951fbe8866 (diff)
Merge remote-tracking branch 'origin/master' into debug
Diffstat (limited to 'runtime/queries')
-rw-r--r--runtime/queries/glsl/folds.scm1
-rw-r--r--runtime/queries/glsl/highlights.scm37
-rw-r--r--runtime/queries/glsl/indents.toml19
-rw-r--r--runtime/queries/glsl/injections.scm3
-rw-r--r--runtime/queries/glsl/locals.scm1
-rw-r--r--runtime/queries/json/indents.toml9
-rw-r--r--runtime/queries/perl/highlights.scm181
-rw-r--r--runtime/queries/perl/textobjects.scm8
8 files changed, 259 insertions, 0 deletions
diff --git a/runtime/queries/glsl/folds.scm b/runtime/queries/glsl/folds.scm
new file mode 100644
index 00000000..a5a5208c
--- /dev/null
+++ b/runtime/queries/glsl/folds.scm
@@ -0,0 +1 @@
+; inherits: c
diff --git a/runtime/queries/glsl/highlights.scm b/runtime/queries/glsl/highlights.scm
new file mode 100644
index 00000000..af2a049f
--- /dev/null
+++ b/runtime/queries/glsl/highlights.scm
@@ -0,0 +1,37 @@
+; inherits: c
+
+[
+ "in"
+ "out"
+ "inout"
+ "uniform"
+ "shared"
+ "layout"
+ "attribute"
+ "varying"
+ "buffer"
+ "coherent"
+ "readonly"
+ "writeonly"
+ "precision"
+ "highp"
+ "mediump"
+ "lowp"
+ "centroid"
+ "sample"
+ "patch"
+ "smooth"
+ "flat"
+ "noperspective"
+ "invariant"
+ "precise"
+] @keyword
+
+"subroutine" @keyword.function
+
+(extension_storage_class) @attribute
+
+(
+ (identifier) @variable.builtin
+ (#match? @variable.builtin "^gl_")
+)
diff --git a/runtime/queries/glsl/indents.toml b/runtime/queries/glsl/indents.toml
new file mode 100644
index 00000000..a7fd499a
--- /dev/null
+++ b/runtime/queries/glsl/indents.toml
@@ -0,0 +1,19 @@
+indent = [
+ "init_declarator",
+ "compound_statement",
+ "preproc_arg",
+ "field_declaration_list",
+ "case_statement",
+ "conditional_expression",
+ "enumerator_list",
+ "struct_specifier",
+ "compound_literal_expression"
+]
+
+outdent = [
+ "#define",
+ "#ifdef",
+ "#endif",
+ "{",
+ "}"
+]
diff --git a/runtime/queries/glsl/injections.scm b/runtime/queries/glsl/injections.scm
new file mode 100644
index 00000000..7d3323b1
--- /dev/null
+++ b/runtime/queries/glsl/injections.scm
@@ -0,0 +1,3 @@
+(preproc_arg) @glsl
+
+(comment) @comment
diff --git a/runtime/queries/glsl/locals.scm b/runtime/queries/glsl/locals.scm
new file mode 100644
index 00000000..a5a5208c
--- /dev/null
+++ b/runtime/queries/glsl/locals.scm
@@ -0,0 +1 @@
+; inherits: c
diff --git a/runtime/queries/json/indents.toml b/runtime/queries/json/indents.toml
new file mode 100644
index 00000000..64a8d175
--- /dev/null
+++ b/runtime/queries/json/indents.toml
@@ -0,0 +1,9 @@
+indent = [
+ "object",
+ "array"
+]
+
+outdent = [
+ "]",
+ "}"
+]
diff --git a/runtime/queries/perl/highlights.scm b/runtime/queries/perl/highlights.scm
new file mode 100644
index 00000000..b6f04291
--- /dev/null
+++ b/runtime/queries/perl/highlights.scm
@@ -0,0 +1,181 @@
+; Variables
+(variable_declaration
+ .
+ (scope) @keyword)
+[
+(single_var_declaration)
+(scalar_variable)
+(array_variable)
+(hash_variable)
+(hash_variable)
+] @variable
+
+
+[
+(package_name)
+(special_scalar_variable)
+(special_array_variable)
+(special_hash_variable)
+(special_literal)
+(super)
+] @constant
+
+(
+ [
+ (package_name)
+ (super)
+ ]
+ .
+ ("::" @operator)
+)
+
+(comments) @comment
+(pod_statement) @comment.block.documentation
+
+[
+(use_no_statement)
+(use_no_feature_statement)
+(use_no_if_statement)
+(use_no_version)
+(use_constant_statement)
+(use_parent_statement)
+] @keyword
+
+(use_constant_statement
+ constant: (identifier) @constant)
+
+[
+"require"
+] @keyword
+
+(method_invocation
+ .
+ (identifier) @variable)
+
+(method_invocation
+ (arrow_operator)
+ .
+ (identifier) @function)
+(method_invocation
+ function_name: (identifier) @function)
+(named_block_statement
+ function_name: (identifier) @function)
+
+(call_expression
+ function_name: (identifier) @function)
+(function_definition
+ name: (identifier) @function)
+[
+(function)
+(map)
+(grep)
+(bless)
+] @function
+
+[
+"return"
+"sub"
+"package"
+"BEGIN"
+"END"
+] @keyword.function
+
+[
+"("
+")"
+"["
+"]"
+"{"
+"}"
+] @punctuation.bracket
+(standard_input_to_variable) @punctuation.bracket
+
+[
+"=~"
+"or"
+"="
+"=="
+"+"
+"-"
+"."
+"//"
+"||"
+(arrow_operator)
+(hash_arrow_operator)
+(array_dereference)
+(hash_dereference)
+(to_reference)
+(type_glob)
+(hash_access_variable)
+(ternary_expression)
+(ternary_expression_in_hash)
+] @operator
+
+[
+(regex_option)
+(regex_option_for_substitution)
+(regex_option_for_transliteration)
+] @variable.parameter
+
+(type_glob
+ (identifier) @variable)
+(
+ (scalar_variable)
+ .
+ ("->" @operator))
+
+[
+(word_list_qw)
+(command_qx_quoted)
+(string_single_quoted)
+(string_double_quoted)
+(string_qq_quoted)
+(bareword)
+(transliteration_tr_or_y)
+] @string
+
+[
+(regex_pattern_qr)
+(patter_matcher_m)
+(substitution_pattern_s)
+] @string.regexp
+
+(escape_sequence) @string.special
+
+[
+","
+(semi_colon)
+(start_delimiter)
+(end_delimiter)
+(ellipsis_statement)
+] @punctuation.delimiter
+
+[
+(integer)
+(floating_point)
+(scientific_notation)
+(hexadecimal)
+] @constant.numeric
+
+[
+; (if_statement)
+(unless_statement)
+(if_simple_statement)
+(unless_simple_statement)
+] @keyword.control.conditional
+
+[
+"if"
+"elsif"
+"else"
+] @keyword.control.conditional
+
+(foreach_statement) @keyword.control.repeat
+(foreach_statement
+ .
+ (scope) @keyword)
+
+(function_attribute) @label
+
+(function_signature) @type
+
diff --git a/runtime/queries/perl/textobjects.scm b/runtime/queries/perl/textobjects.scm
new file mode 100644
index 00000000..988e22b4
--- /dev/null
+++ b/runtime/queries/perl/textobjects.scm
@@ -0,0 +1,8 @@
+(function_definition
+ (identifier) (_) @function.inside) @function.around
+
+(anonymous_function
+ (_) @function.inside) @function.around
+
+(argument
+ (_) @parameter.inside)