crates/highlight/syntaxes/ruby.json 72.3 KiB raw
1
{
2
  "displayName": "Ruby",
3
  "firstLineMatch": "^#!.*\\bruby[0-9.]*\\b",
4
  "name": "ruby",
5
  "patterns": [
6
    {
7
      "captures": {
8
        "1": {
9
          "name": "keyword.control.class.ruby"
10
        },
11
        "11": {
12
          "name": "punctuation.separator.namespace.ruby"
13
        },
14
        "2": {
15
          "name": "entity.name.type.class.ruby"
16
        },
17
        "5": {
18
          "name": "punctuation.separator.namespace.ruby"
19
        },
20
        "7": {
21
          "name": "punctuation.separator.inheritance.ruby"
22
        },
23
        "8": {
24
          "name": "entity.other.inherited-class.ruby"
25
        }
26
      },
27
      "match": "\\b(class)\\s+(([0-9A-Z_a-z]+)((::)[0-9A-Z_a-z]+)*)\\s*((<)\\s*(([0-9A-Z_a-z]+)((::)[0-9A-Z_a-z]+)*))?",
28
      "name": "meta.class.ruby"
29
    },
30
    {
31
      "captures": {
32
        "1": {
33
          "name": "keyword.control.module.ruby"
34
        },
35
        "2": {
36
          "name": "entity.name.type.module.ruby"
37
        },
38
        "5": {
39
          "name": "punctuation.separator.namespace.ruby"
40
        }
41
      },
42
      "match": "\\b(module)\\s+(([0-9A-Z_a-z]+)((::)[0-9A-Z_a-z]+)*)",
43
      "name": "meta.module.ruby"
44
    },
45
    {
46
      "captures": {
47
        "1": {
48
          "name": "keyword.control.class.ruby"
49
        },
50
        "2": {
51
          "name": "punctuation.separator.inheritance.ruby"
52
        }
53
      },
54
      "match": "\\b(class)\\s*(<<)\\s*",
55
      "name": "meta.class.ruby"
56
    },
57
    {
58
      "match": "(?<!\\.)\\belse(\\s)+if\\b",
59
      "name": "invalid.deprecated.ruby"
60
    },
61
    {
62
      "captures": {
63
        "1": {
64
          "name": "variable.ruby"
65
        },
66
        "2": {
67
          "name": "keyword.operator.assignment.augmented.ruby"
68
        }
69
      },
70
      "match": "^\\s*([_a-z][0-9A-Z_a-z]*)\\s*((&&|\\|\\|)=)"
71
    },
72
    {
73
      "captures": {
74
        "1": {
75
          "name": "keyword.control.ruby"
76
        },
77
        "3": {
78
          "name": "variable.ruby"
79
        },
80
        "4": {
81
          "name": "keyword.operator.assignment.augmented.ruby"
82
        }
83
      },
84
      "match": "(?<!\\.)\\b(case|if|elsif|unless|until|while)\\b\\s*(\\()*?\\s*([_a-z][0-9A-Z_a-z]*)\\s*((&&|\\|\\|)=)"
85
    },
86
    {
87
      "captures": {
88
        "1": {
89
          "name": "variable.ruby"
90
        },
91
        "2": {
92
          "name": "keyword.operator.assignment.augmented.ruby"
93
        }
94
      },
95
      "match": "^\\s*([_a-z][0-9A-Z_a-z]*)\\s*(([-%*+/]|\\*\\*|[\\&^|]|<<|>>)=)"
96
    },
97
    {
98
      "captures": {
99
        "1": {
100
          "name": "keyword.control.ruby"
101
        },
102
        "3": {
103
          "name": "variable.ruby"
104
        },
105
        "4": {
106
          "name": "keyword.operator.assignment.augmented.ruby"
107
        }
108
      },
109
      "match": "(?<!\\.)\\b(case|if|elsif|unless|until|while)\\b\\s*(\\()*?\\s*([_a-z][0-9A-Z_a-z]*)\\s*(([-%*+/]|\\*\\*|[\\&^|]|<<|>>)=)"
110
    },
111
    {
112
      "captures": {
113
        "1": {
114
          "name": "variable.ruby"
115
        }
116
      },
117
      "match": "^\\s*([_a-z][0-9A-Z_a-z]*)\\s*(?==[^=>])"
118
    },
119
    {
120
      "captures": {
121
        "1": {
122
          "name": "keyword.control.ruby"
123
        },
124
        "3": {
125
          "name": "variable.ruby"
126
        }
127
      },
128
      "match": "(?<!\\.)\\b(case|if|elsif|unless|until|while)\\b\\s*(\\()*?\\s*([_a-z][0-9A-Z_a-z]*)\\s*=[^=>]"
129
    },
130
    {
131
      "captures": {
132
        "1": {
133
          "name": "punctuation.definition.constant.hashkey.ruby"
134
        }
135
      },
136
      "match": "(?>[A-Z_a-z]\\w*[!?]?)(:)(?!:)",
137
      "name": "constant.language.symbol.hashkey.ruby"
138
    },
139
    {
140
      "captures": {
141
        "1": {
142
          "name": "punctuation.definition.constant.ruby"
143
        }
144
      },
145
      "match": "(?<!:)(:)(?>[A-Z_a-z]\\w*[!?]?)(?=\\s*=>)",
146
      "name": "constant.language.symbol.hashkey.ruby"
147
    },
148
    {
149
      "match": "(?<!\\.)\\b(BEGIN|begin|case|class|else|elsif|END|end|ensure|for|if|in|module|rescue|then|unless|until|when|while)\\b(?![!?])",
150
      "name": "keyword.control.ruby"
151
    },
152
    {
153
      "match": "(?<!\\.)\\bdo\\b",
154
      "name": "keyword.control.start-block.ruby"
155
    },
156
    {
157
      "match": "(?<=\\{)(\\s+)",
158
      "name": "meta.syntax.ruby.start-block"
159
    },
160
    {
161
      "match": "(?<!\\.)\\b(alias|alias_method|break|next|redo|retry|return|super|undef|yield)\\b(?![!?])|\\bdefined\\?|\\b(block_given|iterator)\\?",
162
      "name": "keyword.control.pseudo-method.ruby"
163
    },
164
    {
165
      "match": "\\bnil\\b(?![!?])",
166
      "name": "constant.language.nil.ruby"
167
    },
168
    {
169
      "match": "\\b(true|false)\\b(?![!?])",
170
      "name": "constant.language.boolean.ruby"
171
    },
172
    {
173
      "match": "\\b(__(FILE|LINE)__)\\b(?![!?])",
174
      "name": "variable.language.ruby"
175
    },
176
    {
177
      "match": "\\bself\\b(?![!?])",
178
      "name": "variable.language.self.ruby"
179
    },
180
    {
181
      "match": "\\b(initialize|new|loop|include|extend|prepend|raise|fail|attr_reader|attr_writer|attr_accessor|attr|catch|throw|private|private_class_method|module_function|public|public_class_method|protected|refine|using)\\b(?![!?])",
182
      "name": "keyword.other.special-method.ruby"
183
    },
184
    {
185
      "begin": "\\b(?<!\\.|::)(require(?:|_relative))\\b(?![!?])",
186
      "captures": {
187
        "1": {
188
          "name": "keyword.other.special-method.ruby"
189
        }
190
      },
191
      "end": "$|(?=[#}])",
192
      "name": "meta.require.ruby",
193
      "patterns": [
194
        {
195
          "include": "$self"
196
        }
197
      ]
198
    },
199
    {
200
      "captures": {
201
        "1": {
202
          "name": "punctuation.definition.variable.ruby"
203
        }
204
      },
205
      "match": "(@)[A-Z_a-z]\\w*",
206
      "name": "variable.other.readwrite.instance.ruby"
207
    },
208
    {
209
      "captures": {
210
        "1": {
211
          "name": "punctuation.definition.variable.ruby"
212
        }
213
      },
214
      "match": "(@@)[A-Z_a-z]\\w*",
215
      "name": "variable.other.readwrite.class.ruby"
216
    },
217
    {
218
      "captures": {
219
        "1": {
220
          "name": "punctuation.definition.variable.ruby"
221
        }
222
      },
223
      "match": "(\\$)[A-Z_a-z]\\w*",
224
      "name": "variable.other.readwrite.global.ruby"
225
    },
226
    {
227
      "captures": {
228
        "1": {
229
          "name": "punctuation.definition.variable.ruby"
230
        }
231
      },
232
      "match": "(\\$)([!\\&'+@`]|\\d+|[\"$*,./:-?\\\\_~]|-[0FIadilpv])",
233
      "name": "variable.other.readwrite.global.pre-defined.ruby"
234
    },
235
    {
236
      "begin": "\\b(ENV)\\[",
237
      "beginCaptures": {
238
        "1": {
239
          "name": "variable.other.constant.ruby"
240
        }
241
      },
242
      "end": "]",
243
      "name": "meta.environment-variable.ruby",
244
      "patterns": [
245
        {
246
          "include": "$self"
247
        }
248
      ]
249
    },
250
    {
251
      "match": "\\b[A-Z]\\w*(?=((\\.|::)[A-Za-z]|\\[))",
252
      "name": "support.class.ruby"
253
    },
254
    {
255
      "match": "\\b((abort|at_exit|autoload|binding|callcc|caller|caller_locations|chomp|chop|eval|exec|exit|fork|format|gets|global_variables|gsub|lambda|load|local_variables|open|p|printf??|proc|putc|puts|rand|readlines??|select|set_trace_func|sleep|spawn|sprintf|srand|sub|syscall|system|test|trace_var|trap|untrace_var|warn)\\b(?![!?])|autoload\\?|exit!)",
256
      "name": "support.function.kernel.ruby"
257
    },
258
    {
259
      "match": "\\b[A-Z_]\\w*\\b",
260
      "name": "variable.other.constant.ruby"
261
    },
262
    {
263
      "begin": "(->)\\(",
264
      "beginCaptures": {
265
        "1": {
266
          "name": "support.function.kernel.ruby"
267
        }
268
      },
269
      "end": "\\)",
270
      "patterns": [
271
        {
272
          "begin": "(?=[\\&*A-Z_a-z])",
273
          "end": "(?=[),])",
274
          "patterns": [
275
            {
276
              "include": "#method_parameters"
277
            }
278
          ]
279
        },
280
        {
281
          "include": "#method_parameters"
282
        }
283
      ]
284
    },
285
    {
286
      "begin": "(?=def\\b)(?<=^|\\s)(def)\\s+((?>[A-Z_a-z]\\w*(?>\\.|::))?(?>[A-Z_a-z]\\w*(?>[!?]|=(?!>))?|===?|!=|>[=>]?|<=>|<[<=]?|[%\\&/`|]|\\*\\*?|=?~|[-+]@?|\\[]=?))\\s*(\\()",
287
      "beginCaptures": {
288
        "1": {
289
          "name": "keyword.control.def.ruby"
290
        },
291
        "2": {
292
          "name": "entity.name.function.ruby"
293
        },
294
        "3": {
295
          "name": "punctuation.definition.parameters.ruby"
296
        }
297
      },
298
      "end": "\\)",
299
      "endCaptures": {
300
        "0": {
301
          "name": "punctuation.definition.parameters.ruby"
302
        }
303
      },
304
      "name": "meta.function.method.with-arguments.ruby",
305
      "patterns": [
306
        {
307
          "begin": "(?=[\\&*A-Z_a-z])",
308
          "end": "(?=[),])",
309
          "patterns": [
310
            {
311
              "include": "#method_parameters"
312
            }
313
          ]
314
        },
315
        {
316
          "include": "#method_parameters"
317
        }
318
      ]
319
    },
320
    {
321
      "begin": "(?=def\\b)(?<=^|\\s)(def)\\s+((?>[A-Z_a-z]\\w*(?>\\.|::))?(?>[A-Z_a-z]\\w*(?>[!?]|=(?!>))?|===?|!=|>[=>]?|<=>|<[<=]?|[%\\&/`|]|\\*\\*?|=?~|[-+]@?|\\[]=?))[\\t ](?=[\\t ]*[^#;\\s])",
322
      "beginCaptures": {
323
        "1": {
324
          "name": "keyword.control.def.ruby"
325
        },
326
        "2": {
327
          "name": "entity.name.function.ruby"
328
        }
329
      },
330
      "end": "(?=;)|(?<=[]!\"')?`}\\w])(?=\\s*#|\\s*$)",
331
      "name": "meta.function.method.with-arguments.ruby",
332
      "patterns": [
333
        {
334
          "begin": "(?=[\\&*A-Z_a-z])",
335
          "end": "(?=[,;]|\\s*#|\\s*$)",
336
          "patterns": [
337
            {
338
              "include": "#method_parameters"
339
            }
340
          ]
341
        },
342
        {
343
          "include": "#method_parameters"
344
        }
345
      ]
346
    },
347
    {
348
      "captures": {
349
        "1": {
350
          "name": "keyword.control.def.ruby"
351
        },
352
        "3": {
353
          "name": "entity.name.function.ruby"
354
        }
355
      },
356
      "match": "(?=def\\b)(?<=^|\\s)(def)\\b(\\s+((?>[A-Z_a-z]\\w*(?>\\.|::))?(?>[A-Z_a-z]\\w*(?>[!?]|=(?!>))?|===?|!=|>[=>]?|<=>|<[<=]?|[%\\&/`|]|\\*\\*?|=?~|[-+]@?|\\[]=?)))?",
357
      "name": "meta.function.method.without-arguments.ruby"
358
    },
359
    {
360
      "match": "\\b(\\d(?>_?\\d)*(\\.(?![^\\s\\d])(?>_?\\d)*)?([Ee][-+]?\\d(?>_?\\d)*)?|0(?:[Xx]\\h(?>_?\\h)*|[Oo]?[0-7](?>_?[0-7])*|[Bb][01](?>_?[01])*|[Dd]\\d(?>_?\\d)*))\\b",
361
      "name": "constant.numeric.ruby"
362
    },
363
    {
364
      "begin": ":'",
365
      "beginCaptures": {
366
        "0": {
367
          "name": "punctuation.definition.symbol.begin.ruby"
368
        }
369
      },
370
      "end": "'",
371
      "endCaptures": {
372
        "0": {
373
          "name": "punctuation.definition.symbol.end.ruby"
374
        }
375
      },
376
      "name": "constant.language.symbol.ruby",
377
      "patterns": [
378
        {
379
          "match": "\\\\['\\\\]",
380
          "name": "constant.character.escape.ruby"
381
        }
382
      ]
383
    },
384
    {
385
      "begin": ":\"",
386
      "beginCaptures": {
387
        "0": {
388
          "name": "punctuation.section.symbol.begin.ruby"
389
        }
390
      },
391
      "end": "\"",
392
      "endCaptures": {
393
        "0": {
394
          "name": "punctuation.section.symbol.end.ruby"
395
        }
396
      },
397
      "name": "constant.language.symbol.interpolated.ruby",
398
      "patterns": [
399
        {
400
          "include": "#interpolated_ruby"
401
        },
402
        {
403
          "include": "#escaped_char"
404
        }
405
      ]
406
    },
407
    {
408
      "match": "(?<!\\()/=",
409
      "name": "keyword.operator.assignment.augmented.ruby"
410
    },
411
    {
412
      "begin": "'",
413
      "beginCaptures": {
414
        "0": {
415
          "name": "punctuation.definition.string.begin.ruby"
416
        }
417
      },
418
      "end": "'",
419
      "endCaptures": {
420
        "0": {
421
          "name": "punctuation.definition.string.end.ruby"
422
        }
423
      },
424
      "name": "string.quoted.single.ruby",
425
      "patterns": [
426
        {
427
          "match": "\\\\['\\\\]",
428
          "name": "constant.character.escape.ruby"
429
        }
430
      ]
431
    },
432
    {
433
      "begin": "\"",
434
      "beginCaptures": {
435
        "0": {
436
          "name": "punctuation.definition.string.begin.ruby"
437
        }
438
      },
439
      "end": "\"",
440
      "endCaptures": {
441
        "0": {
442
          "name": "punctuation.definition.string.end.ruby"
443
        }
444
      },
445
      "name": "string.quoted.double.interpolated.ruby",
446
      "patterns": [
447
        {
448
          "include": "#interpolated_ruby"
449
        },
450
        {
451
          "include": "#escaped_char"
452
        }
453
      ]
454
    },
455
    {
456
      "begin": "(?<!\\.)`",
457
      "beginCaptures": {
458
        "0": {
459
          "name": "punctuation.definition.string.begin.ruby"
460
        }
461
      },
462
      "end": "`",
463
      "endCaptures": {
464
        "0": {
465
          "name": "punctuation.definition.string.end.ruby"
466
        }
467
      },
468
      "name": "string.interpolated.ruby",
469
      "patterns": [
470
        {
471
          "include": "#interpolated_ruby"
472
        },
473
        {
474
          "include": "#escaped_char"
475
        }
476
      ]
477
    },
478
    {
479
      "begin": "(?<![)\\w])((/))(?![*+?])(?!\\s*$)(?=(?:\\\\/|[^/])*+/[eimnosux]*\\s*(?:[]#),.:?}]|\\|\\||&&|<=>|=>|==|=~|!~|!=|;|$|if|else|elsif|then|do|end|unless|while|until|or|and))",
480
      "captures": {
481
        "1": {
482
          "name": "string.regexp.interpolated.ruby"
483
        },
484
        "2": {
485
          "name": "punctuation.section.regexp.ruby"
486
        }
487
      },
488
      "contentName": "string.regexp.interpolated.ruby",
489
      "end": "((/[eimnosux]*))",
490
      "patterns": [
491
        {
492
          "include": "#regex_sub"
493
        }
494
      ]
495
    },
496
    {
497
      "begin": "%r\\{",
498
      "beginCaptures": {
499
        "0": {
500
          "name": "punctuation.section.regexp.begin.ruby"
501
        }
502
      },
503
      "end": "}[eimnosux]*",
504
      "endCaptures": {
505
        "0": {
506
          "name": "punctuation.section.regexp.end.ruby"
507
        }
508
      },
509
      "name": "string.regexp.interpolated.ruby",
510
      "patterns": [
511
        {
512
          "include": "#regex_sub"
513
        },
514
        {
515
          "include": "#nest_curly_r"
516
        }
517
      ]
518
    },
519
    {
520
      "begin": "%r\\[",
521
      "beginCaptures": {
522
        "0": {
523
          "name": "punctuation.section.regexp.begin.ruby"
524
        }
525
      },
526
      "end": "][eimnosux]*",
527
      "endCaptures": {
528
        "0": {
529
          "name": "punctuation.section.regexp.end.ruby"
530
        }
531
      },
532
      "name": "string.regexp.interpolated.ruby",
533
      "patterns": [
534
        {
535
          "include": "#regex_sub"
536
        },
537
        {
538
          "include": "#nest_brackets_r"
539
        }
540
      ]
541
    },
542
    {
543
      "begin": "%r\\(",
544
      "beginCaptures": {
545
        "0": {
546
          "name": "punctuation.section.regexp.begin.ruby"
547
        }
548
      },
549
      "end": "\\)[eimnosux]*",
550
      "endCaptures": {
551
        "0": {
552
          "name": "punctuation.section.regexp.end.ruby"
553
        }
554
      },
555
      "name": "string.regexp.interpolated.ruby",
556
      "patterns": [
557
        {
558
          "include": "#regex_sub"
559
        },
560
        {
561
          "include": "#nest_parens_r"
562
        }
563
      ]
564
    },
565
    {
566
      "begin": "%r<",
567
      "beginCaptures": {
568
        "0": {
569
          "name": "punctuation.section.regexp.begin.ruby"
570
        }
571
      },
572
      "end": ">[eimnosux]*",
573
      "endCaptures": {
574
        "0": {
575
          "name": "punctuation.section.regexp.end.ruby"
576
        }
577
      },
578
      "name": "string.regexp.interpolated.ruby",
579
      "patterns": [
580
        {
581
          "include": "#regex_sub"
582
        },
583
        {
584
          "include": "#nest_ltgt_r"
585
        }
586
      ]
587
    },
588
    {
589
      "begin": "%r(\\W)",
590
      "beginCaptures": {
591
        "0": {
592
          "name": "punctuation.section.regexp.begin.ruby"
593
        }
594
      },
595
      "end": "\\1[eimnosux]*",
596
      "endCaptures": {
597
        "0": {
598
          "name": "punctuation.section.regexp.end.ruby"
599
        }
600
      },
601
      "name": "string.regexp.interpolated.ruby",
602
      "patterns": [
603
        {
604
          "include": "#regex_sub"
605
        }
606
      ]
607
    },
608
    {
609
      "begin": "%I\\[",
610
      "beginCaptures": {
611
        "0": {
612
          "name": "punctuation.section.array.begin.ruby"
613
        }
614
      },
615
      "end": "]",
616
      "endCaptures": {
617
        "0": {
618
          "name": "punctuation.section.array.end.ruby"
619
        }
620
      },
621
      "name": "constant.language.symbol.interpolated.ruby",
622
      "patterns": [
623
        {
624
          "include": "#interpolated_ruby"
625
        },
626
        {
627
          "include": "#escaped_char"
628
        },
629
        {
630
          "include": "#nest_brackets_i"
631
        }
632
      ]
633
    },
634
    {
635
      "begin": "%I\\(",
636
      "beginCaptures": {
637
        "0": {
638
          "name": "punctuation.section.array.begin.ruby"
639
        }
640
      },
641
      "end": "\\)",
642
      "endCaptures": {
643
        "0": {
644
          "name": "punctuation.section.array.end.ruby"
645
        }
646
      },
647
      "name": "constant.language.symbol.interpolated.ruby",
648
      "patterns": [
649
        {
650
          "include": "#interpolated_ruby"
651
        },
652
        {
653
          "include": "#escaped_char"
654
        },
655
        {
656
          "include": "#nest_parens_i"
657
        }
658
      ]
659
    },
660
    {
661
      "begin": "%I<",
662
      "beginCaptures": {
663
        "0": {
664
          "name": "punctuation.section.array.begin.ruby"
665
        }
666
      },
667
      "end": ">",
668
      "endCaptures": {
669
        "0": {
670
          "name": "punctuation.section.array.end.ruby"
671
        }
672
      },
673
      "name": "constant.language.symbol.interpolated.ruby",
674
      "patterns": [
675
        {
676
          "include": "#interpolated_ruby"
677
        },
678
        {
679
          "include": "#escaped_char"
680
        },
681
        {
682
          "include": "#nest_ltgt_i"
683
        }
684
      ]
685
    },
686
    {
687
      "begin": "%I\\{",
688
      "beginCaptures": {
689
        "0": {
690
          "name": "punctuation.section.array.begin.ruby"
691
        }
692
      },
693
      "end": "}",
694
      "endCaptures": {
695
        "0": {
696
          "name": "punctuation.section.array.end.ruby"
697
        }
698
      },
699
      "name": "constant.language.symbol.interpolated.ruby",
700
      "patterns": [
701
        {
702
          "include": "#interpolated_ruby"
703
        },
704
        {
705
          "include": "#escaped_char"
706
        },
707
        {
708
          "include": "#nest_curly_i"
709
        }
710
      ]
711
    },
712
    {
713
      "begin": "%I(\\W)",
714
      "beginCaptures": {
715
        "0": {
716
          "name": "punctuation.section.array.begin.ruby"
717
        }
718
      },
719
      "end": "\\1",
720
      "endCaptures": {
721
        "0": {
722
          "name": "punctuation.section.array.end.ruby"
723
        }
724
      },
725
      "name": "constant.language.symbol.interpolated.ruby",
726
      "patterns": [
727
        {
728
          "include": "#interpolated_ruby"
729
        },
730
        {
731
          "include": "#escaped_char"
732
        }
733
      ]
734
    },
735
    {
736
      "begin": "%i\\[",
737
      "beginCaptures": {
738
        "0": {
739
          "name": "punctuation.section.array.begin.ruby"
740
        }
741
      },
742
      "end": "]",
743
      "endCaptures": {
744
        "0": {
745
          "name": "punctuation.section.array.end.ruby"
746
        }
747
      },
748
      "name": "constant.language.symbol.ruby",
749
      "patterns": [
750
        {
751
          "match": "\\\\[]\\\\]",
752
          "name": "constant.character.escape.ruby"
753
        },
754
        {
755
          "include": "#nest_brackets"
756
        }
757
      ]
758
    },
759
    {
760
      "begin": "%i\\(",
761
      "beginCaptures": {
762
        "0": {
763
          "name": "punctuation.section.array.begin.ruby"
764
        }
765
      },
766
      "end": "\\)",
767
      "endCaptures": {
768
        "0": {
769
          "name": "punctuation.section.array.end.ruby"
770
        }
771
      },
772
      "name": "constant.language.symbol.ruby",
773
      "patterns": [
774
        {
775
          "match": "\\\\[)\\\\]",
776
          "name": "constant.character.escape.ruby"
777
        },
778
        {
779
          "include": "#nest_parens"
780
        }
781
      ]
782
    },
783
    {
784
      "begin": "%i<",
785
      "beginCaptures": {
786
        "0": {
787
          "name": "punctuation.section.array.begin.ruby"
788
        }
789
      },
790
      "end": ">",
791
      "endCaptures": {
792
        "0": {
793
          "name": "punctuation.section.array.end.ruby"
794
        }
795
      },
796
      "name": "constant.language.symbol.ruby",
797
      "patterns": [
798
        {
799
          "match": "\\\\[>\\\\]",
800
          "name": "constant.character.escape.ruby"
801
        },
802
        {
803
          "include": "#nest_ltgt"
804
        }
805
      ]
806
    },
807
    {
808
      "begin": "%i\\{",
809
      "beginCaptures": {
810
        "0": {
811
          "name": "punctuation.section.array.begin.ruby"
812
        }
813
      },
814
      "end": "}",
815
      "endCaptures": {
816
        "0": {
817
          "name": "punctuation.section.array.end.ruby"
818
        }
819
      },
820
      "name": "constant.language.symbol.ruby",
821
      "patterns": [
822
        {
823
          "match": "\\\\[\\\\}]",
824
          "name": "constant.character.escape.ruby"
825
        },
826
        {
827
          "include": "#nest_curly"
828
        }
829
      ]
830
    },
831
    {
832
      "begin": "%i(\\W)",
833
      "beginCaptures": {
834
        "0": {
835
          "name": "punctuation.section.array.begin.ruby"
836
        }
837
      },
838
      "end": "\\1",
839
      "endCaptures": {
840
        "0": {
841
          "name": "punctuation.section.array.end.ruby"
842
        }
843
      },
844
      "name": "constant.language.symbol.ruby",
845
      "patterns": [
846
        {
847
          "match": "\\\\."
848
        }
849
      ]
850
    },
851
    {
852
      "begin": "%W\\[",
853
      "beginCaptures": {
854
        "0": {
855
          "name": "punctuation.section.array.begin.ruby"
856
        }
857
      },
858
      "end": "]",
859
      "endCaptures": {
860
        "0": {
861
          "name": "punctuation.section.array.end.ruby"
862
        }
863
      },
864
      "name": "string.quoted.other.interpolated.ruby",
865
      "patterns": [
866
        {
867
          "include": "#interpolated_ruby"
868
        },
869
        {
870
          "include": "#escaped_char"
871
        },
872
        {
873
          "include": "#nest_brackets_i"
874
        }
875
      ]
876
    },
877
    {
878
      "begin": "%W\\(",
879
      "beginCaptures": {
880
        "0": {
881
          "name": "punctuation.section.array.begin.ruby"
882
        }
883
      },
884
      "end": "\\)",
885
      "endCaptures": {
886
        "0": {
887
          "name": "punctuation.section.array.end.ruby"
888
        }
889
      },
890
      "name": "string.quoted.other.interpolated.ruby",
891
      "patterns": [
892
        {
893
          "include": "#interpolated_ruby"
894
        },
895
        {
896
          "include": "#escaped_char"
897
        },
898
        {
899
          "include": "#nest_parens_i"
900
        }
901
      ]
902
    },
903
    {
904
      "begin": "%W<",
905
      "beginCaptures": {
906
        "0": {
907
          "name": "punctuation.section.array.begin.ruby"
908
        }
909
      },
910
      "end": ">",
911
      "endCaptures": {
912
        "0": {
913
          "name": "punctuation.section.array.end.ruby"
914
        }
915
      },
916
      "name": "string.quoted.other.interpolated.ruby",
917
      "patterns": [
918
        {
919
          "include": "#interpolated_ruby"
920
        },
921
        {
922
          "include": "#escaped_char"
923
        },
924
        {
925
          "include": "#nest_ltgt_i"
926
        }
927
      ]
928
    },
929
    {
930
      "begin": "%W\\{",
931
      "beginCaptures": {
932
        "0": {
933
          "name": "punctuation.section.array.begin.ruby"
934
        }
935
      },
936
      "end": "}",
937
      "endCaptures": {
938
        "0": {
939
          "name": "punctuation.section.array.end.ruby"
940
        }
941
      },
942
      "name": "string.quoted.other.interpolated.ruby",
943
      "patterns": [
944
        {
945
          "include": "#interpolated_ruby"
946
        },
947
        {
948
          "include": "#escaped_char"
949
        },
950
        {
951
          "include": "#nest_curly_i"
952
        }
953
      ]
954
    },
955
    {
956
      "begin": "%W(\\W)",
957
      "beginCaptures": {
958
        "0": {
959
          "name": "punctuation.section.array.begin.ruby"
960
        }
961
      },
962
      "end": "\\1",
963
      "endCaptures": {
964
        "0": {
965
          "name": "punctuation.section.array.end.ruby"
966
        }
967
      },
968
      "name": "string.quoted.other.interpolated.ruby",
969
      "patterns": [
970
        {
971
          "include": "#interpolated_ruby"
972
        },
973
        {
974
          "include": "#escaped_char"
975
        }
976
      ]
977
    },
978
    {
979
      "begin": "%w\\[",
980
      "beginCaptures": {
981
        "0": {
982
          "name": "punctuation.section.array.begin.ruby"
983
        }
984
      },
985
      "end": "]",
986
      "endCaptures": {
987
        "0": {
988
          "name": "punctuation.section.array.end.ruby"
989
        }
990
      },
991
      "name": "string.quoted.other.ruby",
992
      "patterns": [
993
        {
994
          "match": "\\\\[]\\\\]",
995
          "name": "constant.character.escape.ruby"
996
        },
997
        {
998
          "include": "#nest_brackets"
999
        }
1000
      ]
1001
    },
1002
    {
1003
      "begin": "%w\\(",
1004
      "beginCaptures": {
1005
        "0": {
1006
          "name": "punctuation.section.array.begin.ruby"
1007
        }
1008
      },
1009
      "end": "\\)",
1010
      "endCaptures": {
1011
        "0": {
1012
          "name": "punctuation.section.array.end.ruby"
1013
        }
1014
      },
1015
      "name": "string.quoted.other.ruby",
1016
      "patterns": [
1017
        {
1018
          "match": "\\\\[)\\\\]",
1019
          "name": "constant.character.escape.ruby"
1020
        },
1021
        {
1022
          "include": "#nest_parens"
1023
        }
1024
      ]
1025
    },
1026
    {
1027
      "begin": "%w<",
1028
      "beginCaptures": {
1029
        "0": {
1030
          "name": "punctuation.section.array.begin.ruby"
1031
        }
1032
      },
1033
      "end": ">",
1034
      "endCaptures": {
1035
        "0": {
1036
          "name": "punctuation.section.array.end.ruby"
1037
        }
1038
      },
1039
      "name": "string.quoted.other.ruby",
1040
      "patterns": [
1041
        {
1042
          "match": "\\\\[>\\\\]",
1043
          "name": "constant.character.escape.ruby"
1044
        },
1045
        {
1046
          "include": "#nest_ltgt"
1047
        }
1048
      ]
1049
    },
1050
    {
1051
      "begin": "%w\\{",
1052
      "beginCaptures": {
1053
        "0": {
1054
          "name": "punctuation.section.array.begin.ruby"
1055
        }
1056
      },
1057
      "end": "}",
1058
      "endCaptures": {
1059
        "0": {
1060
          "name": "punctuation.section.array.end.ruby"
1061
        }
1062
      },
1063
      "name": "string.quoted.other.ruby",
1064
      "patterns": [
1065
        {
1066
          "match": "\\\\[\\\\}]",
1067
          "name": "constant.character.escape.ruby"
1068
        },
1069
        {
1070
          "include": "#nest_curly"
1071
        }
1072
      ]
1073
    },
1074
    {
1075
      "begin": "%w(\\W)",
1076
      "beginCaptures": {
1077
        "0": {
1078
          "name": "punctuation.section.array.begin.ruby"
1079
        }
1080
      },
1081
      "end": "\\1",
1082
      "endCaptures": {
1083
        "0": {
1084
          "name": "punctuation.section.array.end.ruby"
1085
        }
1086
      },
1087
      "name": "string.quoted.other.ruby",
1088
      "patterns": [
1089
        {
1090
          "match": "\\\\."
1091
        }
1092
      ]
1093
    },
1094
    {
1095
      "begin": "%[Qx]?\\(",
1096
      "beginCaptures": {
1097
        "0": {
1098
          "name": "punctuation.definition.string.begin.ruby"
1099
        }
1100
      },
1101
      "end": "\\)",
1102
      "endCaptures": {
1103
        "0": {
1104
          "name": "punctuation.definition.string.end.ruby"
1105
        }
1106
      },
1107
      "name": "string.quoted.other.interpolated.ruby",
1108
      "patterns": [
1109
        {
1110
          "include": "#interpolated_ruby"
1111
        },
1112
        {
1113
          "include": "#escaped_char"
1114
        },
1115
        {
1116
          "include": "#nest_parens_i"
1117
        }
1118
      ]
1119
    },
1120
    {
1121
      "begin": "%[Qx]?\\[",
1122
      "beginCaptures": {
1123
        "0": {
1124
          "name": "punctuation.definition.string.begin.ruby"
1125
        }
1126
      },
1127
      "end": "]",
1128
      "endCaptures": {
1129
        "0": {
1130
          "name": "punctuation.definition.string.end.ruby"
1131
        }
1132
      },
1133
      "name": "string.quoted.other.interpolated.ruby",
1134
      "patterns": [
1135
        {
1136
          "include": "#interpolated_ruby"
1137
        },
1138
        {
1139
          "include": "#escaped_char"
1140
        },
1141
        {
1142
          "include": "#nest_brackets_i"
1143
        }
1144
      ]
1145
    },
1146
    {
1147
      "begin": "%[Qx]?\\{",
1148
      "beginCaptures": {
1149
        "0": {
1150
          "name": "punctuation.definition.string.begin.ruby"
1151
        }
1152
      },
1153
      "end": "}",
1154
      "endCaptures": {
1155
        "0": {
1156
          "name": "punctuation.definition.string.end.ruby"
1157
        }
1158
      },
1159
      "name": "string.quoted.other.interpolated.ruby",
1160
      "patterns": [
1161
        {
1162
          "include": "#interpolated_ruby"
1163
        },
1164
        {
1165
          "include": "#escaped_char"
1166
        },
1167
        {
1168
          "include": "#nest_curly_i"
1169
        }
1170
      ]
1171
    },
1172
    {
1173
      "begin": "%[Qx]?<",
1174
      "beginCaptures": {
1175
        "0": {
1176
          "name": "punctuation.definition.string.begin.ruby"
1177
        }
1178
      },
1179
      "end": ">",
1180
      "endCaptures": {
1181
        "0": {
1182
          "name": "punctuation.definition.string.end.ruby"
1183
        }
1184
      },
1185
      "name": "string.quoted.other.interpolated.ruby",
1186
      "patterns": [
1187
        {
1188
          "include": "#interpolated_ruby"
1189
        },
1190
        {
1191
          "include": "#escaped_char"
1192
        },
1193
        {
1194
          "include": "#nest_ltgt_i"
1195
        }
1196
      ]
1197
    },
1198
    {
1199
      "begin": "%[Qx](\\W)",
1200
      "beginCaptures": {
1201
        "0": {
1202
          "name": "punctuation.definition.string.begin.ruby"
1203
        }
1204
      },
1205
      "end": "\\1",
1206
      "endCaptures": {
1207
        "0": {
1208
          "name": "punctuation.definition.string.end.ruby"
1209
        }
1210
      },
1211
      "name": "string.quoted.other.interpolated.ruby",
1212
      "patterns": [
1213
        {
1214
          "include": "#interpolated_ruby"
1215
        },
1216
        {
1217
          "include": "#escaped_char"
1218
        }
1219
      ]
1220
    },
1221
    {
1222
      "begin": "%([^=\\w\\s])",
1223
      "beginCaptures": {
1224
        "0": {
1225
          "name": "punctuation.definition.string.begin.ruby"
1226
        }
1227
      },
1228
      "end": "\\1",
1229
      "endCaptures": {
1230
        "0": {
1231
          "name": "punctuation.definition.string.end.ruby"
1232
        }
1233
      },
1234
      "name": "string.quoted.other.interpolated.ruby",
1235
      "patterns": [
1236
        {
1237
          "include": "#interpolated_ruby"
1238
        },
1239
        {
1240
          "include": "#escaped_char"
1241
        }
1242
      ]
1243
    },
1244
    {
1245
      "begin": "%q\\(",
1246
      "beginCaptures": {
1247
        "0": {
1248
          "name": "punctuation.definition.string.begin.ruby"
1249
        }
1250
      },
1251
      "end": "\\)",
1252
      "endCaptures": {
1253
        "0": {
1254
          "name": "punctuation.definition.string.end.ruby"
1255
        }
1256
      },
1257
      "name": "string.quoted.other.ruby",
1258
      "patterns": [
1259
        {
1260
          "match": "\\\\[)\\\\]",
1261
          "name": "constant.character.escape.ruby"
1262
        },
1263
        {
1264
          "include": "#nest_parens"
1265
        }
1266
      ]
1267
    },
1268
    {
1269
      "begin": "%q<",
1270
      "beginCaptures": {
1271
        "0": {
1272
          "name": "punctuation.definition.string.begin.ruby"
1273
        }
1274
      },
1275
      "end": ">",
1276
      "endCaptures": {
1277
        "0": {
1278
          "name": "punctuation.definition.string.end.ruby"
1279
        }
1280
      },
1281
      "name": "string.quoted.other.ruby",
1282
      "patterns": [
1283
        {
1284
          "match": "\\\\[>\\\\]",
1285
          "name": "constant.character.escape.ruby"
1286
        },
1287
        {
1288
          "include": "#nest_ltgt"
1289
        }
1290
      ]
1291
    },
1292
    {
1293
      "begin": "%q\\[",
1294
      "beginCaptures": {
1295
        "0": {
1296
          "name": "punctuation.definition.string.begin.ruby"
1297
        }
1298
      },
1299
      "end": "]",
1300
      "endCaptures": {
1301
        "0": {
1302
          "name": "punctuation.definition.string.end.ruby"
1303
        }
1304
      },
1305
      "name": "string.quoted.other.ruby",
1306
      "patterns": [
1307
        {
1308
          "match": "\\\\[]\\\\]",
1309
          "name": "constant.character.escape.ruby"
1310
        },
1311
        {
1312
          "include": "#nest_brackets"
1313
        }
1314
      ]
1315
    },
1316
    {
1317
      "begin": "%q\\{",
1318
      "beginCaptures": {
1319
        "0": {
1320
          "name": "punctuation.definition.string.begin.ruby"
1321
        }
1322
      },
1323
      "end": "}",
1324
      "endCaptures": {
1325
        "0": {
1326
          "name": "punctuation.definition.string.end.ruby"
1327
        }
1328
      },
1329
      "name": "string.quoted.other.ruby",
1330
      "patterns": [
1331
        {
1332
          "match": "\\\\[\\\\}]",
1333
          "name": "constant.character.escape.ruby"
1334
        },
1335
        {
1336
          "include": "#nest_curly"
1337
        }
1338
      ]
1339
    },
1340
    {
1341
      "begin": "%q(\\W)",
1342
      "beginCaptures": {
1343
        "0": {
1344
          "name": "punctuation.definition.string.begin.ruby"
1345
        }
1346
      },
1347
      "end": "\\1",
1348
      "endCaptures": {
1349
        "0": {
1350
          "name": "punctuation.definition.string.end.ruby"
1351
        }
1352
      },
1353
      "name": "string.quoted.other.ruby",
1354
      "patterns": [
1355
        {
1356
          "match": "\\\\."
1357
        }
1358
      ]
1359
    },
1360
    {
1361
      "begin": "%s\\(",
1362
      "beginCaptures": {
1363
        "0": {
1364
          "name": "punctuation.definition.symbol.begin.ruby"
1365
        }
1366
      },
1367
      "end": "\\)",
1368
      "endCaptures": {
1369
        "0": {
1370
          "name": "punctuation.definition.symbol.end.ruby"
1371
        }
1372
      },
1373
      "name": "constant.language.symbol.ruby",
1374
      "patterns": [
1375
        {
1376
          "match": "\\\\[)\\\\]",
1377
          "name": "constant.character.escape.ruby"
1378
        },
1379
        {
1380
          "include": "#nest_parens"
1381
        }
1382
      ]
1383
    },
1384
    {
1385
      "begin": "%s<",
1386
      "beginCaptures": {
1387
        "0": {
1388
          "name": "punctuation.definition.symbol.begin.ruby"
1389
        }
1390
      },
1391
      "end": ">",
1392
      "endCaptures": {
1393
        "0": {
1394
          "name": "punctuation.definition.symbol.end.ruby"
1395
        }
1396
      },
1397
      "name": "constant.language.symbol.ruby",
1398
      "patterns": [
1399
        {
1400
          "match": "\\\\[>\\\\]",
1401
          "name": "constant.character.escape.ruby"
1402
        },
1403
        {
1404
          "include": "#nest_ltgt"
1405
        }
1406
      ]
1407
    },
1408
    {
1409
      "begin": "%s\\[",
1410
      "beginCaptures": {
1411
        "0": {
1412
          "name": "punctuation.definition.symbol.begin.ruby"
1413
        }
1414
      },
1415
      "end": "]",
1416
      "endCaptures": {
1417
        "0": {
1418
          "name": "punctuation.definition.symbol.end.ruby"
1419
        }
1420
      },
1421
      "name": "constant.language.symbol.ruby",
1422
      "patterns": [
1423
        {
1424
          "match": "\\\\[]\\\\]",
1425
          "name": "constant.character.escape.ruby"
1426
        },
1427
        {
1428
          "include": "#nest_brackets"
1429
        }
1430
      ]
1431
    },
1432
    {
1433
      "begin": "%s\\{",
1434
      "beginCaptures": {
1435
        "0": {
1436
          "name": "punctuation.definition.symbol.begin.ruby"
1437
        }
1438
      },
1439
      "end": "}",
1440
      "endCaptures": {
1441
        "0": {
1442
          "name": "punctuation.definition.symbol.end.ruby"
1443
        }
1444
      },
1445
      "name": "constant.language.symbol.ruby",
1446
      "patterns": [
1447
        {
1448
          "match": "\\\\[\\\\}]",
1449
          "name": "constant.character.escape.ruby"
1450
        },
1451
        {
1452
          "include": "#nest_curly"
1453
        }
1454
      ]
1455
    },
1456
    {
1457
      "begin": "%s(\\W)",
1458
      "beginCaptures": {
1459
        "0": {
1460
          "name": "punctuation.definition.symbol.begin.ruby"
1461
        }
1462
      },
1463
      "end": "\\1",
1464
      "endCaptures": {
1465
        "0": {
1466
          "name": "punctuation.definition.symbol.end.ruby"
1467
        }
1468
      },
1469
      "name": "constant.language.symbol.ruby",
1470
      "patterns": [
1471
        {
1472
          "match": "\\\\."
1473
        }
1474
      ]
1475
    },
1476
    {
1477
      "captures": {
1478
        "1": {
1479
          "name": "punctuation.definition.constant.ruby"
1480
        }
1481
      },
1482
      "match": "(?<!:)(:)(?>[$A-Z_a-z]\\w*(?>[!?]|=(?![=>]))?|===?|<=>|>[=>]?|<[<=]?|[%\\&/`|]|\\*\\*?|=?~|[-+]@?|\\[]=?|@@?[A-Z_a-z]\\w*)",
1483
      "name": "constant.language.symbol.ruby"
1484
    },
1485
    {
1486
      "begin": "^=begin",
1487
      "captures": {
1488
        "0": {
1489
          "name": "punctuation.definition.comment.ruby"
1490
        }
1491
      },
1492
      "end": "^=end",
1493
      "name": "comment.block.documentation.ruby"
1494
    },
1495
    {
1496
      "include": "#yard"
1497
    },
1498
    {
1499
      "begin": "(^[\\t ]+)?(?=#)",
1500
      "beginCaptures": {
1501
        "1": {
1502
          "name": "punctuation.whitespace.comment.leading.ruby"
1503
        }
1504
      },
1505
      "end": "(?!\\G)",
1506
      "patterns": [
1507
        {
1508
          "begin": "#",
1509
          "beginCaptures": {
1510
            "0": {
1511
              "name": "punctuation.definition.comment.ruby"
1512
            }
1513
          },
1514
          "end": "\\n",
1515
          "name": "comment.line.number-sign.ruby"
1516
        }
1517
      ]
1518
    },
1519
    {
1520
      "match": "(?<!\\w)\\?(\\\\(x\\h{1,2}(?!\\h)\\b|0[0-7]{0,2}(?![0-7])\\b|[^0CMx])|(\\\\[CM]-)+\\w|[^\\\\\\s])",
1521
      "name": "constant.numeric.ruby"
1522
    },
1523
    {
1524
      "begin": "^__END__\\n",
1525
      "captures": {
1526
        "0": {
1527
          "name": "string.unquoted.program-block.ruby"
1528
        }
1529
      },
1530
      "contentName": "text.plain",
1531
      "end": "(?=not)impossible",
1532
      "patterns": [
1533
        {
1534
          "begin": "(?=<?xml|<(?i:html\\b)|!DOCTYPE (?i:html\\b))",
1535
          "end": "(?=not)impossible",
1536
          "name": "text.html.embedded.ruby",
1537
          "patterns": [
1538
            {
1539
              "include": "text.html.basic"
1540
            }
1541
          ]
1542
        }
1543
      ]
1544
    },
1545
    {
1546
      "begin": "(?=(?><<[-~]?([\"'`]?)((?:[_\\w]+_|)HTML)\\b\\1))",
1547
      "end": "^\\s*((?:[_\\w]+_|)HTML)$\\n?",
1548
      "endCaptures": {
1549
        "0": {
1550
          "name": "string.definition.end.ruby"
1551
        }
1552
      },
1553
      "name": "meta.embedded.block.html",
1554
      "patterns": [
1555
        {
1556
          "begin": "(?><<[-~]?([\"'`]?)((?:[_\\w]+_|)HTML)\\b\\1)",
1557
          "beginCaptures": {
1558
            "0": {
1559
              "name": "string.definition.begin.ruby"
1560
            }
1561
          },
1562
          "contentName": "text.html",
1563
          "patterns": [
1564
            {
1565
              "include": "#heredoc"
1566
            },
1567
            {
1568
              "include": "#interpolated_ruby"
1569
            },
1570
            {
1571
              "include": "text.html.basic"
1572
            },
1573
            {
1574
              "include": "#escaped_char"
1575
            }
1576
          ],
1577
          "while": "^(?!\\s*((?:[_\\w]+_|)HTML)\\s*$)"
1578
        }
1579
      ]
1580
    },
1581
    {
1582
      "begin": "(?=(?><<[-~]?([\"'`]?)((?:[_\\w]+_|)HAML)\\b\\1))",
1583
      "end": "^\\s*((?:[_\\w]+_|)HAML)$\\n?",
1584
      "endCaptures": {
1585
        "0": {
1586
          "name": "string.definition.end.ruby"
1587
        }
1588
      },
1589
      "name": "meta.embedded.block.haml",
1590
      "patterns": [
1591
        {
1592
          "begin": "(?><<[-~]?([\"'`]?)((?:[_\\w]+_|)HAML)\\b\\1)",
1593
          "beginCaptures": {
1594
            "0": {
1595
              "name": "string.definition.begin.ruby"
1596
            }
1597
          },
1598
          "contentName": "text.haml",
1599
          "patterns": [
1600
            {
1601
              "include": "#heredoc"
1602
            },
1603
            {
1604
              "include": "#interpolated_ruby"
1605
            },
1606
            {
1607
              "include": "text.haml"
1608
            },
1609
            {
1610
              "include": "#escaped_char"
1611
            }
1612
          ],
1613
          "while": "^(?!\\s*((?:[_\\w]+_|)HAML)\\s*$)"
1614
        }
1615
      ]
1616
    },
1617
    {
1618
      "begin": "(?=(?><<[-~]?([\"'`]?)((?:[_\\w]+_|)XML)\\b\\1))",
1619
      "end": "^\\s*((?:[_\\w]+_|)XML)$\\n?",
1620
      "endCaptures": {
1621
        "0": {
1622
          "name": "string.definition.end.ruby"
1623
        }
1624
      },
1625
      "name": "meta.embedded.block.xml",
1626
      "patterns": [
1627
        {
1628
          "begin": "(?><<[-~]?([\"'`]?)((?:[_\\w]+_|)XML)\\b\\1)",
1629
          "beginCaptures": {
1630
            "0": {
1631
              "name": "string.definition.begin.ruby"
1632
            }
1633
          },
1634
          "contentName": "text.xml",
1635
          "patterns": [
1636
            {
1637
              "include": "#heredoc"
1638
            },
1639
            {
1640
              "include": "#interpolated_ruby"
1641
            },
1642
            {
1643
              "include": "text.xml"
1644
            },
1645
            {
1646
              "include": "#escaped_char"
1647
            }
1648
          ],
1649
          "while": "^(?!\\s*((?:[_\\w]+_|)XML)\\s*$)"
1650
        }
1651
      ]
1652
    },
1653
    {
1654
      "begin": "(?=(?><<[-~]?([\"'`]?)((?:[_\\w]+_|)SQL)\\b\\1))",
1655
      "end": "^\\s*((?:[_\\w]+_|)SQL)$\\n?",
1656
      "endCaptures": {
1657
        "0": {
1658
          "name": "string.definition.end.ruby"
1659
        }
1660
      },
1661
      "name": "meta.embedded.block.sql",
1662
      "patterns": [
1663
        {
1664
          "begin": "(?><<[-~]?([\"'`]?)((?:[_\\w]+_|)SQL)\\b\\1)",
1665
          "beginCaptures": {
1666
            "0": {
1667
              "name": "string.definition.begin.ruby"
1668
            }
1669
          },
1670
          "contentName": "source.sql",
1671
          "patterns": [
1672
            {
1673
              "include": "#heredoc"
1674
            },
1675
            {
1676
              "include": "#interpolated_ruby"
1677
            },
1678
            {
1679
              "include": "source.sql"
1680
            },
1681
            {
1682
              "include": "#escaped_char"
1683
            }
1684
          ],
1685
          "while": "^(?!\\s*((?:[_\\w]+_|)SQL)\\s*$)"
1686
        }
1687
      ]
1688
    },
1689
    {
1690
      "begin": "(?=(?><<[-~]?([\"'`]?)((?:[_\\w]+_|)G(?:RAPHQL|QL))\\b\\1))",
1691
      "end": "^\\s*((?:[_\\w]+_|)G(?:RAPHQL|QL))$\\n?",
1692
      "endCaptures": {
1693
        "0": {
1694
          "name": "string.definition.end.ruby"
1695
        }
1696
      },
1697
      "name": "meta.embedded.block.graphql",
1698
      "patterns": [
1699
        {
1700
          "begin": "(?><<[-~]?([\"'`]?)((?:[_\\w]+_|)G(?:RAPHQL|QL))\\b\\1)",
1701
          "beginCaptures": {
1702
            "0": {
1703
              "name": "string.definition.begin.ruby"
1704
            }
1705
          },
1706
          "contentName": "source.graphql",
1707
          "patterns": [
1708
            {
1709
              "include": "#heredoc"
1710
            },
1711
            {
1712
              "include": "#interpolated_ruby"
1713
            },
1714
            {
1715
              "include": "source.graphql"
1716
            },
1717
            {
1718
              "include": "#escaped_char"
1719
            }
1720
          ],
1721
          "while": "^(?!\\s*((?:[_\\w]+_|)G(?:RAPHQL|QL))\\s*$)"
1722
        }
1723
      ]
1724
    },
1725
    {
1726
      "begin": "(?=(?><<[-~]?([\"'`]?)((?:[_\\w]+_|)CSS)\\b\\1))",
1727
      "end": "^\\s*((?:[_\\w]+_|)CSS)$\\n?",
1728
      "endCaptures": {
1729
        "0": {
1730
          "name": "string.definition.end.ruby"
1731
        }
1732
      },
1733
      "name": "meta.embedded.block.css",
1734
      "patterns": [
1735
        {
1736
          "begin": "(?><<[-~]?([\"'`]?)((?:[_\\w]+_|)CSS)\\b\\1)",
1737
          "beginCaptures": {
1738
            "0": {
1739
              "name": "string.definition.begin.ruby"
1740
            }
1741
          },
1742
          "contentName": "source.css",
1743
          "patterns": [
1744
            {
1745
              "include": "#heredoc"
1746
            },
1747
            {
1748
              "include": "#interpolated_ruby"
1749
            },
1750
            {
1751
              "include": "source.css"
1752
            },
1753
            {
1754
              "include": "#escaped_char"
1755
            }
1756
          ],
1757
          "while": "^(?!\\s*((?:[_\\w]+_|)CSS)\\s*$)"
1758
        }
1759
      ]
1760
    },
1761
    {
1762
      "begin": "(?=(?><<[-~]?([\"'`]?)((?:[_\\w]+_|)CPP)\\b\\1))",
1763
      "end": "^\\s*((?:[_\\w]+_|)CPP)$\\n?",
1764
      "endCaptures": {
1765
        "0": {
1766
          "name": "string.definition.end.ruby"
1767
        }
1768
      },
1769
      "name": "meta.embedded.block.cpp",
1770
      "patterns": [
1771
        {
1772
          "begin": "(?><<[-~]?([\"'`]?)((?:[_\\w]+_|)CPP)\\b\\1)",
1773
          "beginCaptures": {
1774
            "0": {
1775
              "name": "string.definition.begin.ruby"
1776
            }
1777
          },
1778
          "contentName": "source.cpp",
1779
          "patterns": [
1780
            {
1781
              "include": "#heredoc"
1782
            },
1783
            {
1784
              "include": "#interpolated_ruby"
1785
            },
1786
            {
1787
              "include": "source.cpp"
1788
            },
1789
            {
1790
              "include": "#escaped_char"
1791
            }
1792
          ],
1793
          "while": "^(?!\\s*((?:[_\\w]+_|)CPP)\\s*$)"
1794
        }
1795
      ]
1796
    },
1797
    {
1798
      "begin": "(?=(?><<[-~]?([\"'`]?)((?:[_\\w]+_|)C)\\b\\1))",
1799
      "end": "^\\s*((?:[_\\w]+_|)C)$\\n?",
1800
      "endCaptures": {
1801
        "0": {
1802
          "name": "string.definition.end.ruby"
1803
        }
1804
      },
1805
      "name": "meta.embedded.block.c",
1806
      "patterns": [
1807
        {
1808
          "begin": "(?><<[-~]?([\"'`]?)((?:[_\\w]+_|)C)\\b\\1)",
1809
          "beginCaptures": {
1810
            "0": {
1811
              "name": "string.definition.begin.ruby"
1812
            }
1813
          },
1814
          "contentName": "source.c",
1815
          "patterns": [
1816
            {
1817
              "include": "#heredoc"
1818
            },
1819
            {
1820
              "include": "#interpolated_ruby"
1821
            },
1822
            {
1823
              "include": "source.c"
1824
            },
1825
            {
1826
              "include": "#escaped_char"
1827
            }
1828
          ],
1829
          "while": "^(?!\\s*((?:[_\\w]+_|)C)\\s*$)"
1830
        }
1831
      ]
1832
    },
1833
    {
1834
      "begin": "(?=(?><<[-~]?([\"'`]?)((?:[_\\w]+_|)J(?:S|AVASCRIPT))\\b\\1))",
1835
      "end": "^\\s*((?:[_\\w]+_|)J(?:S|AVASCRIPT))$\\n?",
1836
      "endCaptures": {
1837
        "0": {
1838
          "name": "string.definition.end.ruby"
1839
        }
1840
      },
1841
      "name": "meta.embedded.block.js",
1842
      "patterns": [
1843
        {
1844
          "begin": "(?><<[-~]?([\"'`]?)((?:[_\\w]+_|)J(?:S|AVASCRIPT))\\b\\1)",
1845
          "beginCaptures": {
1846
            "0": {
1847
              "name": "string.definition.begin.ruby"
1848
            }
1849
          },
1850
          "contentName": "source.js",
1851
          "patterns": [
1852
            {
1853
              "include": "#heredoc"
1854
            },
1855
            {
1856
              "include": "#interpolated_ruby"
1857
            },
1858
            {
1859
              "include": "source.js"
1860
            },
1861
            {
1862
              "include": "#escaped_char"
1863
            }
1864
          ],
1865
          "while": "^(?!\\s*((?:[_\\w]+_|)J(?:S|AVASCRIPT))\\s*$)"
1866
        }
1867
      ]
1868
    },
1869
    {
1870
      "begin": "(?=(?><<[-~]?([\"'`]?)((?:[_\\w]+_|)JQUERY)\\b\\1))",
1871
      "end": "^\\s*((?:[_\\w]+_|)JQUERY)$\\n?",
1872
      "endCaptures": {
1873
        "0": {
1874
          "name": "string.definition.end.ruby"
1875
        }
1876
      },
1877
      "name": "meta.embedded.block.js.jquery",
1878
      "patterns": [
1879
        {
1880
          "begin": "(?><<[-~]?([\"'`]?)((?:[_\\w]+_|)JQUERY)\\b\\1)",
1881
          "beginCaptures": {
1882
            "0": {
1883
              "name": "string.definition.begin.ruby"
1884
            }
1885
          },
1886
          "contentName": "source.js.jquery",
1887
          "patterns": [
1888
            {
1889
              "include": "#heredoc"
1890
            },
1891
            {
1892
              "include": "#interpolated_ruby"
1893
            },
1894
            {
1895
              "include": "source.js.jquery"
1896
            },
1897
            {
1898
              "include": "#escaped_char"
1899
            }
1900
          ],
1901
          "while": "^(?!\\s*((?:[_\\w]+_|)JQUERY)\\s*$)"
1902
        }
1903
      ]
1904
    },
1905
    {
1906
      "begin": "(?=(?><<[-~]?([\"'`]?)((?:[_\\w]+_|)SH(?:|ELL))\\b\\1))",
1907
      "end": "^\\s*((?:[_\\w]+_|)SH(?:|ELL))$\\n?",
1908
      "endCaptures": {
1909
        "0": {
1910
          "name": "string.definition.end.ruby"
1911
        }
1912
      },
1913
      "name": "meta.embedded.block.shell",
1914
      "patterns": [
1915
        {
1916
          "begin": "(?><<[-~]?([\"'`]?)((?:[_\\w]+_|)SH(?:|ELL))\\b\\1)",
1917
          "beginCaptures": {
1918
            "0": {
1919
              "name": "string.definition.begin.ruby"
1920
            }
1921
          },
1922
          "contentName": "source.shell",
1923
          "patterns": [
1924
            {
1925
              "include": "#heredoc"
1926
            },
1927
            {
1928
              "include": "#interpolated_ruby"
1929
            },
1930
            {
1931
              "include": "source.shell"
1932
            },
1933
            {
1934
              "include": "#escaped_char"
1935
            }
1936
          ],
1937
          "while": "^(?!\\s*((?:[_\\w]+_|)SH(?:|ELL))\\s*$)"
1938
        }
1939
      ]
1940
    },
1941
    {
1942
      "begin": "(?=(?><<[-~]?([\"'`]?)((?:[_\\w]+_|)LUA)\\b\\1))",
1943
      "end": "^\\s*((?:[_\\w]+_|)LUA)$\\n?",
1944
      "endCaptures": {
1945
        "0": {
1946
          "name": "string.definition.end.ruby"
1947
        }
1948
      },
1949
      "name": "meta.embedded.block.lua",
1950
      "patterns": [
1951
        {
1952
          "begin": "(?><<[-~]?([\"'`]?)((?:[_\\w]+_|)LUA)\\b\\1)",
1953
          "beginCaptures": {
1954
            "0": {
1955
              "name": "string.definition.begin.ruby"
1956
            }
1957
          },
1958
          "contentName": "source.lua",
1959
          "patterns": [
1960
            {
1961
              "include": "#heredoc"
1962
            },
1963
            {
1964
              "include": "#interpolated_ruby"
1965
            },
1966
            {
1967
              "include": "source.lua"
1968
            },
1969
            {
1970
              "include": "#escaped_char"
1971
            }
1972
          ],
1973
          "while": "^(?!\\s*((?:[_\\w]+_|)LUA)\\s*$)"
1974
        }
1975
      ]
1976
    },
1977
    {
1978
      "begin": "(?=(?><<[-~]?([\"'`]?)((?:[_\\w]+_|)RUBY)\\b\\1))",
1979
      "end": "^\\s*((?:[_\\w]+_|)RUBY)$\\n?",
1980
      "endCaptures": {
1981
        "0": {
1982
          "name": "string.definition.end.ruby"
1983
        }
1984
      },
1985
      "name": "meta.embedded.block.ruby",
1986
      "patterns": [
1987
        {
1988
          "begin": "(?><<[-~]?([\"'`]?)((?:[_\\w]+_|)RUBY)\\b\\1)",
1989
          "beginCaptures": {
1990
            "0": {
1991
              "name": "string.definition.begin.ruby"
1992
            }
1993
          },
1994
          "contentName": "source.ruby",
1995
          "patterns": [
1996
            {
1997
              "include": "#heredoc"
1998
            },
1999
            {
2000
              "include": "#interpolated_ruby"
2001
            },
2002
            {
2003
              "include": "source.ruby"
2004
            },
2005
            {
2006
              "include": "#escaped_char"
2007
            }
2008
          ],
2009
          "while": "^(?!\\s*((?:[_\\w]+_|)RUBY)\\s*$)"
2010
        }
2011
      ]
2012
    },
2013
    {
2014
      "begin": "(?=(?><<[-~]?([\"'`]?)((?:[_\\w]+_|)YA?ML)\\b\\1))",
2015
      "end": "^\\s*((?:[_\\w]+_|)YA?ML)$\\n?",
2016
      "endCaptures": {
2017
        "0": {
2018
          "name": "string.definition.end.ruby"
2019
        }
2020
      },
2021
      "name": "meta.embedded.block.yaml",
2022
      "patterns": [
2023
        {
2024
          "begin": "(?><<[-~]?([\"'`]?)((?:[_\\w]+_|)YA?ML)\\b\\1)",
2025
          "beginCaptures": {
2026
            "0": {
2027
              "name": "string.definition.begin.ruby"
2028
            }
2029
          },
2030
          "contentName": "source.yaml",
2031
          "patterns": [
2032
            {
2033
              "include": "#heredoc"
2034
            },
2035
            {
2036
              "include": "#interpolated_ruby"
2037
            },
2038
            {
2039
              "include": "source.yaml"
2040
            },
2041
            {
2042
              "include": "#escaped_char"
2043
            }
2044
          ],
2045
          "while": "^(?!\\s*((?:[_\\w]+_|)YA?ML)\\s*$)"
2046
        }
2047
      ]
2048
    },
2049
    {
2050
      "begin": "(?=(?><<[-~]?([\"'`]?)((?:[_\\w]+_|)SLIM)\\b\\1))",
2051
      "end": "^\\s*((?:[_\\w]+_|)SLIM)$\\n?",
2052
      "endCaptures": {
2053
        "0": {
2054
          "name": "string.definition.end.ruby"
2055
        }
2056
      },
2057
      "name": "meta.embedded.block.slim",
2058
      "patterns": [
2059
        {
2060
          "begin": "(?><<[-~]?([\"'`]?)((?:[_\\w]+_|)SLIM)\\b\\1)",
2061
          "beginCaptures": {
2062
            "0": {
2063
              "name": "string.definition.begin.ruby"
2064
            }
2065
          },
2066
          "contentName": "text.slim",
2067
          "patterns": [
2068
            {
2069
              "include": "#heredoc"
2070
            },
2071
            {
2072
              "include": "#interpolated_ruby"
2073
            },
2074
            {
2075
              "include": "text.slim"
2076
            },
2077
            {
2078
              "include": "#escaped_char"
2079
            }
2080
          ],
2081
          "while": "^(?!\\s*((?:[_\\w]+_|)SLIM)\\s*$)"
2082
        }
2083
      ]
2084
    },
2085
    {
2086
      "begin": "(?>=\\s*<<([\"'`]?)(\\w+)\\1)",
2087
      "beginCaptures": {
2088
        "0": {
2089
          "name": "string.definition.begin.ruby"
2090
        }
2091
      },
2092
      "contentName": "string.unquoted.heredoc.ruby",
2093
      "end": "^\\2$",
2094
      "endCaptures": {
2095
        "0": {
2096
          "name": "string.definition.end.ruby"
2097
        }
2098
      },
2099
      "patterns": [
2100
        {
2101
          "include": "#heredoc"
2102
        },
2103
        {
2104
          "include": "#interpolated_ruby"
2105
        },
2106
        {
2107
          "include": "#escaped_char"
2108
        }
2109
      ]
2110
    },
2111
    {
2112
      "begin": "(?>((<<[-~]?([\"'`]?)(\\w+)\\3,\\s?)*<<[-~]?([\"'`]?)(\\w+)\\5))(.*)",
2113
      "beginCaptures": {
2114
        "1": {
2115
          "name": "string.definition.begin.ruby"
2116
        },
2117
        "7": {
2118
          "patterns": [
2119
            {
2120
              "include": "source.ruby"
2121
            }
2122
          ]
2123
        }
2124
      },
2125
      "contentName": "string.unquoted.heredoc.ruby",
2126
      "end": "^\\s*\\6$",
2127
      "endCaptures": {
2128
        "0": {
2129
          "name": "string.definition.end.ruby"
2130
        }
2131
      },
2132
      "patterns": [
2133
        {
2134
          "include": "#heredoc"
2135
        },
2136
        {
2137
          "include": "#interpolated_ruby"
2138
        },
2139
        {
2140
          "include": "#escaped_char"
2141
        }
2142
      ]
2143
    },
2144
    {
2145
      "begin": "(?<=\\{|\\{\\s+|[^$0-:@-Z_a-z]do|^do|[^$0-:@-Z_a-z]do\\s+|^do\\s+)(\\|)",
2146
      "captures": {
2147
        "1": {
2148
          "name": "punctuation.separator.variable.ruby"
2149
        }
2150
      },
2151
      "end": "(?<!\\|)(\\|)(?!\\|)",
2152
      "name": "meta.block.parameters.ruby",
2153
      "patterns": [
2154
        {
2155
          "begin": "(?![(,|\\s])",
2156
          "end": "(?=,|\\|\\s*)",
2157
          "patterns": [
2158
            {
2159
              "captures": {
2160
                "1": {
2161
                  "name": "storage.type.variable.ruby"
2162
                },
2163
                "2": {
2164
                  "name": "variable.other.block.ruby"
2165
                }
2166
              },
2167
              "match": "\\G((?:&|\\*\\*?)?)([A-Z_a-z][_\\w]*)"
2168
            }
2169
          ]
2170
        },
2171
        {
2172
          "match": ",",
2173
          "name": "punctuation.separator.variable.ruby"
2174
        }
2175
      ]
2176
    },
2177
    {
2178
      "match": "=>",
2179
      "name": "punctuation.separator.key-value"
2180
    },
2181
    {
2182
      "match": "->",
2183
      "name": "support.function.kernel.ruby"
2184
    },
2185
    {
2186
      "match": "<<=|%=|&{1,2}=|\\*=|\\*\\*=|\\+=|-=|\\^=|\\|{1,2}=|<<",
2187
      "name": "keyword.operator.assignment.augmented.ruby"
2188
    },
2189
    {
2190
      "match": "<=>|<(?![<=])|>(?![<=>])|<=|>=|===?|=~|!=|!~|(?<=[\\t ])\\?",
2191
      "name": "keyword.operator.comparison.ruby"
2192
    },
2193
    {
2194
      "match": "(?<!\\.)\\b(and|not|or)\\b(?![!?])",
2195
      "name": "keyword.operator.logical.ruby"
2196
    },
2197
    {
2198
      "match": "(?<=^|[\\t !])!|&&|\\|\\||\\^",
2199
      "name": "keyword.operator.logical.ruby"
2200
    },
2201
    {
2202
      "captures": {
2203
        "1": {
2204
          "name": "keyword.operator.logical.ruby"
2205
        }
2206
      },
2207
      "match": "(&\\.)\\s*(?![A-Z])"
2208
    },
2209
    {
2210
      "match": "([%\\&]|\\*\\*|[-*+/])",
2211
      "name": "keyword.operator.arithmetic.ruby"
2212
    },
2213
    {
2214
      "match": "=",
2215
      "name": "keyword.operator.assignment.ruby"
2216
    },
2217
    {
2218
      "match": "[|~]|>>",
2219
      "name": "keyword.operator.other.ruby"
2220
    },
2221
    {
2222
      "match": ";",
2223
      "name": "punctuation.separator.statement.ruby"
2224
    },
2225
    {
2226
      "match": ",",
2227
      "name": "punctuation.separator.object.ruby"
2228
    },
2229
    {
2230
      "captures": {
2231
        "1": {
2232
          "name": "punctuation.separator.namespace.ruby"
2233
        }
2234
      },
2235
      "match": "(::)\\s*(?=[A-Z])"
2236
    },
2237
    {
2238
      "captures": {
2239
        "1": {
2240
          "name": "punctuation.separator.method.ruby"
2241
        }
2242
      },
2243
      "match": "(\\.|::)\\s*(?![A-Z])"
2244
    },
2245
    {
2246
      "match": ":",
2247
      "name": "punctuation.separator.other.ruby"
2248
    },
2249
    {
2250
      "match": "\\{",
2251
      "name": "punctuation.section.scope.begin.ruby"
2252
    },
2253
    {
2254
      "match": "}",
2255
      "name": "punctuation.section.scope.end.ruby"
2256
    },
2257
    {
2258
      "match": "\\[",
2259
      "name": "punctuation.section.array.begin.ruby"
2260
    },
2261
    {
2262
      "match": "]",
2263
      "name": "punctuation.section.array.end.ruby"
2264
    },
2265
    {
2266
      "match": "[()]",
2267
      "name": "punctuation.section.function.ruby"
2268
    },
2269
    {
2270
      "begin": "(?<=[^.]\\.|::)(?=[A-Za-z][!0-9?A-Z_a-z]*[^!0-9?A-Z_a-z])",
2271
      "end": "(?<=[!0-9?A-Z_a-z])(?=[^!0-9?A-Z_a-z])",
2272
      "name": "meta.function-call.ruby",
2273
      "patterns": [
2274
        {
2275
          "match": "([A-Za-z][!0-9?A-Z_a-z]*)(?=[^!0-9?A-Z_a-z])",
2276
          "name": "entity.name.function.ruby"
2277
        }
2278
      ]
2279
    },
2280
    {
2281
      "begin": "([A-Za-z]\\w*[!?]?)(\\()",
2282
      "beginCaptures": {
2283
        "1": {
2284
          "name": "entity.name.function.ruby"
2285
        },
2286
        "2": {
2287
          "name": "punctuation.section.function.ruby"
2288
        }
2289
      },
2290
      "end": "(\\))",
2291
      "endCaptures": {
2292
        "1": {
2293
          "name": "punctuation.section.function.ruby"
2294
        }
2295
      },
2296
      "name": "meta.function-call.ruby",
2297
      "patterns": [
2298
        {
2299
          "include": "$self"
2300
        }
2301
      ]
2302
    }
2303
  ],
2304
  "repository": {
2305
    "escaped_char": {
2306
      "match": "\\\\(?:[0-7]{1,3}|x[A-Fa-f\\d]{1,2}|.)",
2307
      "name": "constant.character.escape.ruby"
2308
    },
2309
    "heredoc": {
2310
      "begin": "^<<[-~]?\\w+",
2311
      "end": "$",
2312
      "patterns": [
2313
        {
2314
          "include": "$self"
2315
        }
2316
      ]
2317
    },
2318
    "interpolated_ruby": {
2319
      "patterns": [
2320
        {
2321
          "begin": "#\\{",
2322
          "beginCaptures": {
2323
            "0": {
2324
              "name": "punctuation.section.embedded.begin.ruby"
2325
            }
2326
          },
2327
          "contentName": "source.ruby",
2328
          "end": "}",
2329
          "endCaptures": {
2330
            "0": {
2331
              "name": "punctuation.section.embedded.end.ruby"
2332
            }
2333
          },
2334
          "name": "meta.embedded.line.ruby",
2335
          "patterns": [
2336
            {
2337
              "include": "#nest_curly_and_self"
2338
            },
2339
            {
2340
              "include": "$self"
2341
            }
2342
          ]
2343
        },
2344
        {
2345
          "captures": {
2346
            "1": {
2347
              "name": "punctuation.definition.variable.ruby"
2348
            }
2349
          },
2350
          "match": "(#@)[A-Z_a-z]\\w*",
2351
          "name": "variable.other.readwrite.instance.ruby"
2352
        },
2353
        {
2354
          "captures": {
2355
            "1": {
2356
              "name": "punctuation.definition.variable.ruby"
2357
            }
2358
          },
2359
          "match": "(#@@)[A-Z_a-z]\\w*",
2360
          "name": "variable.other.readwrite.class.ruby"
2361
        },
2362
        {
2363
          "captures": {
2364
            "1": {
2365
              "name": "punctuation.definition.variable.ruby"
2366
            }
2367
          },
2368
          "match": "(#\\$)[A-Z_a-z]\\w*",
2369
          "name": "variable.other.readwrite.global.ruby"
2370
        }
2371
      ]
2372
    },
2373
    "method_parameters": {
2374
      "patterns": [
2375
        {
2376
          "include": "#parens"
2377
        },
2378
        {
2379
          "include": "#braces"
2380
        },
2381
        {
2382
          "include": "#brackets"
2383
        },
2384
        {
2385
          "include": "#params"
2386
        },
2387
        {
2388
          "include": "$self"
2389
        }
2390
      ],
2391
      "repository": {
2392
        "braces": {
2393
          "begin": "\\{",
2394
          "beginCaptures": {
2395
            "0": {
2396
              "name": "punctuation.section.scope.begin.ruby"
2397
            }
2398
          },
2399
          "end": "}",
2400
          "endCaptures": {
2401
            "0": {
2402
              "name": "punctuation.section.scope.end.ruby"
2403
            }
2404
          },
2405
          "patterns": [
2406
            {
2407
              "include": "#parens"
2408
            },
2409
            {
2410
              "include": "#braces"
2411
            },
2412
            {
2413
              "include": "#brackets"
2414
            },
2415
            {
2416
              "include": "$self"
2417
            }
2418
          ]
2419
        },
2420
        "brackets": {
2421
          "begin": "\\[",
2422
          "beginCaptures": {
2423
            "0": {
2424
              "name": "punctuation.section.array.begin.ruby"
2425
            }
2426
          },
2427
          "end": "]",
2428
          "endCaptures": {
2429
            "0": {
2430
              "name": "punctuation.section.array.end.ruby"
2431
            }
2432
          },
2433
          "patterns": [
2434
            {
2435
              "include": "#parens"
2436
            },
2437
            {
2438
              "include": "#braces"
2439
            },
2440
            {
2441
              "include": "#brackets"
2442
            },
2443
            {
2444
              "include": "$self"
2445
            }
2446
          ]
2447
        },
2448
        "params": {
2449
          "captures": {
2450
            "1": {
2451
              "name": "storage.type.variable.ruby"
2452
            },
2453
            "2": {
2454
              "name": "constant.other.symbol.hashkey.parameter.function.ruby"
2455
            },
2456
            "3": {
2457
              "name": "punctuation.definition.constant.ruby"
2458
            },
2459
            "4": {
2460
              "name": "variable.parameter.function.ruby"
2461
            }
2462
          },
2463
          "match": "\\G(&|\\*\\*?)?(?:([A-Z_a-z]\\w*[!?]?(:))|([A-Z_a-z]\\w*))"
2464
        },
2465
        "parens": {
2466
          "begin": "\\(",
2467
          "beginCaptures": {
2468
            "0": {
2469
              "name": "punctuation.section.function.begin.ruby"
2470
            }
2471
          },
2472
          "end": "\\)",
2473
          "endCaptures": {
2474
            "0": {
2475
              "name": "punctuation.section.function.end.ruby"
2476
            }
2477
          },
2478
          "patterns": [
2479
            {
2480
              "include": "#parens"
2481
            },
2482
            {
2483
              "include": "#braces"
2484
            },
2485
            {
2486
              "include": "#brackets"
2487
            },
2488
            {
2489
              "include": "$self"
2490
            }
2491
          ]
2492
        }
2493
      }
2494
    },
2495
    "nest_brackets": {
2496
      "begin": "\\[",
2497
      "captures": {
2498
        "0": {
2499
          "name": "punctuation.section.scope.ruby"
2500
        }
2501
      },
2502
      "end": "]",
2503
      "patterns": [
2504
        {
2505
          "include": "#nest_brackets"
2506
        }
2507
      ]
2508
    },
2509
    "nest_brackets_i": {
2510
      "begin": "\\[",
2511
      "captures": {
2512
        "0": {
2513
          "name": "punctuation.section.scope.ruby"
2514
        }
2515
      },
2516
      "end": "]",
2517
      "patterns": [
2518
        {
2519
          "include": "#interpolated_ruby"
2520
        },
2521
        {
2522
          "include": "#escaped_char"
2523
        },
2524
        {
2525
          "include": "#nest_brackets_i"
2526
        }
2527
      ]
2528
    },
2529
    "nest_brackets_r": {
2530
      "begin": "\\[",
2531
      "captures": {
2532
        "0": {
2533
          "name": "punctuation.section.scope.ruby"
2534
        }
2535
      },
2536
      "end": "]",
2537
      "patterns": [
2538
        {
2539
          "include": "#regex_sub"
2540
        },
2541
        {
2542
          "include": "#nest_brackets_r"
2543
        }
2544
      ]
2545
    },
2546
    "nest_curly": {
2547
      "begin": "\\{",
2548
      "captures": {
2549
        "0": {
2550
          "name": "punctuation.section.scope.ruby"
2551
        }
2552
      },
2553
      "end": "}",
2554
      "patterns": [
2555
        {
2556
          "include": "#nest_curly"
2557
        }
2558
      ]
2559
    },
2560
    "nest_curly_and_self": {
2561
      "patterns": [
2562
        {
2563
          "begin": "\\{",
2564
          "captures": {
2565
            "0": {
2566
              "name": "punctuation.section.scope.ruby"
2567
            }
2568
          },
2569
          "end": "}",
2570
          "patterns": [
2571
            {
2572
              "include": "#nest_curly_and_self"
2573
            }
2574
          ]
2575
        },
2576
        {
2577
          "include": "$self"
2578
        }
2579
      ]
2580
    },
2581
    "nest_curly_i": {
2582
      "begin": "\\{",
2583
      "captures": {
2584
        "0": {
2585
          "name": "punctuation.section.scope.ruby"
2586
        }
2587
      },
2588
      "end": "}",
2589
      "patterns": [
2590
        {
2591
          "include": "#interpolated_ruby"
2592
        },
2593
        {
2594
          "include": "#escaped_char"
2595
        },
2596
        {
2597
          "include": "#nest_curly_i"
2598
        }
2599
      ]
2600
    },
2601
    "nest_curly_r": {
2602
      "begin": "\\{",
2603
      "captures": {
2604
        "0": {
2605
          "name": "punctuation.section.scope.ruby"
2606
        }
2607
      },
2608
      "end": "}",
2609
      "patterns": [
2610
        {
2611
          "include": "#regex_sub"
2612
        },
2613
        {
2614
          "include": "#nest_curly_r"
2615
        }
2616
      ]
2617
    },
2618
    "nest_ltgt": {
2619
      "begin": "<",
2620
      "captures": {
2621
        "0": {
2622
          "name": "punctuation.section.scope.ruby"
2623
        }
2624
      },
2625
      "end": ">",
2626
      "patterns": [
2627
        {
2628
          "include": "#nest_ltgt"
2629
        }
2630
      ]
2631
    },
2632
    "nest_ltgt_i": {
2633
      "begin": "<",
2634
      "captures": {
2635
        "0": {
2636
          "name": "punctuation.section.scope.ruby"
2637
        }
2638
      },
2639
      "end": ">",
2640
      "patterns": [
2641
        {
2642
          "include": "#interpolated_ruby"
2643
        },
2644
        {
2645
          "include": "#escaped_char"
2646
        },
2647
        {
2648
          "include": "#nest_ltgt_i"
2649
        }
2650
      ]
2651
    },
2652
    "nest_ltgt_r": {
2653
      "begin": "<",
2654
      "captures": {
2655
        "0": {
2656
          "name": "punctuation.section.scope.ruby"
2657
        }
2658
      },
2659
      "end": ">",
2660
      "patterns": [
2661
        {
2662
          "include": "#regex_sub"
2663
        },
2664
        {
2665
          "include": "#nest_ltgt_r"
2666
        }
2667
      ]
2668
    },
2669
    "nest_parens": {
2670
      "begin": "\\(",
2671
      "captures": {
2672
        "0": {
2673
          "name": "punctuation.section.scope.ruby"
2674
        }
2675
      },
2676
      "end": "\\)",
2677
      "patterns": [
2678
        {
2679
          "include": "#nest_parens"
2680
        }
2681
      ]
2682
    },
2683
    "nest_parens_i": {
2684
      "begin": "\\(",
2685
      "captures": {
2686
        "0": {
2687
          "name": "punctuation.section.scope.ruby"
2688
        }
2689
      },
2690
      "end": "\\)",
2691
      "patterns": [
2692
        {
2693
          "include": "#interpolated_ruby"
2694
        },
2695
        {
2696
          "include": "#escaped_char"
2697
        },
2698
        {
2699
          "include": "#nest_parens_i"
2700
        }
2701
      ]
2702
    },
2703
    "nest_parens_r": {
2704
      "begin": "\\(",
2705
      "captures": {
2706
        "0": {
2707
          "name": "punctuation.section.scope.ruby"
2708
        }
2709
      },
2710
      "end": "\\)",
2711
      "patterns": [
2712
        {
2713
          "include": "#regex_sub"
2714
        },
2715
        {
2716
          "include": "#nest_parens_r"
2717
        }
2718
      ]
2719
    },
2720
    "regex_sub": {
2721
      "patterns": [
2722
        {
2723
          "include": "#interpolated_ruby"
2724
        },
2725
        {
2726
          "include": "#escaped_char"
2727
        },
2728
        {
2729
          "captures": {
2730
            "1": {
2731
              "name": "punctuation.definition.arbitrary-repetition.ruby"
2732
            },
2733
            "3": {
2734
              "name": "punctuation.definition.arbitrary-repetition.ruby"
2735
            }
2736
          },
2737
          "match": "(\\{)\\d+(,\\d+)?(})",
2738
          "name": "string.regexp.arbitrary-repetition.ruby"
2739
        },
2740
        {
2741
          "begin": "\\[(?:\\^?])?",
2742
          "captures": {
2743
            "0": {
2744
              "name": "punctuation.definition.character-class.ruby"
2745
            }
2746
          },
2747
          "end": "]",
2748
          "name": "string.regexp.character-class.ruby",
2749
          "patterns": [
2750
            {
2751
              "include": "#escaped_char"
2752
            }
2753
          ]
2754
        },
2755
        {
2756
          "begin": "\\(\\?#",
2757
          "beginCaptures": {
2758
            "0": {
2759
              "name": "punctuation.definition.comment.begin.ruby"
2760
            }
2761
          },
2762
          "end": "\\)",
2763
          "endCaptures": {
2764
            "0": {
2765
              "name": "punctuation.definition.comment.end.ruby"
2766
            }
2767
          },
2768
          "name": "comment.line.number-sign.ruby",
2769
          "patterns": [
2770
            {
2771
              "include": "#escaped_char"
2772
            }
2773
          ]
2774
        },
2775
        {
2776
          "begin": "\\(",
2777
          "captures": {
2778
            "0": {
2779
              "name": "punctuation.definition.group.ruby"
2780
            }
2781
          },
2782
          "end": "\\)",
2783
          "name": "string.regexp.group.ruby",
2784
          "patterns": [
2785
            {
2786
              "include": "#regex_sub"
2787
            }
2788
          ]
2789
        },
2790
        {
2791
          "begin": "(?<=^|\\s)(#)\\s(?=[-\\t !,.0-9?A-Za-z[^\\x00-\\x7F]]*$)",
2792
          "beginCaptures": {
2793
            "1": {
2794
              "name": "punctuation.definition.comment.ruby"
2795
            }
2796
          },
2797
          "end": "$\\n?",
2798
          "endCaptures": {
2799
            "0": {
2800
              "name": "punctuation.definition.comment.ruby"
2801
            }
2802
          },
2803
          "name": "comment.line.number-sign.ruby"
2804
        }
2805
      ]
2806
    },
2807
    "yard": {
2808
      "patterns": [
2809
        {
2810
          "include": "#yard_comment"
2811
        },
2812
        {
2813
          "include": "#yard_param_types"
2814
        },
2815
        {
2816
          "include": "#yard_option"
2817
        },
2818
        {
2819
          "include": "#yard_tag"
2820
        },
2821
        {
2822
          "include": "#yard_types"
2823
        },
2824
        {
2825
          "include": "#yard_directive"
2826
        },
2827
        {
2828
          "include": "#yard_see"
2829
        },
2830
        {
2831
          "include": "#yard_macro_attribute"
2832
        }
2833
      ]
2834
    },
2835
    "yard_comment": {
2836
      "begin": "^(\\s*)(#)(\\s*)(@)(abstract|api|author|deprecated|example|macro|note|overload|since|todo|version)(?=\\s|$)",
2837
      "beginCaptures": {
2838
        "2": {
2839
          "name": "punctuation.definition.comment.ruby"
2840
        },
2841
        "4": {
2842
          "name": "comment.line.keyword.punctuation.yard.ruby"
2843
        },
2844
        "5": {
2845
          "name": "comment.line.keyword.yard.ruby"
2846
        }
2847
      },
2848
      "contentName": "comment.line.string.yard.ruby",
2849
      "end": "^(?!\\s*#\\3\\s{2,}|\\s*#\\s*$)",
2850
      "name": "comment.line.number-sign.ruby",
2851
      "patterns": [
2852
        {
2853
          "include": "#yard"
2854
        },
2855
        {
2856
          "include": "#yard_continuation"
2857
        }
2858
      ]
2859
    },
2860
    "yard_continuation": {
2861
      "match": "^\\s*#",
2862
      "name": "punctuation.definition.comment.ruby"
2863
    },
2864
    "yard_directive": {
2865
      "begin": "^(\\s*)(#)(\\s*)(@!)(endgroup|group|method|parse|scope|visibility)(\\s+((\\[).+(])))?(?=\\s)",
2866
      "beginCaptures": {
2867
        "2": {
2868
          "name": "punctuation.definition.comment.ruby"
2869
        },
2870
        "4": {
2871
          "name": "comment.line.keyword.punctuation.yard.ruby"
2872
        },
2873
        "5": {
2874
          "name": "comment.line.keyword.yard.ruby"
2875
        },
2876
        "7": {
2877
          "name": "comment.line.type.yard.ruby"
2878
        },
2879
        "8": {
2880
          "name": "comment.line.punctuation.yard.ruby"
2881
        },
2882
        "9": {
2883
          "name": "comment.line.punctuation.yard.ruby"
2884
        }
2885
      },
2886
      "contentName": "comment.line.string.yard.ruby",
2887
      "end": "^(?!\\s*#\\3\\s{2,}|\\s*#\\s*$)",
2888
      "name": "comment.line.number-sign.ruby",
2889
      "patterns": [
2890
        {
2891
          "include": "#yard"
2892
        },
2893
        {
2894
          "include": "#yard_continuation"
2895
        }
2896
      ]
2897
    },
2898
    "yard_macro_attribute": {
2899
      "begin": "^(\\s*)(#)(\\s*)(@!)(attribute|macro)(\\s+((\\[).+(])))?(?=\\s)(\\s+([_a-z]\\w*:?))?",
2900
      "beginCaptures": {
2901
        "11": {
2902
          "name": "comment.line.parameter.yard.ruby"
2903
        },
2904
        "2": {
2905
          "name": "punctuation.definition.comment.ruby"
2906
        },
2907
        "4": {
2908
          "name": "comment.line.keyword.punctuation.yard.ruby"
2909
        },
2910
        "5": {
2911
          "name": "comment.line.keyword.yard.ruby"
2912
        },
2913
        "7": {
2914
          "name": "comment.line.type.yard.ruby"
2915
        },
2916
        "8": {
2917
          "name": "comment.line.punctuation.yard.ruby"
2918
        },
2919
        "9": {
2920
          "name": "comment.line.punctuation.yard.ruby"
2921
        }
2922
      },
2923
      "contentName": "comment.line.string.yard.ruby",
2924
      "end": "^(?!\\s*#\\3\\s{2,}|\\s*#\\s*$)",
2925
      "name": "comment.line.number-sign.ruby",
2926
      "patterns": [
2927
        {
2928
          "include": "#yard"
2929
        },
2930
        {
2931
          "include": "#yard_continuation"
2932
        }
2933
      ]
2934
    },
2935
    "yard_option": {
2936
      "begin": "^(\\s*)(#)(\\s*)(@)(option)(?=\\s)(?>\\s+([_a-z]\\w*:?))?(?>\\s+((\\[).+(])))?(?>\\s+((\\S*)))?(?>\\s+((\\().+(\\))))?",
2937
      "beginCaptures": {
2938
        "10": {
2939
          "name": "comment.line.keyword.yard.ruby"
2940
        },
2941
        "11": {
2942
          "name": "comment.line.hashkey.yard.ruby"
2943
        },
2944
        "12": {
2945
          "name": "comment.line.defaultvalue.yard.ruby"
2946
        },
2947
        "13": {
2948
          "name": "comment.line.punctuation.yard.ruby"
2949
        },
2950
        "14": {
2951
          "name": "comment.line.punctuation.yard.ruby"
2952
        },
2953
        "2": {
2954
          "name": "punctuation.definition.comment.ruby"
2955
        },
2956
        "4": {
2957
          "name": "comment.line.keyword.punctuation.yard.ruby"
2958
        },
2959
        "5": {
2960
          "name": "comment.line.keyword.yard.ruby"
2961
        },
2962
        "6": {
2963
          "name": "comment.line.parameter.yard.ruby"
2964
        },
2965
        "7": {
2966
          "name": "comment.line.type.yard.ruby"
2967
        },
2968
        "8": {
2969
          "name": "comment.line.punctuation.yard.ruby"
2970
        },
2971
        "9": {
2972
          "name": "comment.line.punctuation.yard.ruby"
2973
        }
2974
      },
2975
      "contentName": "comment.line.string.yard.ruby",
2976
      "end": "^(?!\\s*#\\3\\s{2,}|\\s*#\\s*$)",
2977
      "name": "comment.line.number-sign.ruby",
2978
      "patterns": [
2979
        {
2980
          "include": "#yard"
2981
        },
2982
        {
2983
          "include": "#yard_continuation"
2984
        }
2985
      ]
2986
    },
2987
    "yard_param_types": {
2988
      "begin": "^(\\s*)(#)(\\s*)(@)(attr|attr_reader|attr_writer|yieldparam|param)(?=\\s)(?>\\s+(?>([_a-z]\\w*:?)|((\\[).+(]))))?(?>\\s+(?>((\\[).+(]))|([_a-z]\\w*:?)))?",
2989
      "beginCaptures": {
2990
        "10": {
2991
          "name": "comment.line.type.yard.ruby"
2992
        },
2993
        "11": {
2994
          "name": "comment.line.punctuation.yard.ruby"
2995
        },
2996
        "12": {
2997
          "name": "comment.line.punctuation.yard.ruby"
2998
        },
2999
        "13": {
3000
          "name": "comment.line.parameter.yard.ruby"
3001
        },
3002
        "2": {
3003
          "name": "punctuation.definition.comment.ruby"
3004
        },
3005
        "4": {
3006
          "name": "comment.line.keyword.punctuation.yard.ruby"
3007
        },
3008
        "5": {
3009
          "name": "comment.line.keyword.yard.ruby"
3010
        },
3011
        "6": {
3012
          "name": "comment.line.parameter.yard.ruby"
3013
        },
3014
        "7": {
3015
          "name": "comment.line.type.yard.ruby"
3016
        },
3017
        "8": {
3018
          "name": "comment.line.punctuation.yard.ruby"
3019
        },
3020
        "9": {
3021
          "name": "comment.line.punctuation.yard.ruby"
3022
        }
3023
      },
3024
      "contentName": "comment.line.string.yard.ruby",
3025
      "end": "^(?!\\s*#\\3\\s{2,}|\\s*#\\s*$)",
3026
      "name": "comment.line.number-sign.ruby",
3027
      "patterns": [
3028
        {
3029
          "include": "#yard"
3030
        },
3031
        {
3032
          "include": "#yard_continuation"
3033
        }
3034
      ]
3035
    },
3036
    "yard_see": {
3037
      "begin": "^(\\s*)(#)(\\s*)(@)(see)(?=\\s)(\\s+(.+?))?(?=\\s|$)",
3038
      "beginCaptures": {
3039
        "2": {
3040
          "name": "punctuation.definition.comment.ruby"
3041
        },
3042
        "4": {
3043
          "name": "comment.line.keyword.punctuation.yard.ruby"
3044
        },
3045
        "5": {
3046
          "name": "comment.line.keyword.yard.ruby"
3047
        },
3048
        "7": {
3049
          "name": "comment.line.parameter.yard.ruby"
3050
        }
3051
      },
3052
      "contentName": "comment.line.string.yard.ruby",
3053
      "end": "^(?!\\s*#\\3\\s{2,}|\\s*#\\s*$)",
3054
      "name": "comment.line.number-sign.ruby",
3055
      "patterns": [
3056
        {
3057
          "include": "#yard"
3058
        },
3059
        {
3060
          "include": "#yard_continuation"
3061
        }
3062
      ]
3063
    },
3064
    "yard_tag": {
3065
      "captures": {
3066
        "2": {
3067
          "name": "punctuation.definition.comment.ruby"
3068
        },
3069
        "4": {
3070
          "name": "comment.line.keyword.punctuation.yard.ruby"
3071
        },
3072
        "5": {
3073
          "name": "comment.line.keyword.yard.ruby"
3074
        }
3075
      },
3076
      "match": "^(\\s*)(#)(\\s*)(@)(private)$",
3077
      "name": "comment.line.number-sign.ruby"
3078
    },
3079
    "yard_types": {
3080
      "begin": "^(\\s*)(#)(\\s*)(@)(raise|return|yield(?:return)?)(?=\\s)(\\s+((\\[).+(])))?",
3081
      "beginCaptures": {
3082
        "2": {
3083
          "name": "punctuation.definition.comment.ruby"
3084
        },
3085
        "4": {
3086
          "name": "comment.line.keyword.punctuation.yard.ruby"
3087
        },
3088
        "5": {
3089
          "name": "comment.line.keyword.yard.ruby"
3090
        },
3091
        "7": {
3092
          "name": "comment.line.type.yard.ruby"
3093
        },
3094
        "8": {
3095
          "name": "comment.line.punctuation.yard.ruby"
3096
        },
3097
        "9": {
3098
          "name": "comment.line.punctuation.yard.ruby"
3099
        }
3100
      },
3101
      "contentName": "comment.line.string.yard.ruby",
3102
      "end": "^(?!\\s*#\\3\\s{2,}|\\s*#\\s*$)",
3103
      "name": "comment.line.number-sign.ruby",
3104
      "patterns": [
3105
        {
3106
          "include": "#yard"
3107
        },
3108
        {
3109
          "include": "#yard_continuation"
3110
        }
3111
      ]
3112
    }
3113
  },
3114
  "scopeName": "source.ruby"
3115
}