|
3 | 3 | "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
|
4 | 4 | "name": "Odin",
|
5 | 5 | "patterns": [
|
| 6 | + { "include": "#file-tags" }, |
6 | 7 | { "include": "#package-name-declaration" },
|
7 | 8 | { "include": "#import-declaration" },
|
8 | 9 | { "include": "#statements" }
|
9 | 10 | ],
|
10 | 11 | "repository": {
|
| 12 | + "file-tags": { |
| 13 | + "name": "comment.line.double-slash.odin", |
| 14 | + "begin": "#\\+[A-Za-z_][A-Za-z0-9_\\-]*", |
| 15 | + "beginCaptures": {"0": {"name": "entity.name.tag.odin"}}, |
| 16 | + "patterns": [{ |
| 17 | + "name": "punctuation.odin", |
| 18 | + "match": "," |
| 19 | + }, { |
| 20 | + "name": "keyword.operator.logical.odin", |
| 21 | + "match": "!" |
| 22 | + }, { |
| 23 | + "name": "entity.other.attribute-name.odin", |
| 24 | + "match": "[A-Za-z_][A-Za-z0-9_\\-]*" |
| 25 | + }], |
| 26 | + "end": "\n" |
| 27 | + }, |
| 28 | + "package-name-declaration": { |
| 29 | + "match": "^\\s*(package)\\s+([A-Za-z_]\\w*)", |
| 30 | + "captures": { |
| 31 | + "1": { "name": "keyword.control.odin" }, |
| 32 | + "2": { "name": "entity.name.type.module.odin" } |
| 33 | + } |
| 34 | + }, |
| 35 | + "import-declaration": { |
| 36 | + "name": "meta.import.odin", |
| 37 | + "begin": "\\b(import|foreign\\s+import)\\b", |
| 38 | + "beginCaptures": {"0": {"name": "keyword.control.import.odin"}}, |
| 39 | + "end": "(?=^|;)", |
| 40 | + "patterns": [ |
| 41 | + { "name": "entity.name.alias.odin", |
| 42 | + "begin": "\\b[A-Za-z_]\\w*", |
| 43 | + "beginCaptures": {"0": {"name": "entity.name.namespace.odin"}}, |
| 44 | + "end": "(?=^|;)", |
| 45 | + "patterns": [ |
| 46 | + {"include": "#strings"}, |
| 47 | + {"include": "#comments"} |
| 48 | + ] |
| 49 | + }, |
| 50 | + {"include": "#strings"}, |
| 51 | + {"include": "#comments"} |
| 52 | + ] |
| 53 | + }, |
11 | 54 | "statements": {
|
12 | 55 | "patterns": [
|
13 | 56 | { "include": "#attribute" },
|
|
243 | 286 | { "include": "#type-name" }
|
244 | 287 | ]
|
245 | 288 | },
|
246 |
| - "package-name-declaration": { |
247 |
| - "match": "^\\s*(package)\\s+([A-Za-z_]\\w*)", |
248 |
| - "captures": { |
249 |
| - "1": { "name": "keyword.control.odin" }, |
250 |
| - "2": { "name": "entity.name.type.module.odin" } |
251 |
| - } |
252 |
| - }, |
253 |
| - "import-declaration": { |
254 |
| - "name": "meta.import.odin", |
255 |
| - "begin": "\\b(import|foreign\\s+import)\\b", |
256 |
| - "beginCaptures": {"0": {"name": "keyword.control.import.odin"}}, |
257 |
| - "end": "(?=^|;)", |
258 |
| - "patterns": [ |
259 |
| - { "name": "entity.name.alias.odin", |
260 |
| - "begin": "\\b[A-Za-z_]\\w*", |
261 |
| - "beginCaptures": {"0": {"name": "entity.name.namespace.odin"}}, |
262 |
| - "end": "(?=^|;)", |
263 |
| - "patterns": [ |
264 |
| - {"include": "#strings"}, |
265 |
| - {"include": "#comments"} |
266 |
| - ] |
267 |
| - }, |
268 |
| - {"include": "#strings"}, |
269 |
| - {"include": "#comments"} |
270 |
| - ] |
271 |
| - }, |
272 | 289 | "map-bitset": {
|
273 | 290 | "begin": "\\b(bit_set|map)\\b",
|
274 | 291 | "beginCaptures": { "0": { "name": "storage.type.odin" } },
|
|
361 | 378 | "begin": "//",
|
362 | 379 | "beginCaptures": {"0": {"name": "punctuation.definition.comment.odin"}},
|
363 | 380 | "end": "\n"
|
| 381 | + }, { |
| 382 | + "name": "comment.line.shebang.odin", |
| 383 | + "begin": "#!", |
| 384 | + "beginCaptures": {"0": {"name": "punctuation.definition.comment.odin"}}, |
| 385 | + "end": "\n" |
364 | 386 | }
|
365 | 387 | ]
|
366 | 388 | },
|
|
0 commit comments