github-linguist 5.0.8 → 5.0.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. checksums.yaml +4 -4
  2. data/bin/linguist +1 -1
  3. data/grammars/source.assembly.json +2 -1
  4. data/grammars/source.clean.json +1 -1
  5. data/grammars/source.clojure.json +13 -3
  6. data/grammars/source.coffee.json +2 -2
  7. data/grammars/source.csound-document.json +1 -2
  8. data/grammars/source.csound.json +1 -1
  9. data/grammars/source.css.json +7 -7
  10. data/grammars/source.ditroff.json +5 -5
  11. data/grammars/source.elixir.json +2 -2
  12. data/grammars/source.gfm.json +31 -3
  13. data/grammars/source.harbour.json +21 -51
  14. data/grammars/source.jison.json +16 -16
  15. data/grammars/source.jisonlex.json +6 -6
  16. data/grammars/source.jolie.json +138 -0
  17. data/grammars/source.nim.json +20 -5
  18. data/grammars/source.perl6fe.json +3 -3
  19. data/grammars/source.python.json +23 -23
  20. data/grammars/source.renpy.json +2 -2
  21. data/grammars/source.solidity.json +2 -2
  22. data/grammars/source.sqf.json +1 -1
  23. data/grammars/source.terraform.json +78 -25
  24. data/grammars/source.ts.json +176 -157
  25. data/grammars/source.tsx.json +176 -157
  26. data/grammars/source.yaml.json +5 -4
  27. data/grammars/text.html.basic.json +212 -60
  28. data/grammars/text.html.ecr.json +1 -1
  29. data/grammars/text.html.php.blade.json +607 -264
  30. data/grammars/text.html.php.json +18 -14
  31. data/grammars/text.html.vue.json +10 -10
  32. data/grammars/text.marko.json +13 -2
  33. data/grammars/{source.gfm.clean.json → text.restructuredtext.clean.json} +4 -5
  34. data/grammars/text.restructuredtext.json +4 -3
  35. data/grammars/text.roff.json +390 -23
  36. data/grammars/text.tex.latex.json +1 -1
  37. data/lib/linguist.rb +1 -1
  38. data/lib/linguist/heuristics.rb +27 -18
  39. data/lib/linguist/languages.json +1 -1
  40. data/lib/linguist/languages.yml +39 -2
  41. data/lib/linguist/samples.json +1999 -737
  42. data/lib/linguist/version.rb +1 -1
  43. metadata +5 -4
@@ -7,6 +7,7 @@
7
7
  "eyaml",
8
8
  "eyml",
9
9
  "yaml",
10
+ "yamllint",
10
11
  "yaml.erb",
11
12
  "yml",
12
13
  "yml.erb",
@@ -36,7 +37,7 @@
36
37
  "name": "punctuation.definition.document.end.yaml"
37
38
  },
38
39
  {
39
- "begin": "^(\\s*)(?!-\\s*)(\\S+)\\s*(:)(?:\\s+((!)[^!\\s]+))?\\s+(?=\\||>)",
40
+ "begin": "^(\\s*)(?!-\\s*)(.*\\S)\\s*(:)(?:\\s+((!)[^!\\s]+))?\\s+(?=\\||>)",
40
41
  "beginCaptures": {
41
42
  "2": {
42
43
  "name": "entity.name.tag.yaml"
@@ -63,7 +64,7 @@
63
64
  ]
64
65
  },
65
66
  {
66
- "begin": "^(\\s*)(?:(-)|(?:(?:(-)\\s*)?(\\S+)\\s*(:)))(?:\\s+((!)[^!\\s]+))?\\s+(?=\\||>)",
67
+ "begin": "^(\\s*)(?:(-)|(?:(?:(-)\\s*)?(.*\\S)\\s*(:)))(?:\\s+((!)[^!\\s]+))?\\s+(?=\\||>)",
67
68
  "beginCaptures": {
68
69
  "2": {
69
70
  "name": "punctuation.definition.entry.yaml"
@@ -114,7 +115,7 @@
114
115
  }
115
116
  },
116
117
  {
117
- "begin": "(?>^(\\s*)(-)?\\s*)([^!{@#%&*>,'\"][^#'\"]*?)(:)\\s+((!!)omap)?",
118
+ "begin": "(?>^(\\s*)(-)?\\s*)([^!{@#%&*>,'\"][^#]*?)(:)\\s+((!!)omap)?",
118
119
  "beginCaptures": {
119
120
  "2": {
120
121
  "name": "punctuation.definition.entry.yaml"
@@ -232,7 +233,7 @@
232
233
  }
233
234
  },
234
235
  "constants": {
235
- "match": "(?<=\\s)(true|false|null)(?=\\s*$)",
236
+ "match": "(?<=\\s)(true|false|null|True|False|Null|TRUE|FALSE|NULL|~)(?=\\s*$)",
236
237
  "name": "constant.language.yaml"
237
238
  },
238
239
  "date": {
@@ -10,7 +10,7 @@
10
10
  ],
11
11
  "firstLineMatch": "<(?i:(!DOCTYPE\\s*)?html)",
12
12
  "injections": {
13
- "R:text.html - comment.block": {
13
+ "R:text.html - (comment.block, text.html source)": {
14
14
  "comment": "Use R: to ensure this matches after any other injections.",
15
15
  "patterns": [
16
16
  {
@@ -24,7 +24,7 @@
24
24
  "name": "HTML",
25
25
  "patterns": [
26
26
  {
27
- "begin": "(<)([a-zA-Z0-9:]++)(?=[^>]*></\\2>)",
27
+ "begin": "(<)([a-zA-Z][a-zA-Z0-9:-]*)(?=[^>]*></\\2>)",
28
28
  "beginCaptures": {
29
29
  "1": {
30
30
  "name": "punctuation.definition.tag.html"
@@ -139,97 +139,249 @@
139
139
  "include": "#embedded-code"
140
140
  },
141
141
  {
142
- "begin": "(?:^\\s+)?(<)((?i:style))\\b(?![^>]*/>)",
143
- "captures": {
142
+ "begin": "(^[ \\t]+)?(?=<(?i:style))",
143
+ "beginCaptures": {
144
144
  "1": {
145
- "name": "punctuation.definition.tag.html"
146
- },
147
- "2": {
148
- "name": "entity.name.tag.style.html"
149
- },
150
- "3": {
151
- "name": "punctuation.definition.tag.html"
145
+ "name": "punctuation.whitespace.embedded.leading.html"
146
+ }
147
+ },
148
+ "end": "(?!\\G)([ \\t]*$\\n?)?",
149
+ "endCaptures": {
150
+ "1": {
151
+ "name": "punctuation.whitespace.embedded.trailing.html"
152
152
  }
153
153
  },
154
- "end": "(</)((?i:style))(>)(?:\\s*\\n)?",
155
- "name": "source.css.embedded.html",
156
154
  "patterns": [
157
155
  {
158
- "include": "#tag-stuff"
159
- },
160
- {
161
- "begin": "(>)",
156
+ "begin": "(<)((?i:style))\\b",
162
157
  "beginCaptures": {
158
+ "0": {
159
+ "name": "meta.tag.metadata.style.html"
160
+ },
163
161
  "1": {
164
- "name": "punctuation.definition.tag.html"
162
+ "name": "punctuation.definition.tag.begin.html"
163
+ },
164
+ "2": {
165
+ "name": "entity.name.tag.html"
165
166
  }
166
167
  },
167
- "end": "(?=</(?i:style))",
168
+ "end": "(/>)|((<)/)((?i:style))(>)",
169
+ "endCaptures": {
170
+ "0": {
171
+ "name": "meta.tag.metadata.style.html"
172
+ },
173
+ "1": {
174
+ "name": "punctuation.definition.tag.end.html"
175
+ },
176
+ "2": {
177
+ "name": "punctuation.definition.tag.begin.html"
178
+ },
179
+ "3": {
180
+ "name": "source.css"
181
+ },
182
+ "4": {
183
+ "name": "entity.name.tag.html"
184
+ },
185
+ "5": {
186
+ "name": "punctuation.definition.tag.end.html"
187
+ }
188
+ },
189
+ "name": "meta.embedded.block.html",
168
190
  "patterns": [
169
191
  {
170
- "include": "#embedded-code"
192
+ "begin": "\\G",
193
+ "captures": {
194
+ "1": {
195
+ "name": "punctuation.definition.tag.end.html"
196
+ }
197
+ },
198
+ "end": "(?=/>)|(>)",
199
+ "name": "meta.tag.metadata.style.html",
200
+ "patterns": [
201
+ {
202
+ "include": "#tag-stuff"
203
+ }
204
+ ]
171
205
  },
172
206
  {
173
- "include": "source.css"
207
+ "begin": "(?!\\G)",
208
+ "end": "(?=</(?i:style))",
209
+ "name": "source.css",
210
+ "patterns": [
211
+ {
212
+ "include": "#embedded-code"
213
+ },
214
+ {
215
+ "include": "source.css"
216
+ }
217
+ ]
174
218
  }
175
219
  ]
176
220
  }
177
221
  ]
178
222
  },
179
223
  {
180
- "begin": "(?:^\\s+)?(<)((?i:script))\\b(?![^>]*/>)(?![^>]*(?i:type.?=.?text/((?!javascript).*)))",
224
+ "begin": "(^[ \\t]+)?(?=<(?i:script))",
181
225
  "beginCaptures": {
182
226
  "1": {
183
- "name": "punctuation.definition.tag.html"
184
- },
185
- "2": {
186
- "name": "entity.name.tag.script.html"
227
+ "name": "punctuation.whitespace.embedded.leading.html"
187
228
  }
188
229
  },
189
- "end": "(?<=</(script|SCRIPT))(>)(?:\\s*\\n)?",
230
+ "end": "(?!\\G)([ \\t]*$\\n?)?",
190
231
  "endCaptures": {
191
- "2": {
192
- "name": "punctuation.definition.tag.html"
232
+ "1": {
233
+ "name": "punctuation.whitespace.embedded.trailing.html"
193
234
  }
194
235
  },
195
- "name": "source.js.embedded.html",
196
236
  "patterns": [
197
237
  {
198
- "include": "#tag-stuff"
199
- },
200
- {
201
- "begin": "(?<!</(?:script|SCRIPT))(>)",
202
- "captures": {
238
+ "begin": "(<)((?i:script))\\b",
239
+ "beginCaptures": {
240
+ "0": {
241
+ "name": "meta.tag.metadata.script.html"
242
+ },
203
243
  "1": {
204
- "name": "punctuation.definition.tag.html"
244
+ "name": "punctuation.definition.tag.begin.html"
205
245
  },
206
246
  "2": {
207
- "name": "entity.name.tag.script.html"
247
+ "name": "entity.name.tag.html"
208
248
  }
209
249
  },
210
- "end": "(</)((?i:script))",
211
- "patterns": [
212
- {
213
- "captures": {
214
- "1": {
215
- "name": "punctuation.definition.comment.js"
216
- }
217
- },
218
- "match": "(//).*?((?=</script)|$\\n?)",
219
- "name": "comment.line.double-slash.js"
250
+ "end": "(/>)|(/)((?i:script))(>)",
251
+ "endCaptures": {
252
+ "0": {
253
+ "name": "meta.tag.metadata.script.html"
220
254
  },
221
- {
222
- "begin": "/\\*",
223
- "captures": {
224
- "0": {
225
- "name": "punctuation.definition.comment.js"
226
- }
227
- },
228
- "end": "\\*/|(?=</script)",
229
- "name": "comment.block.js"
255
+ "1": {
256
+ "name": "punctuation.definition.tag.end.html"
230
257
  },
258
+ "2": {
259
+ "name": "punctuation.definition.tag.begin.html"
260
+ },
261
+ "3": {
262
+ "name": "entity.name.tag.html"
263
+ },
264
+ "4": {
265
+ "name": "punctuation.definition.tag.end.html"
266
+ }
267
+ },
268
+ "name": "meta.embedded.block.html",
269
+ "patterns": [
231
270
  {
232
- "include": "source.js"
271
+ "begin": "\\G",
272
+ "end": "(?=/>|/)",
273
+ "patterns": [
274
+ {
275
+ "begin": "(>)",
276
+ "beginCaptures": {
277
+ "0": {
278
+ "name": "meta.tag.metadata.script.html"
279
+ },
280
+ "1": {
281
+ "name": "punctuation.definition.tag.end.html"
282
+ }
283
+ },
284
+ "end": "((<))(?=/(?i:script))",
285
+ "endCaptures": {
286
+ "0": {
287
+ "name": "meta.tag.metadata.script.html"
288
+ },
289
+ "1": {
290
+ "name": "punctuation.definition.tag.begin.html"
291
+ },
292
+ "2": {
293
+ "name": "source.js"
294
+ }
295
+ },
296
+ "patterns": [
297
+ {
298
+ "begin": "\\G",
299
+ "end": "(?=</(?i:script))",
300
+ "name": "source.js",
301
+ "patterns": [
302
+ {
303
+ "begin": "(^[ \\t]+)?(?=//)",
304
+ "beginCaptures": {
305
+ "1": {
306
+ "name": "punctuation.whitespace.comment.leading.js"
307
+ }
308
+ },
309
+ "end": "(?!\\G)",
310
+ "patterns": [
311
+ {
312
+ "begin": "//",
313
+ "beginCaptures": {
314
+ "0": {
315
+ "name": "punctuation.definition.comment.js"
316
+ }
317
+ },
318
+ "end": "(?=</script)|\\n",
319
+ "name": "comment.line.double-slash.js"
320
+ }
321
+ ]
322
+ },
323
+ {
324
+ "begin": "/\\*",
325
+ "captures": {
326
+ "0": {
327
+ "name": "punctuation.definition.comment.js"
328
+ }
329
+ },
330
+ "end": "\\*/|(?=</script)",
331
+ "name": "comment.block.js"
332
+ },
333
+ {
334
+ "include": "source.js"
335
+ }
336
+ ]
337
+ }
338
+ ]
339
+ },
340
+ {
341
+ "begin": "\\G",
342
+ "end": "(?i:(?=/?>|type\\s*=\\s*('|\"|)(?!text/(javascript|ecmascript)|application/((x-)?javascript|ecmascript))\\b))",
343
+ "name": "meta.tag.metadata.script.html",
344
+ "patterns": [
345
+ {
346
+ "include": "#tag-stuff"
347
+ }
348
+ ]
349
+ },
350
+ {
351
+ "begin": "(?=(?i:type))",
352
+ "end": "(<)(?=/(?i:script))",
353
+ "endCaptures": {
354
+ "0": {
355
+ "name": "meta.tag.metadata.script.html"
356
+ },
357
+ "1": {
358
+ "name": "punctuation.definition.tag.begin.html"
359
+ }
360
+ },
361
+ "patterns": [
362
+ {
363
+ "begin": "\\G",
364
+ "end": "(>)|(?=/>)",
365
+ "endCaptures": {
366
+ "1": {
367
+ "name": "punctuation.definition.tag.end.html"
368
+ }
369
+ },
370
+ "name": "meta.tag.metadata.script.html",
371
+ "patterns": [
372
+ {
373
+ "include": "#tag-stuff"
374
+ }
375
+ ]
376
+ },
377
+ {
378
+ "begin": "(?!\\G)",
379
+ "end": "(?=</(?i:script))",
380
+ "name": "source.unknown"
381
+ }
382
+ ]
383
+ }
384
+ ]
233
385
  }
234
386
  ]
235
387
  }
@@ -277,7 +429,7 @@
277
429
  ]
278
430
  },
279
431
  {
280
- "begin": "(</?)((?i:a|abbr|acronym|area|b|base|basefont|bdo|big|br|button|caption|cite|code|col|colgroup|del|dfn|em|font|head|html|i|img|input|ins|isindex|kbd|label|legend|li|link|map|meta|noscript|optgroup|option|param|q|s|samp|script|select|small|span|strike|strong|style|sub|sup|table|tbody|td|textarea|tfoot|th|thead|title|tr|tt|u|var)\\b)",
432
+ "begin": "(</?)((?i:a|abbr|acronym|area|b|base|basefont|bdo|big|br|button|caption|cite|code|col|colgroup|del|dfn|em|font|head|html|i|img|input|ins|isindex|kbd|label|legend|li|link|map|meta|noscript|optgroup|option|param|q|s|samp|script|select|small|span|strike|strong|style|sub|sup|table|tbody|td|textarea|tfoot|th|thead|title|tr|tt|u|var)\\b(?!-))",
281
433
  "beginCaptures": {
282
434
  "1": {
283
435
  "name": "punctuation.definition.tag.begin.html"
@@ -300,7 +452,7 @@
300
452
  ]
301
453
  },
302
454
  {
303
- "begin": "(</?)([a-zA-Z0-9:]+)",
455
+ "begin": "(</?)([a-zA-Z][a-zA-Z0-9:-]*)",
304
456
  "beginCaptures": {
305
457
  "1": {
306
458
  "name": "punctuation.definition.tag.begin.html"
@@ -309,7 +461,7 @@
309
461
  "name": "entity.name.tag.other.html"
310
462
  }
311
463
  },
312
- "end": "(>)",
464
+ "end": "(/?>)",
313
465
  "endCaptures": {
314
466
  "1": {
315
467
  "name": "punctuation.definition.tag.end.html"
@@ -1,5 +1,5 @@
1
1
  {
2
- "fileType": [
2
+ "fileTypes": [
3
3
  "ecr",
4
4
  "html.ecr"
5
5
  ],
@@ -215,7 +215,7 @@
215
215
  ]
216
216
  },
217
217
  {
218
- "begin": "(?x)\n(?<![A-Za-z0-9_@]) # Prepended @ or literal character escapes the sequence\n@\n(?: # Ordering not important as we everything will be matched up to opening parentheses\n [Bb]reak\n|[Cc]an\n|[Cc]annot\n|[Cc]hoice\n|[Cc]omponent\n|[Cc]ontinue\n|[Ee]ach\n|[Ee]lsecan\n|[Ee]lsecannot\n|[Ee]lseif\n|[Ee]xtends\n|[Ff]or\n|[Ff]oreach\n|[Ff]orelse\n|[Hh]asSection\n|[Ii]f\n|[Ii]nclude\n|[Ii]ncludeIf\n|[Ii]ncludeWhen\n|[Ii]nject\n|[Ll]ang\n|[Pp]hp\n|[Pp]repend\n|[Pp]ush\n|[Ss]ection\n|[Ss]lot\n|[Ss]tack\n|[Uu]nless\n|[Uu]nset\n|[Ww]hile\n|[Yy]ield\n)\n[\\t ]* # Whitespace between name and parentheses, consumed\n(?=\\() # Followed by opening parentheses, not consumed",
218
+ "begin": "(?x)\n(?<![A-Za-z0-9_@]) # Prepended @ or literal character escapes the sequence\n@\n(?i: # Ordering not important as we everything will be matched up to opening parentheses\n break\n|can\n|cannot\n|choice\n|component\n|continue\n|each\n|elsecan\n|elsecannot\n|elseif\n|extends\n|for\n|foreach\n|forelse\n|hassection\n|if\n|include\n|includeif\n|includewhen\n|inject\n|isset\n|lang\n|php\n|prepend\n|push\n|section\n|slot\n|stack\n|unless\n|unset\n|while\n|yield\n)\n[\\t ]* # Whitespace between name and parentheses, consumed\n(?=\\() # Followed by opening parentheses, not consumed",
219
219
  "beginCaptures": {
220
220
  "0": {
221
221
  "name": "keyword.blade"
@@ -231,7 +231,7 @@
231
231
  ]
232
232
  },
233
233
  {
234
- "begin": "(?x)\n(?<![A-Za-z0-9_@]) # Prepended @ or literal character escapes the sequence\n@\n(?: # Ordering not important as we everything will be matched up to opening parentheses\n [Aa]ppend\n|[Ee]lse\n|[Ee]mpty\n|[Ee]ndcan\n|[Ee]ndcannot\n|[Ee]ndcomponent\n|[Ee]ndfor\n|[Ee]ndforeach\n|[Ee]ndforelse\n|[Ee]ndif\n|[Ee]ndlang\n|[Ee]ndprepend\n|[Ee]ndpush\n|[Ee]ndsection\n|[Ee]ndslot\n|[Ee]ndunless\n|[Ee]ndwhile\n|[Oo]verwrite\n|[Pp]arent\n|[Ss]how\n|[Ss]top\n)\n[\\t ]* # Whitespace between name and parentheses, consumed\n(?=\\() # Followed by opening parentheses, not consumed",
234
+ "begin": "(?x)\n(?<![A-Za-z0-9_@]) # Prepended @ or literal character escapes the sequence\n@\n(?i: # Ordering not important as we everything will be matched up to opening parentheses\n append\n|else\n|endcan\n|endcannot\n|endcomponent\n|endempty\n|endfor\n|endforeach\n|endforelse\n|endif\n|endisset\n|endlang\n|endprepend\n|endpush\n|endsection\n|endslot\n|endunless\n|endwhile\n|overwrite\n|parent\n|show\n|stop\n)\n[\\t ]* # Whitespace between name and parentheses, consumed\n(?=\\() # Followed by opening parentheses, not consumed",
235
235
  "beginCaptures": {
236
236
  "0": {
237
237
  "name": "keyword.blade"
@@ -242,12 +242,12 @@
242
242
  "name": "meta.directive.blade"
243
243
  },
244
244
  {
245
- "match": "(?x)\n(?<![A-Za-z0-9_@]) # Prepended @ or literal character escapes the sequence\n@\n(?: # Ordering not important as we everything will be matched up to word boundary\n [Aa]ppend\n|[Bb]reak\n|[Cc]ontinue\n|[Ee]lse\n|[Ee]mpty\n|[Ee]ndcan\n|[Ee]ndcannot\n|[Ee]ndcomponent\n|[Ee]ndfor\n|[Ee]ndforeach\n|[Ee]ndforelse\n|[Ee]ndif\n|[Ee]ndlang\n|[Ee]ndprepend\n|[Ee]ndpush\n|[Ee]ndsection\n|[Ee]ndslot\n|[Ee]ndunless\n|endverbatim\n|[Ee]ndwhile\n|[Ll]ang\n|[Oo]verwrite\n|[Pp]arent\n|[Ss]how\n|[Ss]top\n|verbatim\n)\n\\b",
245
+ "match": "(?x)\n(?<![A-Za-z0-9_@]) # Prepended @ or literal character escapes the sequence\n@\n(?: # Ordering not important as we everything will be matched up to word boundary\n (?i)append\n|(?i)break\n|(?i)continue\n|(?i)else\n|(?i)empty\n|(?i)endcan\n|(?i)endcannot\n|(?i)endcomponent\n|(?i)endempty\n|(?i)endfor\n|(?i)endforeach\n|(?i)endforelse\n|(?i)endif\n|(?i)endisset\n|(?i)endlang\n|(?i)endprepend\n|(?i)endpush\n|(?i)endsection\n|(?i)endslot\n|(?i)endunless\n|endverbatim\n|(?i)endwhile\n|(?i)lang\n|(?i)overwrite\n|(?i)parent\n|(?i)show\n|(?i)stop\n|verbatim\n)\n\\b",
246
246
  "name": "keyword.blade"
247
247
  },
248
248
  {
249
- "begin": "(?<![A-Za-z0-9_@])@[Pp]hp",
250
- "end": "(?<![A-Za-z0-9_@])@[Ee]ndphp([\\t ]*\\(.*\\)(?!.*\\)))?",
249
+ "begin": "(?<![A-Za-z0-9_@])@(?i:php)",
250
+ "end": "(?<![A-Za-z0-9_@])@(?i:endphp)([\\t ]*\\(.*\\)(?!.*\\)))?",
251
251
  "beginCaptures": {
252
252
  "0": {
253
253
  "name": "keyword.begin.blade"
@@ -489,7 +489,7 @@
489
489
  "name": "comment.block.php"
490
490
  },
491
491
  {
492
- "begin": "(^[ \\t]+)?(?=//)",
492
+ "begin": "(^\\s+)?(?=//)",
493
493
  "beginCaptures": {
494
494
  "1": {
495
495
  "name": "punctuation.whitespace.comment.leading.php"
@@ -510,7 +510,7 @@
510
510
  ]
511
511
  },
512
512
  {
513
- "begin": "(^[ \\t]+)?(?=#)",
513
+ "begin": "(^\\s+)?(?=#)",
514
514
  "beginCaptures": {
515
515
  "1": {
516
516
  "name": "punctuation.whitespace.comment.leading.php"
@@ -826,315 +826,658 @@
826
826
  {
827
827
  "begin": "(?=<<<\\s*(\"?)([a-zA-Z_]+[a-zA-Z0-9_]*)(\\1)\\s*$)",
828
828
  "end": "(?!\\G)",
829
- "injections": {
830
- "*": {
829
+ "name": "string.unquoted.heredoc.php",
830
+ "patterns": [
831
+ {
832
+ "include": "#heredoc_interior"
833
+ }
834
+ ]
835
+ },
836
+ {
837
+ "begin": "(?=<<<\\s*'([a-zA-Z_]+[a-zA-Z0-9_]*)'\\s*$)",
838
+ "end": "(?!\\G)",
839
+ "name": "string.unquoted.nowdoc.php",
840
+ "patterns": [
841
+ {
842
+ "include": "#nowdoc_interior"
843
+ }
844
+ ]
845
+ }
846
+ ]
847
+ },
848
+ "heredoc_interior": {
849
+ "patterns": [
850
+ {
851
+ "begin": "(<<<)\\s*(\"?)(HTML)(\\2)(\\s*)$",
852
+ "beginCaptures": {
853
+ "0": {
854
+ "name": "punctuation.section.embedded.begin.php"
855
+ },
856
+ "1": {
857
+ "name": "punctuation.definition.string.php"
858
+ },
859
+ "3": {
860
+ "name": "keyword.operator.heredoc.php"
861
+ },
862
+ "5": {
863
+ "name": "invalid.illegal.trailing-whitespace.php"
864
+ }
865
+ },
866
+ "contentName": "text.html",
867
+ "end": "^(\\3)\\b",
868
+ "endCaptures": {
869
+ "0": {
870
+ "name": "punctuation.section.embedded.end.php"
871
+ },
872
+ "1": {
873
+ "name": "keyword.operator.heredoc.php"
874
+ }
875
+ },
876
+ "name": "meta.embedded.html",
877
+ "patterns": [
878
+ {
879
+ "include": "#interpolation"
880
+ },
881
+ {
882
+ "include": "text.html.basic"
883
+ }
884
+ ]
885
+ },
886
+ {
887
+ "begin": "(<<<)\\s*(\"?)(XML)(\\2)(\\s*)$",
888
+ "beginCaptures": {
889
+ "0": {
890
+ "name": "punctuation.section.embedded.begin.php"
891
+ },
892
+ "1": {
893
+ "name": "punctuation.definition.string.php"
894
+ },
895
+ "3": {
896
+ "name": "keyword.operator.heredoc.php"
897
+ },
898
+ "5": {
899
+ "name": "invalid.illegal.trailing-whitespace.php"
900
+ }
901
+ },
902
+ "contentName": "text.xml",
903
+ "end": "^(\\3)\\b",
904
+ "endCaptures": {
905
+ "0": {
906
+ "name": "punctuation.section.embedded.end.php"
907
+ },
908
+ "1": {
909
+ "name": "keyword.operator.heredoc.php"
910
+ }
911
+ },
912
+ "name": "meta.embedded.xml",
913
+ "patterns": [
914
+ {
915
+ "include": "#interpolation"
916
+ },
917
+ {
918
+ "include": "text.xml"
919
+ }
920
+ ]
921
+ },
922
+ {
923
+ "begin": "(<<<)\\s*(\"?)(SQL)(\\2)(\\s*)$",
924
+ "beginCaptures": {
925
+ "0": {
926
+ "name": "punctuation.section.embedded.begin.php"
927
+ },
928
+ "1": {
929
+ "name": "punctuation.definition.string.php"
930
+ },
931
+ "3": {
932
+ "name": "keyword.operator.heredoc.php"
933
+ },
934
+ "5": {
935
+ "name": "invalid.illegal.trailing-whitespace.php"
936
+ }
937
+ },
938
+ "contentName": "source.sql",
939
+ "end": "^(\\3)\\b",
940
+ "endCaptures": {
941
+ "0": {
942
+ "name": "punctuation.section.embedded.end.php"
943
+ },
944
+ "1": {
945
+ "name": "keyword.operator.heredoc.php"
946
+ }
947
+ },
948
+ "name": "meta.embedded.sql",
949
+ "patterns": [
950
+ {
951
+ "include": "#interpolation"
952
+ },
953
+ {
954
+ "include": "source.sql"
955
+ }
956
+ ]
957
+ },
958
+ {
959
+ "begin": "(<<<)\\s*(\"?)(JAVASCRIPT)(\\2)(\\s*)$",
960
+ "beginCaptures": {
961
+ "0": {
962
+ "name": "punctuation.section.embedded.begin.php"
963
+ },
964
+ "1": {
965
+ "name": "punctuation.definition.string.php"
966
+ },
967
+ "3": {
968
+ "name": "keyword.operator.heredoc.php"
969
+ },
970
+ "5": {
971
+ "name": "invalid.illegal.trailing-whitespace.php"
972
+ }
973
+ },
974
+ "contentName": "source.js",
975
+ "end": "^(\\3)\\b",
976
+ "endCaptures": {
977
+ "0": {
978
+ "name": "punctuation.section.embedded.end.php"
979
+ },
980
+ "1": {
981
+ "name": "keyword.operator.heredoc.php"
982
+ }
983
+ },
984
+ "name": "meta.embedded.js",
985
+ "patterns": [
986
+ {
987
+ "include": "#interpolation"
988
+ },
989
+ {
990
+ "include": "source.js"
991
+ }
992
+ ]
993
+ },
994
+ {
995
+ "begin": "(<<<)\\s*(\"?)(JSON)(\\2)(\\s*)$",
996
+ "beginCaptures": {
997
+ "0": {
998
+ "name": "punctuation.section.embedded.begin.php"
999
+ },
1000
+ "1": {
1001
+ "name": "punctuation.definition.string.php"
1002
+ },
1003
+ "3": {
1004
+ "name": "keyword.operator.heredoc.php"
1005
+ },
1006
+ "5": {
1007
+ "name": "invalid.illegal.trailing-whitespace.php"
1008
+ }
1009
+ },
1010
+ "contentName": "source.json",
1011
+ "end": "^(\\3)\\b",
1012
+ "endCaptures": {
1013
+ "0": {
1014
+ "name": "punctuation.section.embedded.end.php"
1015
+ },
1016
+ "1": {
1017
+ "name": "keyword.operator.heredoc.php"
1018
+ }
1019
+ },
1020
+ "name": "meta.embedded.json",
1021
+ "patterns": [
1022
+ {
1023
+ "include": "#interpolation"
1024
+ },
1025
+ {
1026
+ "include": "source.json"
1027
+ }
1028
+ ]
1029
+ },
1030
+ {
1031
+ "begin": "(<<<)\\s*(\"?)(CSS)(\\2)(\\s*)$",
1032
+ "beginCaptures": {
1033
+ "0": {
1034
+ "name": "punctuation.section.embedded.begin.php"
1035
+ },
1036
+ "1": {
1037
+ "name": "punctuation.definition.string.php"
1038
+ },
1039
+ "3": {
1040
+ "name": "keyword.operator.heredoc.php"
1041
+ },
1042
+ "5": {
1043
+ "name": "invalid.illegal.trailing-whitespace.php"
1044
+ }
1045
+ },
1046
+ "contentName": "source.css",
1047
+ "end": "^(\\3)\\b",
1048
+ "endCaptures": {
1049
+ "0": {
1050
+ "name": "punctuation.section.embedded.end.php"
1051
+ },
1052
+ "1": {
1053
+ "name": "keyword.operator.heredoc.php"
1054
+ }
1055
+ },
1056
+ "name": "meta.embedded.css",
1057
+ "patterns": [
1058
+ {
1059
+ "include": "#interpolation"
1060
+ },
1061
+ {
1062
+ "include": "source.css"
1063
+ }
1064
+ ]
1065
+ },
1066
+ {
1067
+ "begin": "(<<<)\\s*(\"?)(REGEXP?)(\\2)(\\s*)$",
1068
+ "beginCaptures": {
1069
+ "0": {
1070
+ "name": "punctuation.section.embedded.begin.php"
1071
+ },
1072
+ "1": {
1073
+ "name": "punctuation.definition.string.php"
1074
+ },
1075
+ "3": {
1076
+ "name": "keyword.operator.heredoc.php"
1077
+ },
1078
+ "5": {
1079
+ "name": "invalid.illegal.trailing-whitespace.php"
1080
+ }
1081
+ },
1082
+ "contentName": "string.regexp.heredoc.php",
1083
+ "end": "^(\\3)\\b",
1084
+ "endCaptures": {
1085
+ "0": {
1086
+ "name": "punctuation.section.embedded.end.php"
1087
+ },
1088
+ "1": {
1089
+ "name": "keyword.operator.heredoc.php"
1090
+ }
1091
+ },
1092
+ "patterns": [
1093
+ {
1094
+ "include": "#interpolation"
1095
+ },
1096
+ {
1097
+ "comment": "Escaped from the regexp – there can also be 2 backslashes (since 1 will escape the first)",
1098
+ "match": "(\\\\){1,2}[.$^\\[\\]{}]",
1099
+ "name": "constant.character.escape.regex.php"
1100
+ },
1101
+ {
1102
+ "captures": {
1103
+ "1": {
1104
+ "name": "punctuation.definition.arbitrary-repitition.php"
1105
+ },
1106
+ "3": {
1107
+ "name": "punctuation.definition.arbitrary-repitition.php"
1108
+ }
1109
+ },
1110
+ "match": "(\\{)\\d+(,\\d+)?(\\})",
1111
+ "name": "string.regexp.arbitrary-repitition.php"
1112
+ },
1113
+ {
1114
+ "begin": "\\[(?:\\^?\\])?",
1115
+ "captures": {
1116
+ "0": {
1117
+ "name": "punctuation.definition.character-class.php"
1118
+ }
1119
+ },
1120
+ "end": "\\]",
1121
+ "name": "string.regexp.character-class.php",
831
1122
  "patterns": [
832
1123
  {
833
- "include": "#interpolation"
1124
+ "match": "\\\\[\\\\'\\[\\]]",
1125
+ "name": "constant.character.escape.php"
834
1126
  }
835
1127
  ]
1128
+ },
1129
+ {
1130
+ "match": "[$^+*]",
1131
+ "name": "keyword.operator.regexp.php"
1132
+ },
1133
+ {
1134
+ "begin": "(?<=^|\\s)(#)\\s(?=[[a-zA-Z0-9,. \\t?!-][^\\x{00}-\\x{7F}]]*$)",
1135
+ "beginCaptures": {
1136
+ "1": {
1137
+ "name": "punctuation.definition.comment.php"
1138
+ }
1139
+ },
1140
+ "comment": "We are restrictive in what we allow to go after the comment character to avoid false positives, since the availability of comments depend on regexp flags.",
1141
+ "end": "$\\n?",
1142
+ "endCaptures": {
1143
+ "0": {
1144
+ "name": "punctuation.definition.comment.php"
1145
+ }
1146
+ },
1147
+ "name": "comment.line.number-sign.php"
1148
+ }
1149
+ ]
1150
+ },
1151
+ {
1152
+ "begin": "(<<<)\\s*(\"?)([a-zA-Z_]+[a-zA-Z0-9_]*)(\\2)(\\s*)",
1153
+ "beginCaptures": {
1154
+ "1": {
1155
+ "name": "punctuation.definition.string.php"
1156
+ },
1157
+ "3": {
1158
+ "name": "keyword.operator.heredoc.php"
1159
+ },
1160
+ "5": {
1161
+ "name": "invalid.illegal.trailing-whitespace.php"
1162
+ }
1163
+ },
1164
+ "end": "^(\\3)\\b",
1165
+ "endCaptures": {
1166
+ "1": {
1167
+ "name": "keyword.operator.heredoc.php"
1168
+ }
1169
+ },
1170
+ "patterns": [
1171
+ {
1172
+ "include": "#interpolation"
1173
+ }
1174
+ ]
1175
+ }
1176
+ ]
1177
+ },
1178
+ "nowdoc_interior": {
1179
+ "patterns": [
1180
+ {
1181
+ "begin": "(<<<)\\s*'(HTML)'(\\s*)$",
1182
+ "beginCaptures": {
1183
+ "0": {
1184
+ "name": "punctuation.section.embedded.begin.php"
1185
+ },
1186
+ "1": {
1187
+ "name": "punctuation.definition.string.php"
1188
+ },
1189
+ "2": {
1190
+ "name": "keyword.operator.nowdoc.php"
1191
+ },
1192
+ "3": {
1193
+ "name": "invalid.illegal.trailing-whitespace.php"
1194
+ }
1195
+ },
1196
+ "contentName": "text.html",
1197
+ "end": "^(\\2)\\b",
1198
+ "endCaptures": {
1199
+ "0": {
1200
+ "name": "punctuation.section.embedded.end.php"
1201
+ },
1202
+ "1": {
1203
+ "name": "keyword.operator.nowdoc.php"
1204
+ }
1205
+ },
1206
+ "name": "meta.embedded.html",
1207
+ "patterns": [
1208
+ {
1209
+ "include": "text.html.basic"
1210
+ }
1211
+ ]
1212
+ },
1213
+ {
1214
+ "begin": "(<<<)\\s*'(XML)'(\\s*)$",
1215
+ "beginCaptures": {
1216
+ "0": {
1217
+ "name": "punctuation.section.embedded.begin.php"
1218
+ },
1219
+ "1": {
1220
+ "name": "punctuation.definition.string.php"
1221
+ },
1222
+ "2": {
1223
+ "name": "keyword.operator.nowdoc.php"
1224
+ },
1225
+ "3": {
1226
+ "name": "invalid.illegal.trailing-whitespace.php"
1227
+ }
1228
+ },
1229
+ "contentName": "text.xml",
1230
+ "end": "^(\\2)\\b",
1231
+ "endCaptures": {
1232
+ "0": {
1233
+ "name": "punctuation.section.embedded.end.php"
1234
+ },
1235
+ "1": {
1236
+ "name": "keyword.operator.nowdoc.php"
1237
+ }
1238
+ },
1239
+ "name": "meta.embedded.xml",
1240
+ "patterns": [
1241
+ {
1242
+ "include": "text.xml"
1243
+ }
1244
+ ]
1245
+ },
1246
+ {
1247
+ "begin": "(<<<)\\s*'(SQL)'(\\s*)$",
1248
+ "beginCaptures": {
1249
+ "0": {
1250
+ "name": "punctuation.section.embedded.begin.php"
1251
+ },
1252
+ "1": {
1253
+ "name": "punctuation.definition.string.php"
1254
+ },
1255
+ "2": {
1256
+ "name": "keyword.operator.nowdoc.php"
1257
+ },
1258
+ "3": {
1259
+ "name": "invalid.illegal.trailing-whitespace.php"
1260
+ }
1261
+ },
1262
+ "contentName": "source.sql",
1263
+ "end": "^(\\2)\\b",
1264
+ "endCaptures": {
1265
+ "0": {
1266
+ "name": "punctuation.section.embedded.end.php"
1267
+ },
1268
+ "1": {
1269
+ "name": "keyword.operator.nowdoc.php"
1270
+ }
1271
+ },
1272
+ "name": "meta.embedded.sql",
1273
+ "patterns": [
1274
+ {
1275
+ "include": "source.sql"
1276
+ }
1277
+ ]
1278
+ },
1279
+ {
1280
+ "begin": "(<<<)\\s*'(JAVASCRIPT)'(\\s*)$",
1281
+ "beginCaptures": {
1282
+ "0": {
1283
+ "name": "punctuation.section.embedded.begin.php"
1284
+ },
1285
+ "1": {
1286
+ "name": "punctuation.definition.string.php"
1287
+ },
1288
+ "2": {
1289
+ "name": "keyword.operator.nowdoc.php"
1290
+ },
1291
+ "3": {
1292
+ "name": "invalid.illegal.trailing-whitespace.php"
836
1293
  }
837
1294
  },
838
- "name": "string.unquoted.heredoc.php",
1295
+ "contentName": "source.js",
1296
+ "end": "^(\\2)\\b",
1297
+ "endCaptures": {
1298
+ "0": {
1299
+ "name": "punctuation.section.embedded.end.php"
1300
+ },
1301
+ "1": {
1302
+ "name": "keyword.operator.nowdoc.php"
1303
+ }
1304
+ },
1305
+ "name": "meta.embedded.js",
839
1306
  "patterns": [
840
1307
  {
841
- "include": "#heredoc_interior"
1308
+ "include": "source.js"
842
1309
  }
843
1310
  ]
844
1311
  },
845
1312
  {
846
- "begin": "(?=<<<\\s*('?)([a-zA-Z_]+[a-zA-Z0-9_]*)(\\1)\\s*$)",
847
- "end": "(?!\\G)",
848
- "name": "string.unquoted.heredoc.nowdoc.php",
1313
+ "begin": "(<<<)\\s*'(JSON)'(\\s*)$",
1314
+ "beginCaptures": {
1315
+ "0": {
1316
+ "name": "punctuation.section.embedded.begin.php"
1317
+ },
1318
+ "1": {
1319
+ "name": "punctuation.definition.string.php"
1320
+ },
1321
+ "2": {
1322
+ "name": "keyword.operator.nowdoc.php"
1323
+ },
1324
+ "3": {
1325
+ "name": "invalid.illegal.trailing-whitespace.php"
1326
+ }
1327
+ },
1328
+ "contentName": "source.json",
1329
+ "end": "^(\\2)\\b",
1330
+ "endCaptures": {
1331
+ "0": {
1332
+ "name": "punctuation.section.embedded.end.php"
1333
+ },
1334
+ "1": {
1335
+ "name": "keyword.operator.nowdoc.php"
1336
+ }
1337
+ },
1338
+ "name": "meta.embedded.json",
849
1339
  "patterns": [
850
1340
  {
851
- "include": "#heredoc_interior"
1341
+ "include": "source.json"
852
1342
  }
853
1343
  ]
854
- }
855
- ],
856
- "repository": {
857
- "heredoc_interior": {
1344
+ },
1345
+ {
1346
+ "begin": "(<<<)\\s*'(CSS)'(\\s*)$",
1347
+ "beginCaptures": {
1348
+ "0": {
1349
+ "name": "punctuation.section.embedded.begin.php"
1350
+ },
1351
+ "1": {
1352
+ "name": "punctuation.definition.string.php"
1353
+ },
1354
+ "2": {
1355
+ "name": "keyword.operator.nowdoc.php"
1356
+ },
1357
+ "3": {
1358
+ "name": "invalid.illegal.trailing-whitespace.php"
1359
+ }
1360
+ },
1361
+ "contentName": "source.css",
1362
+ "end": "^(\\2)\\b",
1363
+ "endCaptures": {
1364
+ "0": {
1365
+ "name": "punctuation.section.embedded.end.php"
1366
+ },
1367
+ "1": {
1368
+ "name": "keyword.operator.nowdoc.php"
1369
+ }
1370
+ },
1371
+ "name": "meta.embedded.css",
858
1372
  "patterns": [
859
1373
  {
860
- "begin": "(<<<)\\s*(['\"]?)(HTML)(\\2)\\s*$\\n?",
861
- "beginCaptures": {
862
- "0": {
863
- "name": "punctuation.section.embedded.begin.php"
864
- },
865
- "1": {
866
- "name": "punctuation.definition.string.php"
867
- },
868
- "3": {
869
- "name": "keyword.operator.heredoc.php"
870
- }
871
- },
872
- "contentName": "text.html",
873
- "end": "^(\\3)\\b",
874
- "endCaptures": {
875
- "0": {
876
- "name": "punctuation.section.embedded.end.php"
877
- },
878
- "1": {
879
- "name": "keyword.operator.heredoc.php"
880
- }
881
- },
882
- "name": "meta.embedded.html",
883
- "patterns": [
884
- {
885
- "include": "text.html.basic"
886
- }
887
- ]
1374
+ "include": "source.css"
1375
+ }
1376
+ ]
1377
+ },
1378
+ {
1379
+ "begin": "(<<<)\\s*'(REGEXP?)'(\\s*)$",
1380
+ "beginCaptures": {
1381
+ "0": {
1382
+ "name": "punctuation.section.embedded.begin.php"
888
1383
  },
889
- {
890
- "begin": "(<<<)\\s*(['\"]?)(XML)(\\2)\\s*$\\n?",
891
- "beginCaptures": {
892
- "0": {
893
- "name": "punctuation.section.embedded.begin.php"
894
- },
895
- "1": {
896
- "name": "punctuation.definition.string.php"
897
- },
898
- "3": {
899
- "name": "keyword.operator.heredoc.php"
900
- }
901
- },
902
- "contentName": "text.xml",
903
- "end": "^(\\3)\\b",
904
- "endCaptures": {
905
- "0": {
906
- "name": "punctuation.section.embedded.end.php"
907
- },
908
- "1": {
909
- "name": "keyword.operator.heredoc.php"
910
- }
911
- },
912
- "name": "meta.embedded.xml",
913
- "patterns": [
914
- {
915
- "include": "text.xml"
916
- }
917
- ]
1384
+ "1": {
1385
+ "name": "punctuation.definition.string.php"
1386
+ },
1387
+ "2": {
1388
+ "name": "keyword.operator.nowdoc.php"
1389
+ },
1390
+ "3": {
1391
+ "name": "invalid.illegal.trailing-whitespace.php"
1392
+ }
1393
+ },
1394
+ "contentName": "string.regexp.nowdoc.php",
1395
+ "end": "^(\\2)\\b",
1396
+ "endCaptures": {
1397
+ "0": {
1398
+ "name": "punctuation.section.embedded.end.php"
918
1399
  },
1400
+ "1": {
1401
+ "name": "keyword.operator.nowdoc.php"
1402
+ }
1403
+ },
1404
+ "patterns": [
919
1405
  {
920
- "begin": "(<<<)\\s*(['\"]?)(SQL)(\\2)\\s*$\\n?",
921
- "beginCaptures": {
922
- "0": {
923
- "name": "punctuation.section.embedded.begin.php"
924
- },
925
- "1": {
926
- "name": "punctuation.definition.string.php"
927
- },
928
- "3": {
929
- "name": "keyword.operator.heredoc.php"
930
- }
931
- },
932
- "contentName": "source.sql",
933
- "end": "^(\\3)\\b",
934
- "endCaptures": {
935
- "0": {
936
- "name": "punctuation.section.embedded.end.php"
937
- },
938
- "1": {
939
- "name": "keyword.operator.heredoc.php"
940
- }
941
- },
942
- "name": "meta.embedded.sql",
943
- "patterns": [
944
- {
945
- "include": "source.sql"
946
- }
947
- ]
1406
+ "comment": "Escaped from the regexp – there can also be 2 backslashes (since 1 will escape the first)",
1407
+ "match": "(\\\\){1,2}[.$^\\[\\]{}]",
1408
+ "name": "constant.character.escape.regex.php"
948
1409
  },
949
1410
  {
950
- "begin": "(<<<)\\s*(['\"]?)(JAVASCRIPT)(\\2)\\s*$\\n?",
951
- "beginCaptures": {
952
- "0": {
953
- "name": "punctuation.section.embedded.begin.php"
954
- },
1411
+ "captures": {
955
1412
  "1": {
956
- "name": "punctuation.definition.string.php"
1413
+ "name": "punctuation.definition.arbitrary-repitition.php"
957
1414
  },
958
1415
  "3": {
959
- "name": "keyword.operator.heredoc.php"
960
- }
961
- },
962
- "contentName": "source.js",
963
- "end": "^(\\3)\\b",
964
- "endCaptures": {
965
- "0": {
966
- "name": "punctuation.section.embedded.end.php"
967
- },
968
- "1": {
969
- "name": "keyword.operator.heredoc.php"
1416
+ "name": "punctuation.definition.arbitrary-repitition.php"
970
1417
  }
971
1418
  },
972
- "name": "meta.embedded.js",
973
- "patterns": [
974
- {
975
- "include": "source.js"
976
- }
977
- ]
1419
+ "match": "(\\{)\\d+(,\\d+)?(\\})",
1420
+ "name": "string.regexp.arbitrary-repitition.php"
978
1421
  },
979
1422
  {
980
- "begin": "(<<<)\\s*(['\"]?)(JSON)(\\2)\\s*$\\n?",
981
- "beginCaptures": {
982
- "0": {
983
- "name": "punctuation.section.embedded.begin.php"
984
- },
985
- "1": {
986
- "name": "punctuation.definition.string.php"
987
- },
988
- "3": {
989
- "name": "keyword.operator.heredoc.php"
990
- }
991
- },
992
- "contentName": "source.json",
993
- "end": "^(\\3)\\b",
994
- "endCaptures": {
1423
+ "begin": "\\[(?:\\^?\\])?",
1424
+ "captures": {
995
1425
  "0": {
996
- "name": "punctuation.section.embedded.end.php"
997
- },
998
- "1": {
999
- "name": "keyword.operator.heredoc.php"
1426
+ "name": "punctuation.definition.character-class.php"
1000
1427
  }
1001
1428
  },
1002
- "name": "meta.embedded.json",
1429
+ "end": "\\]",
1430
+ "name": "string.regexp.character-class.php",
1003
1431
  "patterns": [
1004
1432
  {
1005
- "include": "source.json"
1433
+ "match": "\\\\[\\\\'\\[\\]]",
1434
+ "name": "constant.character.escape.php"
1006
1435
  }
1007
1436
  ]
1008
1437
  },
1009
1438
  {
1010
- "begin": "(<<<)\\s*(['\"]?)(CSS)(\\2)\\s*$\\n?",
1011
- "beginCaptures": {
1012
- "0": {
1013
- "name": "punctuation.section.embedded.begin.php"
1014
- },
1015
- "1": {
1016
- "name": "punctuation.definition.string.php"
1017
- },
1018
- "3": {
1019
- "name": "keyword.operator.heredoc.php"
1020
- }
1021
- },
1022
- "contentName": "source.css",
1023
- "end": "^(\\3)\\b",
1024
- "endCaptures": {
1025
- "0": {
1026
- "name": "punctuation.section.embedded.end.php"
1027
- },
1028
- "1": {
1029
- "name": "keyword.operator.heredoc.php"
1030
- }
1031
- },
1032
- "name": "meta.embedded.css",
1033
- "patterns": [
1034
- {
1035
- "include": "source.css"
1036
- }
1037
- ]
1439
+ "match": "[$^+*]",
1440
+ "name": "keyword.operator.regexp.php"
1038
1441
  },
1039
1442
  {
1040
- "begin": "(<<<)\\s*(['\"]?)(REGEX)(\\2)\\s*$\\n?",
1443
+ "begin": "(?<=^|\\s)(#)\\s(?=[[a-zA-Z0-9,. \\t?!-][^\\x{00}-\\x{7F}]]*$)",
1041
1444
  "beginCaptures": {
1042
- "0": {
1043
- "name": "punctuation.section.embedded.begin.php"
1044
- },
1045
1445
  "1": {
1046
- "name": "punctuation.definition.string.php"
1047
- },
1048
- "3": {
1049
- "name": "keyword.operator.heredoc.php"
1446
+ "name": "punctuation.definition.comment.php"
1050
1447
  }
1051
1448
  },
1052
- "contentName": "string.regexp.heredoc.php",
1053
- "end": "^(\\3)\\b",
1449
+ "comment": "We are restrictive in what we allow to go after the comment character to avoid false positives, since the availability of comments depend on regexp flags.",
1450
+ "end": "$\\n?",
1054
1451
  "endCaptures": {
1055
1452
  "0": {
1056
- "name": "punctuation.section.embedded.end.php"
1057
- },
1058
- "1": {
1059
- "name": "keyword.operator.heredoc.php"
1060
- }
1061
- },
1062
- "patterns": [
1063
- {
1064
- "comment": "Escaped from the regexp – there can also be 2 backslashes (since 1 will escape the first)",
1065
- "match": "(\\\\){1,2}[.$^\\[\\]{}]",
1066
- "name": "constant.character.escape.regex.php"
1067
- },
1068
- {
1069
- "captures": {
1070
- "1": {
1071
- "name": "punctuation.definition.arbitrary-repitition.php"
1072
- },
1073
- "3": {
1074
- "name": "punctuation.definition.arbitrary-repitition.php"
1075
- }
1076
- },
1077
- "match": "(\\{)\\d+(,\\d+)?(\\})",
1078
- "name": "string.regexp.arbitrary-repitition.php"
1079
- },
1080
- {
1081
- "begin": "\\[(?:\\^?\\])?",
1082
- "captures": {
1083
- "0": {
1084
- "name": "punctuation.definition.character-class.php"
1085
- }
1086
- },
1087
- "end": "\\]",
1088
- "name": "string.regexp.character-class.php",
1089
- "patterns": [
1090
- {
1091
- "match": "\\\\[\\\\'\\[\\]]",
1092
- "name": "constant.character.escape.php"
1093
- }
1094
- ]
1095
- },
1096
- {
1097
- "match": "[$^+*]",
1098
- "name": "keyword.operator.regexp.php"
1099
- },
1100
- {
1101
- "begin": "(?<=^|\\s)(#)\\s(?=[[a-zA-Z0-9,. \\t?!-][^\\x{00}-\\x{7F}]]*$)",
1102
- "beginCaptures": {
1103
- "1": {
1104
- "name": "punctuation.definition.comment.php"
1105
- }
1106
- },
1107
- "comment": "We are restrictive in what we allow to go after the comment character to avoid false positives, since the availability of comments depend on regexp flags.",
1108
- "end": "$\\n?",
1109
- "endCaptures": {
1110
- "0": {
1111
- "name": "punctuation.definition.comment.php"
1112
- }
1113
- },
1114
- "name": "comment.line.number-sign.php"
1115
- }
1116
- ]
1117
- },
1118
- {
1119
- "begin": "(<<<)\\s*(['\"]?)([a-zA-Z_]+[a-zA-Z0-9_]*)(\\2)",
1120
- "beginCaptures": {
1121
- "1": {
1122
- "name": "punctuation.definition.string.php"
1123
- },
1124
- "3": {
1125
- "name": "keyword.operator.heredoc.php"
1453
+ "name": "punctuation.definition.comment.php"
1126
1454
  }
1127
1455
  },
1128
- "end": "^(\\3)\\b",
1129
- "endCaptures": {
1130
- "1": {
1131
- "name": "keyword.operator.heredoc.php"
1132
- }
1133
- }
1456
+ "name": "comment.line.number-sign.php"
1134
1457
  }
1135
1458
  ]
1459
+ },
1460
+ {
1461
+ "begin": "(<<<)\\s*'([a-zA-Z_]+[a-zA-Z0-9_]*)'(\\s*)",
1462
+ "beginCaptures": {
1463
+ "1": {
1464
+ "name": "punctuation.definition.string.php"
1465
+ },
1466
+ "2": {
1467
+ "name": "keyword.operator.nowdoc.php"
1468
+ },
1469
+ "3": {
1470
+ "name": "invalid.illegal.trailing-whitespace.php"
1471
+ }
1472
+ },
1473
+ "end": "^(\\2)\\b",
1474
+ "endCaptures": {
1475
+ "1": {
1476
+ "name": "keyword.operator.nowdoc.php"
1477
+ }
1478
+ }
1136
1479
  }
1137
- }
1480
+ ]
1138
1481
  },
1139
1482
  "instantiation": {
1140
1483
  "begin": "(?i)(new)\\s+",