PluginProbe
Code Block Pro – Beautiful Syntax Highlighting / 1.11.1
Code Block Pro – Beautiful Syntax Highlighting v1.11.1
1.27.1 1.27.2 1.27.3 1.27.4 1.27.5 1.27.6 1.27.7 1.28.0 1.3.0 1.4.0 1.5.0 1.5.1 1.5.2 1.6.0 1.7.0 1.8.0 1.9.0 1.9.1 1.9.2 1.9.3 trunk 1.1.0 1.10.0 1.11.0 1.11.1 All 63 releases
code-block-pro / build / shiki / languages / ruby.tmLanguage.json

ruby.tmLanguage.json in Code Block Pro – Beautiful Syntax Highlighting 1.11.1, at build/shiki/languages/ruby.tmLanguage.json

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