diff options
| author | Pham Huy Hoang <hoangtun0810@gmail.com> | 2024-01-06 15:05:50 +0900 |
|---|---|---|
| committer | Christian Clason <c.clason@uni-graz.at> | 2024-01-19 16:58:37 +0100 |
| commit | 57a8acf0c4ed5e7f6dda83c3f9b073f8a99a70f9 (patch) | |
| tree | 70bf645539882b88e6fa129cefd30986b89bbac3 /queries/ispc | |
| parent | ci: add query lint job (diff) | |
| download | nvim-treesitter-57a8acf0c4ed5e7f6dda83c3f9b073f8a99a70f9.tar nvim-treesitter-57a8acf0c4ed5e7f6dda83c3f9b073f8a99a70f9.tar.gz nvim-treesitter-57a8acf0c4ed5e7f6dda83c3f9b073f8a99a70f9.tar.bz2 nvim-treesitter-57a8acf0c4ed5e7f6dda83c3f9b073f8a99a70f9.tar.lz nvim-treesitter-57a8acf0c4ed5e7f6dda83c3f9b073f8a99a70f9.tar.xz nvim-treesitter-57a8acf0c4ed5e7f6dda83c3f9b073f8a99a70f9.tar.zst nvim-treesitter-57a8acf0c4ed5e7f6dda83c3f9b073f8a99a70f9.zip | |
chore: query formatting
Diffstat (limited to 'queries/ispc')
| -rw-r--r-- | queries/ispc/folds.scm | 1 | ||||
| -rw-r--r-- | queries/ispc/highlights.scm | 76 | ||||
| -rw-r--r-- | queries/ispc/indents.scm | 11 | ||||
| -rw-r--r-- | queries/ispc/locals.scm | 8 |
4 files changed, 41 insertions, 55 deletions
diff --git a/queries/ispc/folds.scm b/queries/ispc/folds.scm index 45d0ba131..331c70345 100644 --- a/queries/ispc/folds.scm +++ b/queries/ispc/folds.scm @@ -1,5 +1,4 @@ ; inherits: c - [ (foreach_statement) (foreach_instance_statement) diff --git a/queries/ispc/highlights.scm b/queries/ispc/highlights.scm index 6b1d2bd96..3877bafa3 100644 --- a/queries/ispc/highlights.scm +++ b/queries/ispc/highlights.scm @@ -1,5 +1,4 @@ ; inherits: c - [ "soa" "task" @@ -26,9 +25,7 @@ "foreach_unique" ] @keyword.repeat -[ - "cif" -] @keyword.conditional +"cif" @keyword.conditional [ "varying" @@ -37,56 +34,45 @@ "__regcall" @attribute -(overload_declarator name: _ @function) -(foreach_statement range_operator: _ @operator) +(overload_declarator + name: _ @function) + +(foreach_statement + range_operator: _ @operator) + +(short_vector + [ + "<" + ">" + ] @punctuation.bracket) + +(soa_qualifier + [ + "<" + ">" + ] @punctuation.bracket) + +(template_argument_list + [ + "<" + ">" + ] @punctuation.bracket) -(short_vector ["<" ">"] @punctuation.bracket) -(soa_qualifier ["<" ">"] @punctuation.bracket) -(template_argument_list ["<" ">"] @punctuation.bracket) -(template_parameter_list ["<" ">"] @punctuation.bracket) +(template_parameter_list + [ + "<" + ">" + ] @punctuation.bracket) (llvm_identifier) @function.builtin ; built-in variables ((identifier) @variable.builtin - (#any-of? @variable.builtin - "programCount" - "programIndex" - "taskCount" - "taskCount0" - "taskCount1" - "taskCount2" - "taskIndex" - "taskIndex0" - "taskIndex1" - "taskIndex2" - "threadCount" - "threadIndex" - )) + (#any-of? @variable.builtin "programCount" "programIndex" "taskCount" "taskCount0" "taskCount1" "taskCount2" "taskIndex" "taskIndex0" "taskIndex1" "taskIndex2" "threadCount" "threadIndex")) ; preprocessor constants ((identifier) @constant.builtin - (#any-of? @constant.builtin - "ISPC" - "ISPC_FP16_SUPPORTED" - "ISPC_FP64_SUPPORTED" - "ISPC_LLVM_INTRINSICS_ENABLED" - "ISPC_MAJOR_VERSION" - "ISPC_MINOR_VERSION" - "ISPC_POINTER_SIZE" - "ISPC_TARGET_AVX" - "ISPC_TARGET_AVX2" - "ISPC_TARGET_AVX512KNL" - "ISPC_TARGET_AVX512SKX" - "ISPC_TARGET_AVX512SPR" - "ISPC_TARGET_NEON" - "ISPC_TARGET_SSE2" - "ISPC_TARGET_SSE4" - "ISPC_UINT_IS_DEFINED" - "PI" - "TARGET_ELEMENT_WIDTH" - "TARGET_WIDTH" - )) + (#any-of? @constant.builtin "ISPC" "ISPC_FP16_SUPPORTED" "ISPC_FP64_SUPPORTED" "ISPC_LLVM_INTRINSICS_ENABLED" "ISPC_MAJOR_VERSION" "ISPC_MINOR_VERSION" "ISPC_POINTER_SIZE" "ISPC_TARGET_AVX" "ISPC_TARGET_AVX2" "ISPC_TARGET_AVX512KNL" "ISPC_TARGET_AVX512SKX" "ISPC_TARGET_AVX512SPR" "ISPC_TARGET_NEON" "ISPC_TARGET_SSE2" "ISPC_TARGET_SSE4" "ISPC_UINT_IS_DEFINED" "PI" "TARGET_ELEMENT_WIDTH" "TARGET_WIDTH")) ; standard library built-in ((type_identifier) @type.builtin diff --git a/queries/ispc/indents.scm b/queries/ispc/indents.scm index cc0829d5c..bf64a963b 100644 --- a/queries/ispc/indents.scm +++ b/queries/ispc/indents.scm @@ -1,7 +1,8 @@ ; inherits: c +((foreach_statement + body: (_) @_body) @indent.begin + (#not-has-type? @_body compound_statement)) -((foreach_statement body: (_) @_body) @indent.begin - (#not-has-type? @_body compound_statement)) - -((foreach_instance_statement body: (_) @_body) @indent.begin - (#not-has-type? @_body compound_statement)) +((foreach_instance_statement + body: (_) @_body) @indent.begin + (#not-has-type? @_body compound_statement)) diff --git a/queries/ispc/locals.scm b/queries/ispc/locals.scm index e2e5a9663..54e328083 100644 --- a/queries/ispc/locals.scm +++ b/queries/ispc/locals.scm @@ -1,17 +1,17 @@ ; inherits: c - (reference_declarator (identifier) @local.definition.var) (type_parameter_declaration (type_identifier) @local.definition.type) + (template_declaration) @local.scope (template_function name: (identifier) @local.definition.function) @local.scope [ - (foreach_statement) - (foreach_instance_statement) - (unmasked_statement) + (foreach_statement) + (foreach_instance_statement) + (unmasked_statement) ] @local.scope |
