diff options
| author | Christian Clason <c.clason@uni-graz.at> | 2023-06-12 09:54:30 -0600 |
|---|---|---|
| committer | Christian Clason <c.clason@uni-graz.at> | 2025-05-12 18:43:40 +0200 |
| commit | 692b051b09935653befdb8f7ba8afdb640adf17b (patch) | |
| tree | 167162b6b129ae04f68c5735078521a72917c742 /queries/d | |
| parent | feat(c-family): inherit injections (diff) | |
| download | nvim-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 'queries/d')
| -rw-r--r-- | queries/d/folds.scm | 4 | ||||
| -rw-r--r-- | queries/d/highlights.scm | 374 | ||||
| -rw-r--r-- | queries/d/indents.scm | 24 | ||||
| -rw-r--r-- | queries/d/injections.scm | 19 | ||||
| -rw-r--r-- | queries/d/locals.scm | 79 |
5 files changed, 0 insertions, 500 deletions
diff --git a/queries/d/folds.scm b/queries/d/folds.scm deleted file mode 100644 index 49d6256f6..000000000 --- a/queries/d/folds.scm +++ /dev/null @@ -1,4 +0,0 @@ -[ - (block_statement) - (aggregate_body) -] @fold diff --git a/queries/d/highlights.scm b/queries/d/highlights.scm deleted file mode 100644 index 11d08a1b7..000000000 --- a/queries/d/highlights.scm +++ /dev/null @@ -1,374 +0,0 @@ -; Keywords -[ - (directive) - (shebang) -] @keyword.directive - -[ - (import) - (module) -] @keyword.import - -[ - (alias) - (asm) - (class) - (delegate) - (delete) - (enum) - (interface) - (invariant) - (mixin) - (pragma) - (struct) - (template) - (union) - (unittest) - (version) - (with) - (traits) - (vector) - (parameters_) - (default) - (goto) -] @keyword - -(function) @keyword.function - -(synchronized) @keyword.coroutine - -[ - (if) - (else) - (switch) - (case) - (break) -] @keyword.conditional - -[ - (do) - (for) - (foreach) - (foreach_reverse) - (while) - (continue) -] @keyword.repeat - -(return) @keyword.return - -[ - (abstract) - (deprecated) - (private) - (protected) - (public) - (package) - (immutable) - (final) - (const) - (override) - (static) -] @keyword.modifier - -[ - (assert) - (try) - (catch) - (finally) - (throw) - (nothrow) -] @keyword.exception - -[ - (cast) - (new) - (in) - (is) - (not_in) - (not_is) - (typeid) - (typeof) -] @keyword.operator - -[ - (lazy) - (align) - (extern) - (scope) - (ref) - (pure) - (export) - (shared) - (gshared) - (out) - (inout) -] @keyword.modifier - -(parameter_attribute - (return) @keyword.modifier) - -(parameter_attribute - (in) @keyword.modifier) - -(parameter_attribute - (out) @keyword.modifier) - -(debug) @keyword.debug - -; Operators -[ - "/=" - "/" - ".." - "&" - "&=" - "&&" - "|" - "|=" - "||" - "-" - "-=" - "--" - "+" - "+=" - "++" - "<" - "<=" - "<<" - "<<=" - ">" - ">=" - ">>=" - ">>>=" - ">>" - ">>>" - "!" - "!=" - "$" - "=" - "==" - "*" - "*=" - "%" - "%=" - "^" - "^=" - "^^" - "^^=" - "~" - "~=" - "@" -] @operator - -; Variables -(identifier) @variable - -[ - "exit" - "success" - "failure" - (this) - (super) -] @variable.builtin - -(linkage_attribute - "(" - _ @variable.builtin - ")") - -; Modules -(module_fqn - (identifier) @module) - -; Attributes -(at_attribute - (identifier) @attribute) - -; Constants -(enum_member - (identifier) @constant) - -(manifest_declarator - . - (identifier) @constant) - -; Members -(aggregate_body - (variable_declaration - (declarator - (identifier) @variable.member))) - -(property_expression - "." - (identifier) @variable.member) - -(type - "." - (identifier) @variable.member) - -; Types -(class_declaration - (class) - . - (identifier) @type) - -(struct_declaration - (struct) - . - (identifier) @type) - -(union_declaration - (union) - . - (identifier) @type) - -(enum_declaration - (enum) - . - (identifier) @type) - -(alias_declaration - (alias) - . - (identifier) @type) - -((identifier) @type - (#lua-match? @type "^[A-Z].*")) - -(type - . - (identifier) @type .) - -[ - (auto) - (void) - (bool) - (byte) - (ubyte) - (char) - (short) - (ushort) - (wchar) - (dchar) - (int) - (uint) - (long) - (ulong) - (real) - (double) - (float) - (cent) - (ucent) - (ireal) - (idouble) - (ifloat) - (creal) - (double) - (cfloat) -] @type.builtin - -; Functions -(function_declaration - (identifier) @function) - -(call_expression - (identifier) @function) - -(call_expression - (type - (identifier) @function .)) - -(call_expression - (property_expression - (call_expression) - (identifier) @function .)) - -; Parameters -(parameter - (_) - (identifier) @variable.parameter) - -(function_literal - "(" - (type - (identifier) @variable.parameter)) - -; Constructors -(constructor - (this) @constructor) - -(destructor - (this) @constructor) - -(postblit - . - (this) @constructor) - -; Punctuation -[ - ";" - "." - ":" - "," - "=>" -] @punctuation.delimiter - -[ - "(" - ")" - "[" - "]" - "{" - "}" -] @punctuation.bracket - -"..." @punctuation.special - -; Ternaries -(ternary_expression - [ - "?" - ":" - ] @keyword.conditional.ternary) - -; Labels -(label - (identifier) @label) - -(goto_statement - (identifier) @label) - -; Literals -(string_literal) @string - -[ - (int_literal) - (float_literal) -] @number - -(char_literal) @character - -[ - (true) - (false) -] @boolean - -[ - (null) - (special_keyword) -] @constant.builtin - -; Comments -(comment) @comment @spell - -((comment) @comment.documentation - (#lua-match? @comment.documentation "^///[^/]")) - -((comment) @comment.documentation - (#lua-match? @comment.documentation "^///$")) - -((comment) @comment.documentation - (#lua-match? @comment.documentation "^/[*][*][^*].*[*]/$")) - -((comment) @comment.documentation - (#lua-match? @comment.documentation "^/[+][+][^+].*[+]/$")) diff --git a/queries/d/indents.scm b/queries/d/indents.scm deleted file mode 100644 index c89b4e91d..000000000 --- a/queries/d/indents.scm +++ /dev/null @@ -1,24 +0,0 @@ -[ - (parameters) - (template_parameters) - (expression_statement) - (aggregate_body) - (function_body) - (scope_statement) - (block_statement) - (case_statement) -] @indent.begin - -(comment) @indent.auto - -[ - (case) - (default) - "}" - "]" -] @indent.branch - -[ - (directive) - (shebang) -] @indent.zero diff --git a/queries/d/injections.scm b/queries/d/injections.scm deleted file mode 100644 index cfc1bf986..000000000 --- a/queries/d/injections.scm +++ /dev/null @@ -1,19 +0,0 @@ -((comment) @injection.content - (#set! injection.language "comment")) - -((call_expression - (type) @_printf - (named_arguments - "(" - . - (named_argument - (expression - (string_literal) @injection.content)))) - (#eq? @_printf "printf") - (#offset! @injection.content 0 1 0 -1) - (#set! injection.language "printf")) - -; TODO: uncomment when asm is added -; ((asm_inline) @injection.content -; (#set! injection.language "asm") -; (#set! injection.combined)) diff --git a/queries/d/locals.scm b/queries/d/locals.scm deleted file mode 100644 index 2cd7b9e89..000000000 --- a/queries/d/locals.scm +++ /dev/null @@ -1,79 +0,0 @@ -; Scopes -[ - (source_file) - (block_statement) - (aggregate_body) -] @local.scope - -; References -(identifier) @local.reference - -; Definitions -(module_def - (module_declaration - (module_fqn) @local.definition.namespace) - (#set! definition.namespace.scope "global")) - -(enum_declaration - (enum_member - . - (identifier) @local.definition.enum)) - -(class_declaration - (class) - . - (identifier) @local.definition.type) - -(struct_declaration - (struct) - . - (identifier) @local.definition.type) - -(union_declaration - (union) - . - (identifier) @local.definition.type) - -(enum_declaration - (enum) - . - (identifier) @local.definition.type) - -(alias_declaration - (alias_initializer - . - (identifier) @local.definition.type)) - -(constructor - (this) @local.definition.method) - -(destructor - (this) @local.definition.method) - -(postblit - (this) @local.definition.method) - -(aggregate_body - (function_declaration - (identifier) @local.definition.method)) - -(manifest_declarator - . - (identifier) @local.definition.constant) - -(anonymous_enum_declaration - (enum_member - . - (identifier) @local.definition.constant)) - -(variable_declaration - (declarator - (identifier) @local.definition.var)) - -(aggregate_body - (variable_declaration - (declarator - (identifier) @local.definition.field))) - -(function_declaration - (identifier) @local.definition.function) |
