diff options
Diffstat (limited to 'runtime/queries/func')
| -rw-r--r-- | runtime/queries/func/highlights.scm | 167 | ||||
| -rw-r--r-- | runtime/queries/func/injections.scm | 2 |
2 files changed, 169 insertions, 0 deletions
diff --git a/runtime/queries/func/highlights.scm b/runtime/queries/func/highlights.scm new file mode 100644 index 000000000..9fd6dd82d --- /dev/null +++ b/runtime/queries/func/highlights.scm @@ -0,0 +1,167 @@ +; Include +"#include" @keyword.import + +(include_path) @string + +; Preproc +"#pragma" @keyword.directive + +(pragma_directive + [ + "version" + "not-version" + "test-version-set" + ] @keyword.directive) + +; Keywords +[ + "asm" + "impure" + "inline" + "inline_ref" + "method_id" + "type" +] @keyword + +"return" @keyword.return + +; Conditionals +[ + "if" + "ifnot" + "else" + "elseif" + "elseifnot" + "until" +] @keyword.conditional + +; Exceptions +[ + "try" + "catch" +] @keyword.exception + +; Repeats +[ + "do" + "forall" + "repeat" + "while" +] @keyword.repeat + +; Qualifiers +[ + "const" + "global" + (var) +] @keyword.modifier + +; Variables +(identifier) @variable + +; Constants +(const_var_declarations + name: (identifier) @constant) + +; Functions/Methods +(function_definition + name: (function_name) @function) + +(function_application + function: (identifier) @function) + +(method_call + method_name: (identifier) @function.method.call) + +; Parameters +(parameter) @variable.parameter + +; Types +(type_identifier) @type + +(primitive_type) @type.builtin + +; Operators +[ + "=" + "+=" + "-=" + "*=" + "/=" + "~/=" + "^/=" + "%=" + "~%=" + "^%=" + "<<=" + ">>=" + "~>>=" + "^>>=" + "&=" + "|=" + "^=" + "==" + "<" + ">" + "<=" + ">=" + "!=" + "<=>" + "<<" + ">>" + "~>>" + "^>>" + "-" + "+" + "|" + "^" + "*" + "/" + "%" + "~/" + "^/" + "~%" + "^%" + "/%" + "&" + "~" +] @operator + +; Literals +[ + (string) + (asm_instruction) +] @string + +[ + (string_type) + (underscore) +] @character.special + +(number) @number + +; Punctuation +[ + "{" + "}" +] @punctuation.bracket + +[ + "(" + ")" + "()" +] @punctuation.bracket + +[ + "[" + "]" +] @punctuation.bracket + +[ + ";" + "," + "->" +] @punctuation.delimiter + +; Comments +(comment) @comment @spell diff --git a/runtime/queries/func/injections.scm b/runtime/queries/func/injections.scm new file mode 100644 index 000000000..2f0e58eb6 --- /dev/null +++ b/runtime/queries/func/injections.scm @@ -0,0 +1,2 @@ +((comment) @injection.content + (#set! injection.language "comment")) |
