Skip to content

Commit b5525ea

Browse files
authored
Pick up updated coffeescript grammar (microsoft#23123)
* Pick up updated coffeescript grammar Fixes microsoft#23104 * Updated test results
1 parent 4796815 commit b5525ea

2 files changed

Lines changed: 80 additions & 110 deletions

File tree

extensions/coffeescript/syntaxes/coffeescript.tmLanguage.json

Lines changed: 48 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,18 @@
5454
"name": "punctuation.definition.string.end.coffee"
5555
}
5656
},
57-
"name": "string.quoted.heredoc.coffee"
57+
"name": "string.quoted.heredoc.coffee",
58+
"patterns": [
59+
{
60+
"captures": {
61+
"1": {
62+
"name": "punctuation.definition.escape.backslash.coffee"
63+
}
64+
},
65+
"match": "(\\\\).",
66+
"name": "constant.character.escape.backslash.coffee"
67+
}
68+
]
5869
},
5970
{
6071
"begin": "\"\"\"",
@@ -72,8 +83,13 @@
7283
"name": "string.quoted.double.heredoc.coffee",
7384
"patterns": [
7485
{
75-
"match": "\\\\.",
76-
"name": "constant.character.escape.coffee"
86+
"captures": {
87+
"1": {
88+
"name": "punctuation.definition.escape.backslash.coffee"
89+
}
90+
},
91+
"match": "(\\\\).",
92+
"name": "constant.character.escape.backslash.coffee"
7793
},
7894
{
7995
"include": "#interpolated_coffee"
@@ -148,24 +164,23 @@
148164
]
149165
},
150166
{
151-
"begin": "/(?![/*+?])(?=([^\\\\]|\\\\.)*?/[gimuy]*)",
152-
"beginCaptures": {
153-
"0": {
154-
"name": "punctuation.definition.string.begin.coffee"
155-
}
156-
},
157-
"end": "(/)[gimuy]*",
158-
"endCaptures": {
167+
"match": "(?<![\\w$])(/)(?![/*+?])(.+?)(/)[gimuy]*(?!\\s*[\\w$/(])",
168+
"captures": {
159169
"1": {
170+
"name": "punctuation.definition.string.begin.coffee"
171+
},
172+
"2": {
173+
"patterns": [
174+
{
175+
"include": "source.js.regexp"
176+
}
177+
]
178+
},
179+
"3": {
160180
"name": "punctuation.definition.string.end.coffee"
161181
}
162182
},
163-
"name": "string.regexp.coffee",
164-
"patterns": [
165-
{
166-
"include": "source.js.regexp"
167-
}
168-
]
183+
"name": "string.regexp.coffee"
169184
},
170185
{
171186
"match": "\\b(?<![\\.\\$])(break|by|catch|continue|else|finally|for|in|of|if|return|switch|then|throw|try|unless|when|while|until|loop|do|(?<=for)\\s+own)(?!\\s*:)\\b",
@@ -217,7 +232,7 @@
217232
]
218233
},
219234
{
220-
"begin": "(?<=\\s|^)(\\[)(?=[^'\"#]+?}[\\s\\]}]*=)",
235+
"begin": "(?<=\\s|^)(\\[)(?=[^'\"#]+?\\][\\s\\]}]*=)",
221236
"beginCaptures": {
222237
"1": {
223238
"name": "punctuation.definition.destructuring.begin.bracket.square.coffee"
@@ -423,8 +438,13 @@
423438
"name": "string.quoted.double.coffee",
424439
"patterns": [
425440
{
426-
"match": "\\\\(x\\h{2}|[0-2][0-7]{0,2}|3[0-6][0-7]|37[0-7]?|[4-7][0-7]?|.)",
427-
"name": "constant.character.escape.coffee"
441+
"captures": {
442+
"1": {
443+
"name": "punctuation.definition.escape.backslash.coffee"
444+
}
445+
},
446+
"match": "(\\\\)(x\\h{2}|[0-2][0-7]{0,2}|3[0-6][0-7]|37[0-7]?|[4-7][0-7]?|.)",
447+
"name": "constant.character.escape.backslash.coffee"
428448
},
429449
{
430450
"include": "#interpolated_coffee"
@@ -499,8 +519,13 @@
499519
"name": "string.quoted.single.coffee",
500520
"patterns": [
501521
{
502-
"match": "\\\\(x\\h{2}|[0-2][0-7]{0,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.)",
503-
"name": "constant.character.escape.coffee"
522+
"captures": {
523+
"1": {
524+
"name": "punctuation.definition.escape.backslash.coffee"
525+
}
526+
},
527+
"match": "(\\\\)(x\\h{2}|[0-2][0-7]{0,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.)",
528+
"name": "constant.character.escape.backslash.coffee"
504529
}
505530
]
506531
}
@@ -662,5 +687,5 @@
662687
]
663688
}
664689
},
665-
"version": "https://github.com/atom/language-coffee-script/commit/062904ccd3f81bf3edcd8d21ba6ba38ffb615116"
690+
"version": "https://github.com/atom/language-coffee-script/commit/966587ed53c26944cbee0666a6d6fafd68d19b97"
666691
}

extensions/coffeescript/test/colorize-results/test-regex_coffee.json

Lines changed: 32 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -55,62 +55,7 @@
5555
}
5656
},
5757
{
58-
"c": "Hello ",
59-
"t": "source.coffee string.regexp.coffee",
60-
"r": {
61-
"dark_plus": "string.regexp: #D16969",
62-
"light_plus": "string.regexp: #811F3F",
63-
"dark_vs": "string.regexp: #D16969",
64-
"light_vs": "string.regexp: #811F3F",
65-
"hc_black": "string.regexp: #D16969"
66-
}
67-
},
68-
{
69-
"c": "(",
70-
"t": "source.coffee string.regexp.coffee meta.group.regexp punctuation.definition.group.regexp",
71-
"r": {
72-
"dark_plus": "string.regexp: #D16969",
73-
"light_plus": "string.regexp: #811F3F",
74-
"dark_vs": "string.regexp: #D16969",
75-
"light_vs": "string.regexp: #811F3F",
76-
"hc_black": "string.regexp: #D16969"
77-
}
78-
},
79-
{
80-
"c": "\\d",
81-
"t": "source.coffee string.regexp.coffee meta.group.regexp constant.character.character-class.regexp",
82-
"r": {
83-
"dark_plus": "string.regexp: #D16969",
84-
"light_plus": "string.regexp: #811F3F",
85-
"dark_vs": "string.regexp: #D16969",
86-
"light_vs": "string.regexp: #811F3F",
87-
"hc_black": "string.regexp: #D16969"
88-
}
89-
},
90-
{
91-
"c": "+",
92-
"t": "source.coffee string.regexp.coffee meta.group.regexp keyword.operator.quantifier.regexp",
93-
"r": {
94-
"dark_plus": "keyword.operator: #D4D4D4",
95-
"light_plus": "keyword.operator: #000000",
96-
"dark_vs": "keyword.operator: #D4D4D4",
97-
"light_vs": "keyword.operator: #000000",
98-
"hc_black": "keyword.operator: #D4D4D4"
99-
}
100-
},
101-
{
102-
"c": ")",
103-
"t": "source.coffee string.regexp.coffee meta.group.regexp punctuation.definition.group.regexp",
104-
"r": {
105-
"dark_plus": "string.regexp: #D16969",
106-
"light_plus": "string.regexp: #811F3F",
107-
"dark_vs": "string.regexp: #D16969",
108-
"light_vs": "string.regexp: #811F3F",
109-
"hc_black": "string.regexp: #D16969"
110-
}
111-
},
112-
{
113-
"c": " #{user}",
58+
"c": "Hello (\\d+) #{user}",
11459
"t": "source.coffee string.regexp.coffee",
11560
"r": {
11661
"dark_plus": "string.regexp: #D16969",
@@ -276,29 +221,29 @@
276221
},
277222
{
278223
"c": "/",
279-
"t": "source.coffee string.regexp.coffee punctuation.definition.string.begin.coffee",
224+
"t": "source.coffee keyword.operator.coffee",
280225
"r": {
281-
"dark_plus": "string.regexp: #D16969",
282-
"light_plus": "string.regexp: #811F3F",
283-
"dark_vs": "string.regexp: #D16969",
284-
"light_vs": "string.regexp: #811F3F",
285-
"hc_black": "string.regexp: #D16969"
226+
"dark_plus": "keyword.operator: #D4D4D4",
227+
"light_plus": "keyword.operator: #000000",
228+
"dark_vs": "keyword.operator: #D4D4D4",
229+
"light_vs": "keyword.operator: #000000",
230+
"hc_black": "keyword.operator: #D4D4D4"
286231
}
287232
},
288233
{
289234
"c": "c ",
290-
"t": "source.coffee string.regexp.coffee",
235+
"t": "source.coffee",
291236
"r": {
292-
"dark_plus": "string.regexp: #D16969",
293-
"light_plus": "string.regexp: #811F3F",
294-
"dark_vs": "string.regexp: #D16969",
295-
"light_vs": "string.regexp: #811F3F",
296-
"hc_black": "string.regexp: #D16969"
237+
"dark_plus": "default: #D4D4D4",
238+
"light_plus": "default: #000000",
239+
"dark_vs": "default: #D4D4D4",
240+
"light_vs": "default: #000000",
241+
"hc_black": "default: #FFFFFF"
297242
}
298243
},
299244
{
300245
"c": "+",
301-
"t": "source.coffee string.regexp.coffee keyword.operator.quantifier.regexp",
246+
"t": "source.coffee keyword.operator.coffee",
302247
"r": {
303248
"dark_plus": "keyword.operator: #D4D4D4",
304249
"light_plus": "keyword.operator: #000000",
@@ -309,35 +254,35 @@
309254
},
310255
{
311256
"c": " d",
312-
"t": "source.coffee string.regexp.coffee",
257+
"t": "source.coffee",
313258
"r": {
314-
"dark_plus": "string.regexp: #D16969",
315-
"light_plus": "string.regexp: #811F3F",
316-
"dark_vs": "string.regexp: #D16969",
317-
"light_vs": "string.regexp: #811F3F",
318-
"hc_black": "string.regexp: #D16969"
259+
"dark_plus": "default: #D4D4D4",
260+
"light_plus": "default: #000000",
261+
"dark_vs": "default: #D4D4D4",
262+
"light_vs": "default: #000000",
263+
"hc_black": "default: #FFFFFF"
319264
}
320265
},
321266
{
322267
"c": "/",
323-
"t": "source.coffee string.regexp.coffee punctuation.definition.string.end.coffee",
268+
"t": "source.coffee keyword.operator.coffee",
324269
"r": {
325-
"dark_plus": "string.regexp: #D16969",
326-
"light_plus": "string.regexp: #811F3F",
327-
"dark_vs": "string.regexp: #D16969",
328-
"light_vs": "string.regexp: #811F3F",
329-
"hc_black": "string.regexp: #D16969"
270+
"dark_plus": "keyword.operator: #D4D4D4",
271+
"light_plus": "keyword.operator: #000000",
272+
"dark_vs": "keyword.operator: #D4D4D4",
273+
"light_vs": "keyword.operator: #000000",
274+
"hc_black": "keyword.operator: #D4D4D4"
330275
}
331276
},
332277
{
333278
"c": "g",
334-
"t": "source.coffee string.regexp.coffee",
279+
"t": "source.coffee",
335280
"r": {
336-
"dark_plus": "string.regexp: #D16969",
337-
"light_plus": "string.regexp: #811F3F",
338-
"dark_vs": "string.regexp: #D16969",
339-
"light_vs": "string.regexp: #811F3F",
340-
"hc_black": "string.regexp: #D16969"
281+
"dark_plus": "default: #D4D4D4",
282+
"light_plus": "default: #000000",
283+
"dark_vs": "default: #D4D4D4",
284+
"light_vs": "default: #000000",
285+
"hc_black": "default: #FFFFFF"
341286
}
342287
},
343288
{

0 commit comments

Comments
 (0)