| 1 |
{ |
| 2 |
"comment": "Textmate bundle for Elixir Programming Language.", |
| 3 |
"fileTypes": ["ex", "exs"], |
| 4 |
"firstLineMatch": "^#!/.*\\belixir", |
| 5 |
"foldingStartMarker": "(after|else|catch|rescue|\\-\\>|\\{|\\[|do)\\s*$", |
| 6 |
"foldingStopMarker": "^\\s*((\\}|\\]|after|else|catch|rescue)\\s*$|end\\b)", |
| 7 |
"keyEquivalent": "^~E", |
| 8 |
"name": "elixir", |
| 9 |
"patterns": [ |
| 10 |
{ |
| 11 |
"begin": "\\b(fn)\\b(?!.*->)", |
| 12 |
"beginCaptures": { |
| 13 |
"1": { |
| 14 |
"name": "keyword.control.elixir" |
| 15 |
} |
| 16 |
}, |
| 17 |
"end": "$", |
| 18 |
"patterns": [ |
| 19 |
{ |
| 20 |
"include": "#core_syntax" |
| 21 |
} |
| 22 |
] |
| 23 |
}, |
| 24 |
{ |
| 25 |
"captures": { |
| 26 |
"1": { |
| 27 |
"name": "entity.name.type.class.elixir" |
| 28 |
}, |
| 29 |
"2": { |
| 30 |
"name": "punctuation.separator.method.elixir" |
| 31 |
}, |
| 32 |
"3": { |
| 33 |
"name": "entity.name.function.elixir" |
| 34 |
} |
| 35 |
}, |
| 36 |
"match": "([A-Z]\\w+)\\s*(\\.)\\s*([a-z_]\\w*[!?]?)" |
| 37 |
}, |
| 38 |
{ |
| 39 |
"captures": { |
| 40 |
"1": { |
| 41 |
"name": "constant.other.symbol.elixir" |
| 42 |
}, |
| 43 |
"2": { |
| 44 |
"name": "punctuation.separator.method.elixir" |
| 45 |
}, |
| 46 |
"3": { |
| 47 |
"name": "entity.name.function.elixir" |
| 48 |
} |
| 49 |
}, |
| 50 |
"match": "(\\:\\w+)\\s*(\\.)\\s*([_]?\\w*[!?]?)" |
| 51 |
}, |
| 52 |
{ |
| 53 |
"captures": { |
| 54 |
"1": { |
| 55 |
"name": "keyword.operator.other.elixir" |
| 56 |
}, |
| 57 |
"2": { |
| 58 |
"name": "entity.name.function.elixir" |
| 59 |
} |
| 60 |
}, |
| 61 |
"match": "(\\|\\>)\\s*([a-z_]\\w*[!?]?)" |
| 62 |
}, |
| 63 |
{ |
| 64 |
"match": "\\b[a-z_]\\w*[!?]?(?=\\s*\\.?\\s*\\()", |
| 65 |
"name": "entity.name.function.elixir" |
| 66 |
}, |
| 67 |
{ |
| 68 |
"begin": "\\b(fn)\\b(?=.*->)", |
| 69 |
"beginCaptures": { |
| 70 |
"1": { |
| 71 |
"name": "keyword.control.elixir" |
| 72 |
} |
| 73 |
}, |
| 74 |
"end": "(?>(->)|(when)|(\\)))", |
| 75 |
"endCaptures": { |
| 76 |
"1": { |
| 77 |
"name": "keyword.operator.other.elixir" |
| 78 |
}, |
| 79 |
"2": { |
| 80 |
"name": "keyword.control.elixir" |
| 81 |
}, |
| 82 |
"3": { |
| 83 |
"name": "punctuation.section.function.elixir" |
| 84 |
} |
| 85 |
}, |
| 86 |
"patterns": [ |
| 87 |
{ |
| 88 |
"include": "#core_syntax" |
| 89 |
} |
| 90 |
] |
| 91 |
}, |
| 92 |
{ |
| 93 |
"include": "#core_syntax" |
| 94 |
}, |
| 95 |
{ |
| 96 |
"begin": "^(?=.*->)((?![^\"']*(\"|')[^\"']*->)|(?=.*->[^\"']*(\"|')[^\"']*->))((?!.*\\([^\\)]*->)|(?=[^\\(\\)]*->)|(?=\\s*\\(.*\\).*->))((?!.*\\b(fn)\\b)|(?=.*->.*\\bfn\\b))", |
| 97 |
"beginCaptures": { |
| 98 |
"1": { |
| 99 |
"name": "keyword.control.elixir" |
| 100 |
} |
| 101 |
}, |
| 102 |
"end": "(?>(->)|(when)|(\\)))", |
| 103 |
"endCaptures": { |
| 104 |
"1": { |
| 105 |
"name": "keyword.operator.other.elixir" |
| 106 |
}, |
| 107 |
"2": { |
| 108 |
"name": "keyword.control.elixir" |
| 109 |
}, |
| 110 |
"3": { |
| 111 |
"name": "punctuation.section.function.elixir" |
| 112 |
} |
| 113 |
}, |
| 114 |
"patterns": [ |
| 115 |
{ |
| 116 |
"include": "#core_syntax" |
| 117 |
} |
| 118 |
] |
| 119 |
} |
| 120 |
], |
| 121 |
"repository": { |
| 122 |
"core_syntax": { |
| 123 |
"patterns": [ |
| 124 |
{ |
| 125 |
"begin": "^\\s*(defmodule)\\b", |
| 126 |
"beginCaptures": { |
| 127 |
"1": { |
| 128 |
"name": "keyword.control.module.elixir" |
| 129 |
} |
| 130 |
}, |
| 131 |
"end": "\\b(do)\\b", |
| 132 |
"endCaptures": { |
| 133 |
"1": { |
| 134 |
"name": "keyword.control.module.elixir" |
| 135 |
} |
| 136 |
}, |
| 137 |
"name": "meta.module.elixir", |
| 138 |
"patterns": [ |
| 139 |
{ |
| 140 |
"match": "\\b[A-Z]\\w*(?=\\.)", |
| 141 |
"name": "entity.other.inherited-class.elixir" |
| 142 |
}, |
| 143 |
{ |
| 144 |
"match": "\\b[A-Z]\\w*\\b", |
| 145 |
"name": "entity.name.type.class.elixir" |
| 146 |
} |
| 147 |
] |
| 148 |
}, |
| 149 |
{ |
| 150 |
"begin": "^\\s*(defprotocol)\\b", |
| 151 |
"beginCaptures": { |
| 152 |
"1": { |
| 153 |
"name": "keyword.control.protocol.elixir" |
| 154 |
} |
| 155 |
}, |
| 156 |
"end": "\\b(do)\\b", |
| 157 |
"endCaptures": { |
| 158 |
"1": { |
| 159 |
"name": "keyword.control.protocol.elixir" |
| 160 |
} |
| 161 |
}, |
| 162 |
"name": "meta.protocol_declaration.elixir", |
| 163 |
"patterns": [ |
| 164 |
{ |
| 165 |
"match": "\\b[A-Z]\\w*\\b", |
| 166 |
"name": "entity.name.type.protocol.elixir" |
| 167 |
} |
| 168 |
] |
| 169 |
}, |
| 170 |
{ |
| 171 |
"begin": "^\\s*(defimpl)\\b", |
| 172 |
"beginCaptures": { |
| 173 |
"1": { |
| 174 |
"name": "keyword.control.protocol.elixir" |
| 175 |
} |
| 176 |
}, |
| 177 |
"end": "\\b(do)\\b", |
| 178 |
"endCaptures": { |
| 179 |
"1": { |
| 180 |
"name": "keyword.control.protocol.elixir" |
| 181 |
} |
| 182 |
}, |
| 183 |
"name": "meta.protocol_implementation.elixir", |
| 184 |
"patterns": [ |
| 185 |
{ |
| 186 |
"match": "\\b[A-Z]\\w*\\b", |
| 187 |
"name": "entity.name.type.protocol.elixir" |
| 188 |
} |
| 189 |
] |
| 190 |
}, |
| 191 |
{ |
| 192 |
"begin": "^\\s*(def|defmacro|defdelegate|defguard)\\s+((?>[a-zA-Z_]\\w*(?>\\.|::))?(?>[a-zA-Z_]\\w*(?>[?!]|=(?!>))?|===?|>[>=]?|<=>|<[<=]?|[%&`/\\|]|\\*\\*?|=?~|[-+]@?|\\[\\]=?))((\\()|\\s*)", |
| 193 |
"beginCaptures": { |
| 194 |
"1": { |
| 195 |
"name": "keyword.control.module.elixir" |
| 196 |
}, |
| 197 |
"2": { |
| 198 |
"name": "entity.name.function.public.elixir" |
| 199 |
}, |
| 200 |
"4": { |
| 201 |
"name": "punctuation.section.function.elixir" |
| 202 |
} |
| 203 |
}, |
| 204 |
"end": "(\\bdo:)|(\\bdo\\b)|(?=\\s+(def|defn|defmacro|defdelegate|defguard)\\b)", |
| 205 |
"endCaptures": { |
| 206 |
"1": { |
| 207 |
"name": "constant.other.keywords.elixir" |
| 208 |
}, |
| 209 |
"2": { |
| 210 |
"name": "keyword.control.module.elixir" |
| 211 |
} |
| 212 |
}, |
| 213 |
"name": "meta.function.public.elixir", |
| 214 |
"patterns": [ |
| 215 |
{ |
| 216 |
"include": "$self" |
| 217 |
}, |
| 218 |
{ |
| 219 |
"begin": "\\s(\\\\\\\\)", |
| 220 |
"beginCaptures": { |
| 221 |
"1": { |
| 222 |
"name": "keyword.operator.other.elixir" |
| 223 |
} |
| 224 |
}, |
| 225 |
"end": ",|\\)|$", |
| 226 |
"patterns": [ |
| 227 |
{ |
| 228 |
"include": "$self" |
| 229 |
} |
| 230 |
] |
| 231 |
}, |
| 232 |
{ |
| 233 |
"match": "\\b(is_atom|is_binary|is_bitstring|is_boolean|is_float|is_function|is_integer|is_list|is_map|is_nil|is_number|is_pid|is_port|is_record|is_reference|is_tuple|is_exception|abs|bit_size|byte_size|div|elem|hd|length|map_size|node|rem|round|tl|trunc|tuple_size)\\b", |
| 234 |
"name": "keyword.control.elixir" |
| 235 |
} |
| 236 |
] |
| 237 |
}, |
| 238 |
{ |
| 239 |
"begin": "^\\s*(defp|defnp|defmacrop|defguardp)\\s+((?>[a-zA-Z_]\\w*(?>\\.|::))?(?>[a-zA-Z_]\\w*(?>[?!]|=(?!>))?|===?|>[>=]?|<=>|<[<=]?|[%&`/\\|]|\\*\\*?|=?~|[-+]@?|\\[\\]=?))((\\()|\\s*)", |
| 240 |
"beginCaptures": { |
| 241 |
"1": { |
| 242 |
"name": "keyword.control.module.elixir" |
| 243 |
}, |
| 244 |
"2": { |
| 245 |
"name": "entity.name.function.private.elixir" |
| 246 |
}, |
| 247 |
"4": { |
| 248 |
"name": "punctuation.section.function.elixir" |
| 249 |
} |
| 250 |
}, |
| 251 |
"end": "(\\bdo:)|(\\bdo\\b)|(?=\\s+(defp|defmacrop|defguardp)\\b)", |
| 252 |
"endCaptures": { |
| 253 |
"1": { |
| 254 |
"name": "constant.other.keywords.elixir" |
| 255 |
}, |
| 256 |
"2": { |
| 257 |
"name": "keyword.control.module.elixir" |
| 258 |
} |
| 259 |
}, |
| 260 |
"name": "meta.function.private.elixir", |
| 261 |
"patterns": [ |
| 262 |
{ |
| 263 |
"include": "$self" |
| 264 |
}, |
| 265 |
{ |
| 266 |
"begin": "\\s(\\\\\\\\)", |
| 267 |
"beginCaptures": { |
| 268 |
"1": { |
| 269 |
"name": "keyword.operator.other.elixir" |
| 270 |
} |
| 271 |
}, |
| 272 |
"end": ",|\\)|$", |
| 273 |
"patterns": [ |
| 274 |
{ |
| 275 |
"include": "$self" |
| 276 |
} |
| 277 |
] |
| 278 |
}, |
| 279 |
{ |
| 280 |
"match": "\\b(is_atom|is_binary|is_bitstring|is_boolean|is_float|is_function|is_integer|is_list|is_map|is_nil|is_number|is_pid|is_port|is_record|is_reference|is_tuple|is_exception|abs|bit_size|byte_size|div|elem|hd|length|map_size|node|rem|round|tl|trunc|tuple_size)\\b", |
| 281 |
"name": "keyword.control.elixir" |
| 282 |
} |
| 283 |
] |
| 284 |
}, |
| 285 |
{ |
| 286 |
"begin": "\\s*~L\"\"\"", |
| 287 |
"comment": "Leex Sigil", |
| 288 |
"end": "\\s*\"\"\"", |
| 289 |
"name": "sigil.leex", |
| 290 |
"patterns": [ |
| 291 |
{ |
| 292 |
"include": "text.elixir" |
| 293 |
}, |
| 294 |
{ |
| 295 |
"include": "text.html.basic" |
| 296 |
} |
| 297 |
] |
| 298 |
}, |
| 299 |
{ |
| 300 |
"begin": "\\s*~H\"\"\"", |
| 301 |
"comment": "HEEx Sigil", |
| 302 |
"end": "\\s*\"\"\"", |
| 303 |
"name": "sigil.heex", |
| 304 |
"patterns": [ |
| 305 |
{ |
| 306 |
"include": "text.elixir" |
| 307 |
}, |
| 308 |
{ |
| 309 |
"include": "text.html.basic" |
| 310 |
} |
| 311 |
] |
| 312 |
}, |
| 313 |
{ |
| 314 |
"begin": "@(module|type)?doc (~[a-z])?\"\"\"", |
| 315 |
"comment": "@doc with heredocs is treated as documentation", |
| 316 |
"end": "\\s*\"\"\"", |
| 317 |
"name": "comment.block.documentation.heredoc", |
| 318 |
"patterns": [ |
| 319 |
{ |
| 320 |
"include": "#interpolated_elixir" |
| 321 |
}, |
| 322 |
{ |
| 323 |
"include": "#escaped_char" |
| 324 |
} |
| 325 |
] |
| 326 |
}, |
| 327 |
{ |
| 328 |
"begin": "@(module|type)?doc ~[A-Z]\"\"\"", |
| 329 |
"comment": "@doc with heredocs is treated as documentation", |
| 330 |
"end": "\\s*\"\"\"", |
| 331 |
"name": "comment.block.documentation.heredoc" |
| 332 |
}, |
| 333 |
{ |
| 334 |
"begin": "@(module|type)?doc (~[a-z])?'''", |
| 335 |
"comment": "@doc with heredocs is treated as documentation", |
| 336 |
"end": "\\s*'''", |
| 337 |
"name": "comment.block.documentation.heredoc", |
| 338 |
"patterns": [ |
| 339 |
{ |
| 340 |
"include": "#interpolated_elixir" |
| 341 |
}, |
| 342 |
{ |
| 343 |
"include": "#escaped_char" |
| 344 |
} |
| 345 |
] |
| 346 |
}, |
| 347 |
{ |
| 348 |
"begin": "@(module|type)?doc ~[A-Z]'''", |
| 349 |
"comment": "@doc with heredocs is treated as documentation", |
| 350 |
"end": "\\s*'''", |
| 351 |
"name": "comment.block.documentation.heredoc" |
| 352 |
}, |
| 353 |
{ |
| 354 |
"comment": "@doc false is treated as documentation", |
| 355 |
"match": "@(module|type)?doc false", |
| 356 |
"name": "comment.block.documentation.false" |
| 357 |
}, |
| 358 |
{ |
| 359 |
"begin": "@(module|type)?doc \"", |
| 360 |
"comment": "@doc with string is treated as documentation", |
| 361 |
"end": "\"", |
| 362 |
"name": "comment.block.documentation.string", |
| 363 |
"patterns": [ |
| 364 |
{ |
| 365 |
"include": "#interpolated_elixir" |
| 366 |
}, |
| 367 |
{ |
| 368 |
"include": "#escaped_char" |
| 369 |
} |
| 370 |
] |
| 371 |
}, |
| 372 |
{ |
| 373 |
"match": "(?<!\\.)\\b(do|end|case|bc|lc|for|if|cond|unless|try|receive|fn|defmodule|defp?|defprotocol|defimpl|defrecord|defstruct|defnp?|defmacrop?|defguardp?|defdelegate|defexception|defoverridable|exit|after|rescue|catch|else|raise|reraise|throw|import|require|alias|use|quote|unquote|super|with)\\b(?![?!:])", |
| 374 |
"name": "keyword.control.elixir" |
| 375 |
}, |
| 376 |
{ |
| 377 |
"comment": " as above, just doesn't need a 'end' and does a logic operation", |
| 378 |
"match": "(?<!\\.)\\b(and|not|or|when|xor|in)\\b", |
| 379 |
"name": "keyword.operator.elixir" |
| 380 |
}, |
| 381 |
{ |
| 382 |
"match": "\\b[A-Z]\\w*\\b", |
| 383 |
"name": "entity.name.type.class.elixir" |
| 384 |
}, |
| 385 |
{ |
| 386 |
"match": "\\b(nil|true|false)\\b(?![?!])", |
| 387 |
"name": "constant.language.elixir" |
| 388 |
}, |
| 389 |
{ |
| 390 |
"match": "\\b(__(CALLER|ENV|MODULE|DIR|STACKTRACE)__)\\b(?![?!])", |
| 391 |
"name": "variable.language.elixir" |
| 392 |
}, |
| 393 |
{ |
| 394 |
"captures": { |
| 395 |
"1": { |
| 396 |
"name": "punctuation.definition.variable.elixir" |
| 397 |
} |
| 398 |
}, |
| 399 |
"match": "(@)[a-zA-Z_]\\w*", |
| 400 |
"name": "variable.other.readwrite.module.elixir" |
| 401 |
}, |
| 402 |
{ |
| 403 |
"captures": { |
| 404 |
"1": { |
| 405 |
"name": "punctuation.definition.variable.elixir" |
| 406 |
} |
| 407 |
}, |
| 408 |
"match": "(&)\\d+", |
| 409 |
"name": "variable.other.anonymous.elixir" |
| 410 |
}, |
| 411 |
{ |
| 412 |
"match": "&(?![&])", |
| 413 |
"name": "variable.other.anonymous.elixir" |
| 414 |
}, |
| 415 |
{ |
| 416 |
"captures": { |
| 417 |
"1": { |
| 418 |
"name": "punctuation.definition.variable.elixir" |
| 419 |
} |
| 420 |
}, |
| 421 |
"match": "\\^[a-z_]\\w*", |
| 422 |
"name": "variable.other.capture.elixir" |
| 423 |
}, |
| 424 |
{ |
| 425 |
"match": "\\b0x[0-9A-Fa-f](?>_?[0-9A-Fa-f])*\\b", |
| 426 |
"name": "constant.numeric.hex.elixir" |
| 427 |
}, |
| 428 |
{ |
| 429 |
"match": "\\b\\d(?>_?\\d)*(\\.(?![^[:space:][:digit:]])(?>_?\\d)+)([eE][-+]?\\d(?>_?\\d)*)?\\b", |
| 430 |
"name": "constant.numeric.float.elixir" |
| 431 |
}, |
| 432 |
{ |
| 433 |
"match": "\\b\\d(?>_?\\d)*\\b", |
| 434 |
"name": "constant.numeric.integer.elixir" |
| 435 |
}, |
| 436 |
{ |
| 437 |
"match": "\\b0b[01](?>_?[01])*\\b", |
| 438 |
"name": "constant.numeric.binary.elixir" |
| 439 |
}, |
| 440 |
{ |
| 441 |
"match": "\\b0o[0-7](?>_?[0-7])*\\b", |
| 442 |
"name": "constant.numeric.octal.elixir" |
| 443 |
}, |
| 444 |
{ |
| 445 |
"begin": ":'", |
| 446 |
"captures": { |
| 447 |
"0": { |
| 448 |
"name": "punctuation.definition.constant.elixir" |
| 449 |
} |
| 450 |
}, |
| 451 |
"end": "'", |
| 452 |
"name": "constant.other.symbol.single-quoted.elixir", |
| 453 |
"patterns": [ |
| 454 |
{ |
| 455 |
"include": "#interpolated_elixir" |
| 456 |
}, |
| 457 |
{ |
| 458 |
"include": "#escaped_char" |
| 459 |
} |
| 460 |
] |
| 461 |
}, |
| 462 |
{ |
| 463 |
"begin": ":\"", |
| 464 |
"captures": { |
| 465 |
"0": { |
| 466 |
"name": "punctuation.definition.constant.elixir" |
| 467 |
} |
| 468 |
}, |
| 469 |
"end": "\"", |
| 470 |
"name": "constant.other.symbol.double-quoted.elixir", |
| 471 |
"patterns": [ |
| 472 |
{ |
| 473 |
"include": "#interpolated_elixir" |
| 474 |
}, |
| 475 |
{ |
| 476 |
"include": "#escaped_char" |
| 477 |
} |
| 478 |
] |
| 479 |
}, |
| 480 |
{ |
| 481 |
"begin": "(?>''')", |
| 482 |
"beginCaptures": { |
| 483 |
"0": { |
| 484 |
"name": "punctuation.definition.string.begin.elixir" |
| 485 |
} |
| 486 |
}, |
| 487 |
"comment": "Single-quoted heredocs", |
| 488 |
"end": "^\\s*'''", |
| 489 |
"endCaptures": { |
| 490 |
"0": { |
| 491 |
"name": "punctuation.definition.string.end.elixir" |
| 492 |
} |
| 493 |
}, |
| 494 |
"name": "string.quoted.single.heredoc.elixir", |
| 495 |
"patterns": [ |
| 496 |
{ |
| 497 |
"include": "#interpolated_elixir" |
| 498 |
}, |
| 499 |
{ |
| 500 |
"include": "#escaped_char" |
| 501 |
} |
| 502 |
] |
| 503 |
}, |
| 504 |
{ |
| 505 |
"begin": "'", |
| 506 |
"beginCaptures": { |
| 507 |
"0": { |
| 508 |
"name": "punctuation.definition.string.begin.elixir" |
| 509 |
} |
| 510 |
}, |
| 511 |
"comment": "single quoted string (allows for interpolation)", |
| 512 |
"end": "'", |
| 513 |
"endCaptures": { |
| 514 |
"0": { |
| 515 |
"name": "punctuation.definition.string.end.elixir" |
| 516 |
} |
| 517 |
}, |
| 518 |
"name": "string.quoted.single.elixir", |
| 519 |
"patterns": [ |
| 520 |
{ |
| 521 |
"include": "#interpolated_elixir" |
| 522 |
}, |
| 523 |
{ |
| 524 |
"include": "#escaped_char" |
| 525 |
} |
| 526 |
] |
| 527 |
}, |
| 528 |
{ |
| 529 |
"begin": "(?>\"\"\")", |
| 530 |
"beginCaptures": { |
| 531 |
"0": { |
| 532 |
"name": "punctuation.definition.string.begin.elixir" |
| 533 |
} |
| 534 |
}, |
| 535 |
"comment": "Double-quoted heredocs", |
| 536 |
"end": "^\\s*\"\"\"", |
| 537 |
"endCaptures": { |
| 538 |
"0": { |
| 539 |
"name": "punctuation.definition.string.end.elixir" |
| 540 |
} |
| 541 |
}, |
| 542 |
"name": "string.quoted.double.heredoc.elixir", |
| 543 |
"patterns": [ |
| 544 |
{ |
| 545 |
"include": "#interpolated_elixir" |
| 546 |
}, |
| 547 |
{ |
| 548 |
"include": "#escaped_char" |
| 549 |
} |
| 550 |
] |
| 551 |
}, |
| 552 |
{ |
| 553 |
"begin": "\"", |
| 554 |
"beginCaptures": { |
| 555 |
"0": { |
| 556 |
"name": "punctuation.definition.string.begin.elixir" |
| 557 |
} |
| 558 |
}, |
| 559 |
"comment": "double quoted string (allows for interpolation)", |
| 560 |
"end": "\"", |
| 561 |
"endCaptures": { |
| 562 |
"0": { |
| 563 |
"name": "punctuation.definition.string.end.elixir" |
| 564 |
} |
| 565 |
}, |
| 566 |
"name": "string.quoted.double.elixir", |
| 567 |
"patterns": [ |
| 568 |
{ |
| 569 |
"include": "#interpolated_elixir" |
| 570 |
}, |
| 571 |
{ |
| 572 |
"include": "#escaped_char" |
| 573 |
} |
| 574 |
] |
| 575 |
}, |
| 576 |
{ |
| 577 |
"begin": "~[a-z](?>\"\"\")", |
| 578 |
"beginCaptures": { |
| 579 |
"0": { |
| 580 |
"name": "punctuation.definition.string.begin.elixir" |
| 581 |
} |
| 582 |
}, |
| 583 |
"comment": "Double-quoted heredocs sigils", |
| 584 |
"end": "^\\s*\"\"\"", |
| 585 |
"endCaptures": { |
| 586 |
"0": { |
| 587 |
"name": "punctuation.definition.string.end.elixir" |
| 588 |
} |
| 589 |
}, |
| 590 |
"name": "string.quoted.other.sigil.heredoc.elixir", |
| 591 |
"patterns": [ |
| 592 |
{ |
| 593 |
"include": "#interpolated_elixir" |
| 594 |
}, |
| 595 |
{ |
| 596 |
"include": "#escaped_char" |
| 597 |
} |
| 598 |
] |
| 599 |
}, |
| 600 |
{ |
| 601 |
"begin": "~[a-z]\\{", |
| 602 |
"beginCaptures": { |
| 603 |
"0": { |
| 604 |
"name": "punctuation.definition.string.begin.elixir" |
| 605 |
} |
| 606 |
}, |
| 607 |
"comment": "sigil (allow for interpolation)", |
| 608 |
"end": "\\}[a-z]*", |
| 609 |
"endCaptures": { |
| 610 |
"0": { |
| 611 |
"name": "punctuation.definition.string.end.elixir" |
| 612 |
} |
| 613 |
}, |
| 614 |
"name": "string.quoted.other.sigil.elixir", |
| 615 |
"patterns": [ |
| 616 |
{ |
| 617 |
"include": "#interpolated_elixir" |
| 618 |
}, |
| 619 |
{ |
| 620 |
"include": "#escaped_char" |
| 621 |
} |
| 622 |
] |
| 623 |
}, |
| 624 |
{ |
| 625 |
"begin": "~[a-z]\\[", |
| 626 |
"beginCaptures": { |
| 627 |
"0": { |
| 628 |
"name": "punctuation.definition.string.begin.elixir" |
| 629 |
} |
| 630 |
}, |
| 631 |
"comment": "sigil (allow for interpolation)", |
| 632 |
"end": "\\][a-z]*", |
| 633 |
"endCaptures": { |
| 634 |
"0": { |
| 635 |
"name": "punctuation.definition.string.end.elixir" |
| 636 |
} |
| 637 |
}, |
| 638 |
"name": "string.quoted.other.sigil.elixir", |
| 639 |
"patterns": [ |
| 640 |
{ |
| 641 |
"include": "#interpolated_elixir" |
| 642 |
}, |
| 643 |
{ |
| 644 |
"include": "#escaped_char" |
| 645 |
} |
| 646 |
] |
| 647 |
}, |
| 648 |
{ |
| 649 |
"begin": "~[a-z]\\<", |
| 650 |
"beginCaptures": { |
| 651 |
"0": { |
| 652 |
"name": "punctuation.definition.string.begin.elixir" |
| 653 |
} |
| 654 |
}, |
| 655 |
"comment": "sigil (allow for interpolation)", |
| 656 |
"end": "\\>[a-z]*", |
| 657 |
"endCaptures": { |
| 658 |
"0": { |
| 659 |
"name": "punctuation.definition.string.end.elixir" |
| 660 |
} |
| 661 |
}, |
| 662 |
"name": "string.quoted.other.sigil.elixir", |
| 663 |
"patterns": [ |
| 664 |
{ |
| 665 |
"include": "#interpolated_elixir" |
| 666 |
}, |
| 667 |
{ |
| 668 |
"include": "#escaped_char" |
| 669 |
} |
| 670 |
] |
| 671 |
}, |
| 672 |
{ |
| 673 |
"begin": "~[a-z]\\(", |
| 674 |
"beginCaptures": { |
| 675 |
"0": { |
| 676 |
"name": "punctuation.definition.string.begin.elixir" |
| 677 |
} |
| 678 |
}, |
| 679 |
"comment": "sigil (allow for interpolation)", |
| 680 |
"end": "\\)[a-z]*", |
| 681 |
"endCaptures": { |
| 682 |
"0": { |
| 683 |
"name": "punctuation.definition.string.end.elixir" |
| 684 |
} |
| 685 |
}, |
| 686 |
"name": "string.quoted.other.sigil.elixir", |
| 687 |
"patterns": [ |
| 688 |
{ |
| 689 |
"include": "#interpolated_elixir" |
| 690 |
}, |
| 691 |
{ |
| 692 |
"include": "#escaped_char" |
| 693 |
} |
| 694 |
] |
| 695 |
}, |
| 696 |
{ |
| 697 |
"begin": "~[a-z]([^\\w])", |
| 698 |
"beginCaptures": { |
| 699 |
"0": { |
| 700 |
"name": "punctuation.definition.string.begin.elixir" |
| 701 |
} |
| 702 |
}, |
| 703 |
"comment": "sigil (allow for interpolation)", |
| 704 |
"end": "\\1[a-z]*", |
| 705 |
"endCaptures": { |
| 706 |
"0": { |
| 707 |
"name": "punctuation.definition.string.end.elixir" |
| 708 |
} |
| 709 |
}, |
| 710 |
"name": "string.quoted.other.sigil.elixir", |
| 711 |
"patterns": [ |
| 712 |
{ |
| 713 |
"include": "#interpolated_elixir" |
| 714 |
}, |
| 715 |
{ |
| 716 |
"include": "#escaped_char" |
| 717 |
} |
| 718 |
] |
| 719 |
}, |
| 720 |
{ |
| 721 |
"begin": "~[A-Z](?>\"\"\")", |
| 722 |
"beginCaptures": { |
| 723 |
"0": { |
| 724 |
"name": "punctuation.definition.string.begin.elixir" |
| 725 |
} |
| 726 |
}, |
| 727 |
"comment": "Double-quoted heredocs sigils", |
| 728 |
"end": "^\\s*\"\"\"", |
| 729 |
"endCaptures": { |
| 730 |
"0": { |
| 731 |
"name": "punctuation.definition.string.end.elixir" |
| 732 |
} |
| 733 |
}, |
| 734 |
"name": "string.quoted.other.sigil.heredoc.literal.elixir" |
| 735 |
}, |
| 736 |
{ |
| 737 |
"begin": "~[A-Z]\\{", |
| 738 |
"beginCaptures": { |
| 739 |
"0": { |
| 740 |
"name": "punctuation.definition.string.begin.elixir" |
| 741 |
} |
| 742 |
}, |
| 743 |
"comment": "sigil (without interpolation)", |
| 744 |
"end": "\\}[a-z]*", |
| 745 |
"endCaptures": { |
| 746 |
"0": { |
| 747 |
"name": "punctuation.definition.string.end.elixir" |
| 748 |
} |
| 749 |
}, |
| 750 |
"name": "string.quoted.other.sigil.literal.elixir" |
| 751 |
}, |
| 752 |
{ |
| 753 |
"begin": "~[A-Z]\\[", |
| 754 |
"beginCaptures": { |
| 755 |
"0": { |
| 756 |
"name": "punctuation.definition.string.begin.elixir" |
| 757 |
} |
| 758 |
}, |
| 759 |
"comment": "sigil (without interpolation)", |
| 760 |
"end": "\\][a-z]*", |
| 761 |
"endCaptures": { |
| 762 |
"0": { |
| 763 |
"name": "punctuation.definition.string.end.elixir" |
| 764 |
} |
| 765 |
}, |
| 766 |
"name": "string.quoted.other.sigil.literal.elixir" |
| 767 |
}, |
| 768 |
{ |
| 769 |
"begin": "~[A-Z]\\<", |
| 770 |
"beginCaptures": { |
| 771 |
"0": { |
| 772 |
"name": "punctuation.definition.string.begin.elixir" |
| 773 |
} |
| 774 |
}, |
| 775 |
"comment": "sigil (without interpolation)", |
| 776 |
"end": "\\>[a-z]*", |
| 777 |
"endCaptures": { |
| 778 |
"0": { |
| 779 |
"name": "punctuation.definition.string.end.elixir" |
| 780 |
} |
| 781 |
}, |
| 782 |
"name": "string.quoted.other.sigil.literal.elixir" |
| 783 |
}, |
| 784 |
{ |
| 785 |
"begin": "~[A-Z]\\(", |
| 786 |
"beginCaptures": { |
| 787 |
"0": { |
| 788 |
"name": "punctuation.definition.string.begin.elixir" |
| 789 |
} |
| 790 |
}, |
| 791 |
"comment": "sigil (without interpolation)", |
| 792 |
"end": "\\)[a-z]*", |
| 793 |
"endCaptures": { |
| 794 |
"0": { |
| 795 |
"name": "punctuation.definition.string.end.elixir" |
| 796 |
} |
| 797 |
}, |
| 798 |
"name": "string.quoted.other.sigil.literal.elixir" |
| 799 |
}, |
| 800 |
{ |
| 801 |
"begin": "~[A-Z]([^\\w])", |
| 802 |
"beginCaptures": { |
| 803 |
"0": { |
| 804 |
"name": "punctuation.definition.string.begin.elixir" |
| 805 |
} |
| 806 |
}, |
| 807 |
"comment": "sigil (without interpolation)", |
| 808 |
"end": "\\1[a-z]*", |
| 809 |
"endCaptures": { |
| 810 |
"0": { |
| 811 |
"name": "punctuation.definition.string.end.elixir" |
| 812 |
} |
| 813 |
}, |
| 814 |
"name": "string.quoted.other.sigil.literal.elixir" |
| 815 |
}, |
| 816 |
{ |
| 817 |
"captures": { |
| 818 |
"1": { |
| 819 |
"name": "punctuation.definition.constant.elixir" |
| 820 |
} |
| 821 |
}, |
| 822 |
"comment": "symbols", |
| 823 |
"match": "(?<!:)(:)(?>[a-zA-Z_][\\w@]*(?>[?!]|=(?![>=]))?|\\<\\>|===?|!==?|<<>>|<<<|>>>|~~~|::|<\\-|\\|>|=>|=~|=|/|\\\\\\\\|\\*\\*?|\\.\\.?\\.?|\\.\\.//|>=?|<=?|&&?&?|\\+\\+?|\\-\\-?|\\|\\|?\\|?|\\!|@|\\%?\\{\\}|%|\\[\\]|\\^(\\^\\^)?)", |
| 824 |
"name": "constant.other.symbol.elixir" |
| 825 |
}, |
| 826 |
{ |
| 827 |
"captures": { |
| 828 |
"1": { |
| 829 |
"name": "punctuation.definition.constant.elixir" |
| 830 |
} |
| 831 |
}, |
| 832 |
"comment": "symbols", |
| 833 |
"match": "(?>[a-zA-Z_][\\w@]*(?>[?!])?)(:)(?!:)", |
| 834 |
"name": "constant.other.keywords.elixir" |
| 835 |
}, |
| 836 |
{ |
| 837 |
"begin": "(^[ \\t]+)?(?=##)", |
| 838 |
"beginCaptures": { |
| 839 |
"1": { |
| 840 |
"name": "punctuation.whitespace.comment.leading.elixir" |
| 841 |
} |
| 842 |
}, |
| 843 |
"end": "(?!#)", |
| 844 |
"patterns": [ |
| 845 |
{ |
| 846 |
"begin": "##", |
| 847 |
"beginCaptures": { |
| 848 |
"0": { |
| 849 |
"name": "punctuation.definition.comment.elixir" |
| 850 |
} |
| 851 |
}, |
| 852 |
"end": "\\n", |
| 853 |
"name": "comment.line.section.elixir" |
| 854 |
} |
| 855 |
] |
| 856 |
}, |
| 857 |
{ |
| 858 |
"begin": "(^[ \\t]+)?(?=#)", |
| 859 |
"beginCaptures": { |
| 860 |
"1": { |
| 861 |
"name": "punctuation.whitespace.comment.leading.elixir" |
| 862 |
} |
| 863 |
}, |
| 864 |
"end": "(?!#)", |
| 865 |
"patterns": [ |
| 866 |
{ |
| 867 |
"begin": "#", |
| 868 |
"beginCaptures": { |
| 869 |
"0": { |
| 870 |
"name": "punctuation.definition.comment.elixir" |
| 871 |
} |
| 872 |
}, |
| 873 |
"end": "\\n", |
| 874 |
"name": "comment.line.number-sign.elixir" |
| 875 |
} |
| 876 |
] |
| 877 |
}, |
| 878 |
{ |
| 879 |
"match": "\\b_([^_][\\w]+[?!]?)", |
| 880 |
"name": "comment.unused.elixir" |
| 881 |
}, |
| 882 |
{ |
| 883 |
"match": "\\b_\\b", |
| 884 |
"name": "comment.wildcard.elixir" |
| 885 |
}, |
| 886 |
{ |
| 887 |
"comment": "\n\t\t\tmatches questionmark-letters.\n\n\t\t\texamples (1st alternation = hex):\n\t\t\t?\\x1 ?\\x61\n\n\t\t\texamples (2rd alternation = escaped):\n\t\t\t?\\n ?\\b\n\n\t\t\texamples (3rd alternation = normal):\n\t\t\t?a ?A ?0\n\t\t\t?* ?\" ?(\n\t\t\t?. ?#\n\n\t\t\tthe negative lookbehind prevents against matching\n\t\t\tp(42.tainted?)\n\t\t\t", |
| 888 |
"match": "(?<!\\w)\\?(\\\\(x[0-9A-Fa-f]{1,2}(?![0-9A-Fa-f])\\b|[^xMC])|[^\\s\\\\])", |
| 889 |
"name": "constant.numeric.elixir" |
| 890 |
}, |
| 891 |
{ |
| 892 |
"match": "\\+\\+|\\-\\-|<\\|>", |
| 893 |
"name": "keyword.operator.concatenation.elixir" |
| 894 |
}, |
| 895 |
{ |
| 896 |
"match": "\\|\\>|<~>|<>|<<<|>>>|~>>|<<~|~>|<~|<\\|>", |
| 897 |
"name": "keyword.operator.sigils_1.elixir" |
| 898 |
}, |
| 899 |
{ |
| 900 |
"match": "&&&|&&", |
| 901 |
"name": "keyword.operator.sigils_2.elixir" |
| 902 |
}, |
| 903 |
{ |
| 904 |
"match": "<\\-|\\\\\\\\", |
| 905 |
"name": "keyword.operator.sigils_3.elixir" |
| 906 |
}, |
| 907 |
{ |
| 908 |
"match": "===?|!==?|<=?|>=?", |
| 909 |
"name": "keyword.operator.comparison.elixir" |
| 910 |
}, |
| 911 |
{ |
| 912 |
"match": "(\\|\\|\\||&&&|\\^\\^\\^|<<<|>>>|~~~)", |
| 913 |
"name": "keyword.operator.bitwise.elixir" |
| 914 |
}, |
| 915 |
{ |
| 916 |
"match": "(?<=[ \\t])!+|\\bnot\\b|&&|\\band\\b|\\|\\||\\bor\\b|\\bxor\\b", |
| 917 |
"name": "keyword.operator.logical.elixir" |
| 918 |
}, |
| 919 |
{ |
| 920 |
"match": "(\\*|\\+|\\-|/)", |
| 921 |
"name": "keyword.operator.arithmetic.elixir" |
| 922 |
}, |
| 923 |
{ |
| 924 |
"match": "\\||\\+\\+|\\-\\-|\\*\\*|\\\\\\\\|\\<\\-|\\<\\>|\\<\\<|\\>\\>|\\:\\:|\\.\\.|//|\\|>|~|=>|&", |
| 925 |
"name": "keyword.operator.other.elixir" |
| 926 |
}, |
| 927 |
{ |
| 928 |
"match": "=", |
| 929 |
"name": "keyword.operator.assignment.elixir" |
| 930 |
}, |
| 931 |
{ |
| 932 |
"match": ":", |
| 933 |
"name": "punctuation.separator.other.elixir" |
| 934 |
}, |
| 935 |
{ |
| 936 |
"match": "\\;", |
| 937 |
"name": "punctuation.separator.statement.elixir" |
| 938 |
}, |
| 939 |
{ |
| 940 |
"match": ",", |
| 941 |
"name": "punctuation.separator.object.elixir" |
| 942 |
}, |
| 943 |
{ |
| 944 |
"match": "\\.", |
| 945 |
"name": "punctuation.separator.method.elixir" |
| 946 |
}, |
| 947 |
{ |
| 948 |
"match": "\\{|\\}", |
| 949 |
"name": "punctuation.section.scope.elixir" |
| 950 |
}, |
| 951 |
{ |
| 952 |
"match": "\\[|\\]", |
| 953 |
"name": "punctuation.section.array.elixir" |
| 954 |
}, |
| 955 |
{ |
| 956 |
"match": "\\(|\\)", |
| 957 |
"name": "punctuation.section.function.elixir" |
| 958 |
} |
| 959 |
] |
| 960 |
}, |
| 961 |
"escaped_char": { |
| 962 |
"match": "\\\\(x[\\da-fA-F]{1,2}|.)", |
| 963 |
"name": "constant.character.escaped.elixir" |
| 964 |
}, |
| 965 |
"interpolated_elixir": { |
| 966 |
"begin": "#\\{", |
| 967 |
"beginCaptures": { |
| 968 |
"0": { |
| 969 |
"name": "punctuation.section.embedded.begin.elixir" |
| 970 |
} |
| 971 |
}, |
| 972 |
"contentName": "source.elixir", |
| 973 |
"end": "\\}", |
| 974 |
"endCaptures": { |
| 975 |
"0": { |
| 976 |
"name": "punctuation.section.embedded.end.elixir" |
| 977 |
} |
| 978 |
}, |
| 979 |
"name": "meta.embedded.line.elixir", |
| 980 |
"patterns": [ |
| 981 |
{ |
| 982 |
"include": "#nest_curly_and_self" |
| 983 |
}, |
| 984 |
{ |
| 985 |
"include": "$self" |
| 986 |
} |
| 987 |
] |
| 988 |
}, |
| 989 |
"nest_curly_and_self": { |
| 990 |
"patterns": [ |
| 991 |
{ |
| 992 |
"begin": "\\{", |
| 993 |
"captures": { |
| 994 |
"0": { |
| 995 |
"name": "punctuation.section.scope.elixir" |
| 996 |
} |
| 997 |
}, |
| 998 |
"end": "\\}", |
| 999 |
"patterns": [ |
| 1000 |
{ |
| 1001 |
"include": "#nest_curly_and_self" |
| 1002 |
} |
| 1003 |
] |
| 1004 |
}, |
| 1005 |
{ |
| 1006 |
"include": "$self" |
| 1007 |
} |
| 1008 |
] |
| 1009 |
} |
| 1010 |
}, |
| 1011 |
"scopeName": "source.elixir", |
| 1012 |
"uuid": "D00C06B9-71B2-4FEB-A0E3-37237F579456" |
| 1013 |
} |
| 1014 |
|