| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
[ |
| 21 |
"%" |
| 22 |
] @punctuation |
| 23 |
|
| 24 |
[ |
| 25 |
"," |
| 26 |
";" |
| 27 |
] @punctuation.delimiter |
| 28 |
|
| 29 |
[ |
| 30 |
"(" |
| 31 |
")" |
| 32 |
"[" |
| 33 |
"]" |
| 34 |
"{" |
| 35 |
"}" |
| 36 |
"<<" |
| 37 |
">>" |
| 38 |
] @punctuation.bracket |
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
(boolean) @constant.builtin.boolean |
| 43 |
(nil) @constant.builtin |
| 44 |
(integer) @constant.numeric.integer |
| 45 |
(float) @constant.numeric.float |
| 46 |
(char) @constant.character |
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
(identifier) @variable |
| 52 |
|
| 53 |
|
| 54 |
( |
| 55 |
(identifier) @comment.unused |
| 56 |
(#match? @comment.unused "^_") |
| 57 |
) |
| 58 |
|
| 59 |
|
| 60 |
( |
| 61 |
(identifier) @constant.builtin |
| 62 |
(#any-of? @constant.builtin "__MODULE__" "__DIR__" "__ENV__" "__CALLER__" "__STACKTRACE__") |
| 63 |
) |
| 64 |
|
| 65 |
|
| 66 |
|
| 67 |
(comment) @comment |
| 68 |
|
| 69 |
|
| 70 |
|
| 71 |
(interpolation "#{" @punctuation.special "}" @punctuation.special) @embedded |
| 72 |
|
| 73 |
(escape_sequence) @constant.character.escape |
| 74 |
|
| 75 |
[ |
| 76 |
(string) |
| 77 |
(charlist) |
| 78 |
] @string |
| 79 |
|
| 80 |
[ |
| 81 |
(atom) |
| 82 |
(quoted_atom) |
| 83 |
(keyword) |
| 84 |
(quoted_keyword) |
| 85 |
] @string.special.symbol |
| 86 |
|
| 87 |
|
| 88 |
|
| 89 |
(sigil |
| 90 |
(sigil_name) @__name__ |
| 91 |
quoted_start: _ @string.special |
| 92 |
quoted_end: _ @string.special) @string.special |
| 93 |
|
| 94 |
(sigil |
| 95 |
(sigil_name) @__name__ |
| 96 |
quoted_start: _ @string |
| 97 |
quoted_end: _ @string |
| 98 |
(#match? @__name__ "^[sS]$")) @string |
| 99 |
|
| 100 |
(sigil |
| 101 |
(sigil_name) @__name__ |
| 102 |
quoted_start: _ @string.regexp |
| 103 |
quoted_end: _ @string.regexp |
| 104 |
(#match? @__name__ "^[rR]$")) @string.regexp |
| 105 |
|
| 106 |
|
| 107 |
|
| 108 |
|
| 109 |
(call |
| 110 |
target: (identifier) @function) |
| 111 |
|
| 112 |
|
| 113 |
(call |
| 114 |
target: (dot |
| 115 |
right: (identifier) @function)) |
| 116 |
|
| 117 |
|
| 118 |
(call |
| 119 |
target: (dot |
| 120 |
right: (identifier) @variable.other.member) |
| 121 |
.) |
| 122 |
|
| 123 |
|
| 124 |
(call |
| 125 |
target: (dot |
| 126 |
left: [ |
| 127 |
(alias) |
| 128 |
(atom) |
| 129 |
] |
| 130 |
right: (identifier) @function) |
| 131 |
.) |
| 132 |
|
| 133 |
|
| 134 |
(call |
| 135 |
target: (identifier) @keyword |
| 136 |
(#any-of? @keyword "def" "defdelegate" "defexception" "defguard" "defguardp" "defimpl" "defmacro" "defmacrop" "defmodule" "defn" "defnp" "defoverridable" "defp" "defprotocol" "defstruct")) |
| 137 |
|
| 138 |
|
| 139 |
(call |
| 140 |
target: (identifier) @keyword |
| 141 |
(#any-of? @keyword "alias" "case" "cond" "for" "if" "import" "quote" "raise" "receive" "require" "reraise" "super" "throw" "try" "unless" "unquote" "unquote_splicing" "use" "with")) |
| 142 |
|
| 143 |
|
| 144 |
(call |
| 145 |
target: (identifier) @keyword |
| 146 |
(arguments |
| 147 |
[ |
| 148 |
(identifier) @function |
| 149 |
(binary_operator |
| 150 |
left: (identifier) @function |
| 151 |
operator: "when") |
| 152 |
]) |
| 153 |
(#any-of? @keyword "def" "defdelegate" "defguard" "defguardp" "defmacro" "defmacrop" "defn" "defnp" "defp")) |
| 154 |
|
| 155 |
|
| 156 |
(binary_operator |
| 157 |
operator: "|>" |
| 158 |
right: (identifier) @function) |
| 159 |
|
| 160 |
|
| 161 |
(call |
| 162 |
target: (identifier) @keyword |
| 163 |
(arguments |
| 164 |
(binary_operator |
| 165 |
operator: "|>" |
| 166 |
right: (identifier) @variable)) |
| 167 |
(#any-of? @keyword "def" "defdelegate" "defguard" "defguardp" "defmacro" "defmacrop" "defn" "defnp" "defp")) |
| 168 |
|
| 169 |
|
| 170 |
(binary_operator |
| 171 |
operator: "|>" |
| 172 |
right: (call |
| 173 |
target: (dot |
| 174 |
right: (identifier) @function))) |
| 175 |
|
| 176 |
|
| 177 |
|
| 178 |
|
| 179 |
(unary_operator |
| 180 |
operator: "&" |
| 181 |
operand: [ |
| 182 |
(integer) @operator |
| 183 |
(binary_operator |
| 184 |
left: [ |
| 185 |
(call target: (dot left: (_) right: (identifier) @function)) |
| 186 |
(identifier) @function |
| 187 |
] operator: "/" right: (integer) @operator) |
| 188 |
]) |
| 189 |
|
| 190 |
(operator_identifier) @operator |
| 191 |
|
| 192 |
(unary_operator |
| 193 |
operator: _ @operator) |
| 194 |
|
| 195 |
(binary_operator |
| 196 |
operator: _ @operator) |
| 197 |
|
| 198 |
(dot |
| 199 |
operator: _ @operator) |
| 200 |
|
| 201 |
(stab_clause |
| 202 |
operator: _ @operator) |
| 203 |
|
| 204 |
|
| 205 |
(unary_operator |
| 206 |
operator: "@" @variable.other.member |
| 207 |
operand: [ |
| 208 |
(identifier) @variable.other.member |
| 209 |
(call |
| 210 |
target: (identifier) @variable.other.member) |
| 211 |
(boolean) @variable.other.member |
| 212 |
(nil) @variable.other.member |
| 213 |
]) |
| 214 |
|
| 215 |
|
| 216 |
(unary_operator |
| 217 |
operator: "@" @comment.block.documentation |
| 218 |
operand: (call |
| 219 |
target: (identifier) @comment.block.documentation.__attribute__ |
| 220 |
(arguments |
| 221 |
[ |
| 222 |
(string) @comment.block.documentation |
| 223 |
(charlist) @comment.block.documentation |
| 224 |
(sigil |
| 225 |
quoted_start: _ @comment.block.documentation |
| 226 |
quoted_end: _ @comment.block.documentation) @comment.block.documentation |
| 227 |
(boolean) @comment.block.documentation |
| 228 |
])) |
| 229 |
(#any-of? @comment.block.documentation.__attribute__ "moduledoc" "typedoc" "doc")) |
| 230 |
|
| 231 |
|
| 232 |
|
| 233 |
(alias) @namespace |
| 234 |
|
| 235 |
(call |
| 236 |
target: (dot |
| 237 |
left: (atom) @namespace)) |
| 238 |
|
| 239 |
|
| 240 |
|
| 241 |
["when" "and" "or" "not" "in" "not in" "fn" "do" "end" "catch" "rescue" "after" "else"] @keyword |