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 /runtime/queries/gap/highlights.scm | |
| 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 'runtime/queries/gap/highlights.scm')
| -rw-r--r-- | runtime/queries/gap/highlights.scm | 208 |
1 files changed, 208 insertions, 0 deletions
diff --git a/runtime/queries/gap/highlights.scm b/runtime/queries/gap/highlights.scm new file mode 100644 index 000000000..6c0c856c5 --- /dev/null +++ b/runtime/queries/gap/highlights.scm @@ -0,0 +1,208 @@ +(identifier) @variable + +; Functions +(assignment_statement + left: (identifier) @function + right: (function)) + +(assignment_statement + left: (identifier) @function + right: (atomic_function)) + +(assignment_statement + left: (identifier) @function + right: (lambda)) + +(call + function: (identifier) @function.call) + +((call + function: (identifier) @function.builtin) + (#any-of? @function.builtin "Assert" "Info" "IsBound" "Unbind" "TryNextMethod")) + +(parameters + (identifier) @variable.parameter) + +(qualified_parameters + (identifier) @variable.parameter) + +(qualified_parameters + (qualified_identifier + (identifier) @variable.parameter)) + +(lambda_parameters + (identifier) @variable.parameter) + +; arg is treated specially when it is the only parameter of a function +((parameters + . + (identifier) @variable.parameter.builtin .) + (#eq? @variable.parameter.builtin "arg")) + +((qualified_parameters + . + (identifier) @variable.parameter.builtin .) + (#eq? @variable.parameter.builtin "arg")) + +((qualified_parameters + . + (qualified_identifier + (identifier) @variable.parameter.builtin) .) + (#eq? @variable.parameter.builtin "arg")) + +((lambda_parameters + . + (identifier) @variable.parameter.builtin .) + (#eq? @variable.parameter.builtin "arg")) + +; Literals +(bool) @constant.builtin + +(integer) @number + +(float) @number.float + +(string) @string + +(char) @character + +(escape_sequence) @string.escape + +[ + (help_topic) + (help_book) +] @string.special + +(tilde) @variable.builtin + +; Record selectors +(record_entry + left: [ + (identifier) + (integer) + ] @variable.member) + +(record_selector + selector: [ + (identifier) + (integer) + ] @variable.member) + +(component_selector + selector: [ + (identifier) + (integer) + ] @variable.member) + +(function_call_option + [ + (identifier) + (record_entry ;Record entries specify global properties in function calls + left: [ + (identifier) + (integer) + ]) + ] @property) + +(help_statement + (help_selector) @property) + +; Operators +[ + "+" + "-" + "*" + "/" + "^" + "->" + ":=" + "<" + "<=" + "<>" + "=" + ">" + ">=" + ".." + (ellipsis) +] @operator + +(help_statement + (help_operator) @operator) + +; Keywords +[ + (break_statement) + (continue_statement) + "atomic" + (quit_statement) +] @keyword + +[ + "function" + "local" + "end" +] @keyword.function + +[ + "and" + "in" + "mod" + "not" + "or" +] @keyword.operator + +"rec" @keyword.type + +[ + "readonly" + "readwrite" +] @keyword.modifier + +(atomic_function + "atomic" @keyword.modifier) + +[ + "for" + "while" + "do" + "od" + "repeat" + "until" +] @keyword.repeat + +[ + "if" + "then" + "elif" + "else" + "fi" +] @keyword.conditional + +"return" @keyword.return + +(pragma) @keyword.directive + +;Punctuation +[ + "," + ";" + "." + "!." + ":" +] @punctuation.delimiter + +[ + "(" + ")" + "[" + "![" + "]" + "{" + "}" +] @punctuation.bracket + +(help_statement + "?" @punctuation.special) + +;Comments +(comment) @comment @spell |
