|
64 | 64 | }, |
65 | 65 | { |
66 | 66 | "comment": "constant declarations (TODO no keyword yet)", |
67 | | - "match": "(?:\\b|^)(global|let)\\s+(_*[A-Z][A-Z0-9_]*)\\b", |
| 67 | + "match": "(?:\\b|^)(global|let)(?:\\s*(\\[\\])|\\s)\\s*(_*[A-Z][A-Z0-9_]*)\\b", |
68 | 68 | "captures": { |
69 | 69 | "1": { |
70 | 70 | "name": "storage.type.st" |
71 | 71 | }, |
72 | 72 | "2": { |
| 73 | + "name": "storage.modifier.list.st" |
| 74 | + }, |
| 75 | + "3": { |
73 | 76 | "name": "constant.other.caps.st" |
74 | 77 | } |
75 | 78 | } |
|
95 | 98 | ] |
96 | 99 | }, |
97 | 100 | "escapes": { |
98 | | - "comment": "escapes: ASCII, byte, Unicode, quote, regex (TODO: better unicode?)", |
| 101 | + "comment": "escapes: control chars, hex, unicode", |
99 | 102 | "name": "constant.character.escape.st", |
100 | | - "match": "(\\\\)(?:(?:(x[0-7a-fA-F]{2})|(u(\\{)[\\da-fA-F]{4,6}(\\}))|.))", |
| 103 | + "match": "(\\\\)(?:([\\\\'\"abfnrtv0\\n])|(x[\\da-fA-F]{2})|(u[\\da-fA-F]{4})|(U[\\da-fA-F]{8})|(N(\\{)[^\\}]+(\\}))|(.))", |
101 | 104 | "captures": { |
102 | 105 | "1": { |
103 | 106 | "name": "constant.character.escape.backslash.st" |
104 | 107 | }, |
105 | 108 | "2": { |
106 | | - "name": "constant.character.escape.bit.st" |
| 109 | + "name": "constant.character.escape.char.st" |
107 | 110 | }, |
108 | 111 | "3": { |
109 | | - "name": "constant.character.escape.unicode.st" |
| 112 | + "name": "constant.character.escape.bit.st" |
110 | 113 | }, |
111 | 114 | "4": { |
112 | | - "name": "constant.character.escape.unicode.punctuation.st" |
| 115 | + "name": "constant.character.escape.unicode.short.st" |
113 | 116 | }, |
114 | 117 | "5": { |
| 118 | + "name": "constant.character.escape.unicode.long.st" |
| 119 | + }, |
| 120 | + "6": { |
| 121 | + "name": "constant.character.escape.unicode.named.st" |
| 122 | + }, |
| 123 | + "7": { |
115 | 124 | "name": "constant.character.escape.unicode.punctuation.st" |
| 125 | + }, |
| 126 | + "8": { |
| 127 | + "name": "constant.character.escape.unicode.punctuation.st" |
| 128 | + }, |
| 129 | + "9": { |
| 130 | + "name": "invalid.illegal.character.escape" |
116 | 131 | } |
117 | 132 | } |
118 | 133 | }, |
|
352 | 367 | "patterns": [ |
353 | 368 | { |
354 | 369 | "comment": "variables (any char lowercase)", |
355 | | - "name": "variable.other.rust", |
| 370 | + "name": "variable.other.st", |
356 | 371 | "match": "(\\b|^)(?<!(?<!\\.)\\.)([a-z][A-Za-z0-9_]*|_+[a-z0-9][A-Za-z0-9_]*)(\\b|$)" |
357 | 372 | } |
358 | 373 | ] |
|
0 commit comments