| 1 | (self) @variable.builtin |
| 2 | |
| 3 | (unit_definition (identifier) @function) |
| 4 | |
| 5 | (parameter (identifier) @variable.parameter) |
| 6 | |
| 7 | ((pipeline_reg_marker) @keyword) |
| 8 | |
| 9 | (scoped_identifier |
| 10 | path: (identifier) @namespace) |
| 11 | (scoped_identifier |
| 12 | (scoped_identifier |
| 13 | name: (identifier) @namespace)) |
| 14 | |
| 15 | ((builtin_type) @type.builtin) |
| 16 | |
| 17 | ((identifier) @type.builtin |
| 18 | (#any-of? |
| 19 | @type.builtin |
| 20 | "uint" |
| 21 | "Option" |
| 22 | "Memory")) |
| 23 | |
| 24 | ((identifier) @type.enum.variant.builtin |
| 25 | (#any-of? @type.enum.variant.builtin "Some" "None")) |
| 26 | |
| 27 | ((pipeline_stage_name) @label) |
| 28 | ((label) @label) |
| 29 | ((label_ref) @label) |
| 30 | |
| 31 | ((stage_reference |
| 32 | stage: (identifier) @label)) |
| 33 | |
| 34 | [ |
| 35 | "pipeline" |
| 36 | "let" |
| 37 | "set" |
| 38 | "entity" |
| 39 | "fn" |
| 40 | "reg" |
| 41 | "reset" |
| 42 | "initial" |
| 43 | "inst" |
| 44 | "assert" |
| 45 | "struct" |
| 46 | "enum" |
| 47 | "stage" |
| 48 | "impl" |
| 49 | "port" |
| 50 | "decl" |
| 51 | "mod" |
| 52 | "where" |
| 53 | "trait" |
| 54 | "for" |
| 55 | "pub" |
| 56 | "unsafe" |
| 57 | "type" |
| 58 | "as" |
| 59 | "initial" |
| 60 | ] @keyword |
| 61 | |
| 62 | [ |
| 63 | "wire" |
| 64 | "super" |
| 65 | "lib" |
| 66 | ] @keyword.storage |
| 67 | |
| 68 | [ |
| 69 | "use" |
| 70 | ] @keyword.control.import |
| 71 | |
| 72 | [ |
| 73 | "gen" |
| 74 | ] @keyword.directive |
| 75 | |
| 76 | ((gen_if_expression ["if" "else"] @keyword.directive)) |
| 77 | ((naked_gen_if_expression ["if" "else"] @keyword.directive)) |
| 78 | |
| 79 | ((attribute) ["#" "[" "]"] @punctuation.delimiter) |
| 80 | |
| 81 | [ |
| 82 | "else" |
| 83 | "if" |
| 84 | "match" |
| 85 | ] @keyword.control.conditional |
| 86 | |
| 87 | (bool_literal) @constant.builtin.boolean |
| 88 | (int_literal) @constant.numeric.integer |
| 89 | (char_literal) @constant.character |
| 90 | (string_literal) @string |
| 91 | |
| 92 | [ |
| 93 | "&" |
| 94 | "inv" |
| 95 | "-" |
| 96 | "=>" |
| 97 | ">" |
| 98 | "<" |
| 99 | "::<" |
| 100 | "::$<" |
| 101 | "=" |
| 102 | "->" |
| 103 | "~" |
| 104 | "!" |
| 105 | ] @operator |
| 106 | |
| 107 | |
| 108 | ((op_custom_infix) @operator) |
| 109 | ((op_add) @operator) |
| 110 | ((op_sub) @operator) |
| 111 | ((op_mul) @operator) |
| 112 | ((op_equals) @operator) |
| 113 | ((op_lt) @operator) |
| 114 | ((op_gt) @operator) |
| 115 | ((op_le) @operator) |
| 116 | ((op_ge) @operator) |
| 117 | ((op_lshift) @operator) |
| 118 | ((op_rshift) @operator) |
| 119 | ((op_bitwise_and) @operator) |
| 120 | ((op_bitwise_xor) @operator) |
| 121 | ((op_bitwise_or) @operator) |
| 122 | ((op_logical_and) @operator) |
| 123 | ((op_logical_or) @operator) |
| 124 | |
| 125 | |
| 126 | [ |
| 127 | (line_comment) |
| 128 | (block_comment) |
| 129 | ] @comment |
| 130 | |
| 131 | [ |
| 132 | (doc_comment) |
| 133 | ] @comment.block.documentation |
| 134 | |
| 135 | |
| 136 | ((identifier) @type |
| 137 | (#match? @type "[A-Z]")) |
| 138 | |
| 139 | ((scoped_identifier |
| 140 | name: (identifier) @type) |
| 141 | (#match? @type "^[A-Z]")) |
| 142 | |
| 143 | ((identifier) @constant |
| 144 | (#match? @constant "^[A-Z][A-Z\\d_]*$")) |
| 145 |