diff options
Diffstat (limited to 'Queries/highlights.scm')
| -rw-r--r-- | Queries/highlights.scm | 123 |
1 files changed, 123 insertions, 0 deletions
diff --git a/Queries/highlights.scm b/Queries/highlights.scm new file mode 100644 index 0000000..b366bc7 --- /dev/null +++ b/Queries/highlights.scm | |||
| @@ -0,0 +1,123 @@ | |||
| 1 | (comment) @comment | ||
| 2 | |||
| 3 | [ | ||
| 4 | (string) | ||
| 5 | (multiline_string) | ||
| 6 | (character) | ||
| 7 | ] @string | ||
| 8 | |||
| 9 | [ | ||
| 10 | (integer) | ||
| 11 | (float) | ||
| 12 | ] @value.number | ||
| 13 | |||
| 14 | [ | ||
| 15 | "true" | ||
| 16 | "false" | ||
| 17 | ] @value.boolean | ||
| 18 | |||
| 19 | [ | ||
| 20 | "null" | ||
| 21 | "undefined" | ||
| 22 | "unreachable" | ||
| 23 | ] @value.null | ||
| 24 | |||
| 25 | (builtin_type) @identifier.type | ||
| 26 | (builtin_identifier) @identifier.core | ||
| 27 | |||
| 28 | ((builtin_identifier) @processing | ||
| 29 | (#match? @processing "^@(import|cImport)$")) | ||
| 30 | |||
| 31 | ((identifier) @identifier.core | ||
| 32 | (#eq? @identifier.core "_")) | ||
| 33 | |||
| 34 | (parameter | ||
| 35 | name: (identifier) @identifier.argument) | ||
| 36 | |||
| 37 | (payload | ||
| 38 | (identifier) @identifier.argument) | ||
| 39 | |||
| 40 | (field_expression | ||
| 41 | member: (identifier) @identifier.property) | ||
| 42 | |||
| 43 | (field_initializer | ||
| 44 | (identifier) @identifier.property) | ||
| 45 | |||
| 46 | (function_declaration | ||
| 47 | name: (identifier) @identifier.function) | ||
| 48 | |||
| 49 | (call_expression | ||
| 50 | function: (identifier) @identifier.function) | ||
| 51 | |||
| 52 | (call_expression | ||
| 53 | function: (field_expression | ||
| 54 | member: (identifier) @identifier.function)) | ||
| 55 | |||
| 56 | ((identifier) @identifier.type | ||
| 57 | (#match? @identifier.type "^[A-Z][A-Za-z0-9_]*$")) | ||
| 58 | |||
| 59 | ((identifier) @identifier.constant | ||
| 60 | (#match? @identifier.constant "^[A-Z][A-Z0-9_]+$")) | ||
| 61 | |||
| 62 | [ | ||
| 63 | "asm" | ||
| 64 | "const" | ||
| 65 | "defer" | ||
| 66 | "errdefer" | ||
| 67 | "error" | ||
| 68 | "return" | ||
| 69 | "test" | ||
| 70 | "var" | ||
| 71 | ] @keyword | ||
| 72 | |||
| 73 | [ | ||
| 74 | "struct" | ||
| 75 | "union" | ||
| 76 | "enum" | ||
| 77 | "opaque" | ||
| 78 | "fn" | ||
| 79 | ] @keyword.construct | ||
| 80 | |||
| 81 | [ | ||
| 82 | "if" | ||
| 83 | "else" | ||
| 84 | "switch" | ||
| 85 | "for" | ||
| 86 | "while" | ||
| 87 | "try" | ||
| 88 | "catch" | ||
| 89 | "break" | ||
| 90 | "continue" | ||
| 91 | ] @keyword.condition | ||
| 92 | |||
| 93 | [ | ||
| 94 | "usingnamespace" | ||
| 95 | "export" | ||
| 96 | "comptime" | ||
| 97 | "inline" | ||
| 98 | "noinline" | ||
| 99 | "extern" | ||
| 100 | "pub" | ||
| 101 | "packed" | ||
| 102 | "threadlocal" | ||
| 103 | "volatile" | ||
| 104 | "allowzero" | ||
| 105 | "noalias" | ||
| 106 | "addrspace" | ||
| 107 | "align" | ||
| 108 | "callconv" | ||
| 109 | "linksection" | ||
| 110 | "async" | ||
| 111 | "await" | ||
| 112 | "suspend" | ||
| 113 | "nosuspend" | ||
| 114 | "resume" | ||
| 115 | ] @keyword.modifier | ||
| 116 | |||
| 117 | [ | ||
| 118 | "and" | ||
| 119 | "or" | ||
| 120 | "orelse" | ||
| 121 | ] @keyword.operator | ||
| 122 | |||
| 123 | (ERROR) @invalid | ||
