Created
July 25, 2018 05:32
-
-
Save kivikakk/593c3b708cc8659fed07eb8432aaa6e6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "Ruby", | |
"scopeName": "source.ruby", | |
"patterns": [ | |
{ | |
"name": "meta.class.ruby", | |
"match": "(?x)\n^\\s*(class)\\s+\n(\n (\n [.a-zA-Z0-9_:]+\n (\\s*(\u003c)\\s*[.a-zA-Z0-9_:]+)? # class A \u003c B\n )\n |\n ((\u003c\u003c)\\s*[.a-zA-Z0-9_:]+) # class \u003c\u003c C\n)", | |
"captures": { | |
"1": { | |
"name": "keyword.control.class.ruby" | |
}, | |
"2": { | |
"name": "entity.name.type.class.ruby" | |
}, | |
"4": { | |
"name": "entity.other.inherited-class.ruby" | |
}, | |
"5": { | |
"name": "punctuation.separator.inheritance.ruby" | |
}, | |
"6": { | |
"name": "variable.other.object.ruby" | |
}, | |
"7": { | |
"name": "punctuation.definition.variable.ruby" | |
} | |
} | |
}, | |
{ | |
"name": "meta.module.ruby", | |
"match": "(?x)\n^\\s*(module)\\s+\n(\n ([A-Z]\\w*(::))?\n ([A-Z]\\w*(::))?\n ([A-Z]\\w*(::))*\n [A-Z]\\w*\n)", | |
"captures": { | |
"1": { | |
"name": "keyword.control.module.ruby" | |
}, | |
"2": { | |
"name": "entity.name.type.module.ruby" | |
}, | |
"3": { | |
"name": "entity.other.inherited-class.module.first.ruby" | |
}, | |
"4": { | |
"name": "punctuation.separator.inheritance.ruby" | |
}, | |
"5": { | |
"name": "entity.other.inherited-class.module.second.ruby" | |
}, | |
"6": { | |
"name": "punctuation.separator.inheritance.ruby" | |
}, | |
"7": { | |
"name": "entity.other.inherited-class.module.third.ruby" | |
}, | |
"8": { | |
"name": "punctuation.separator.inheritance.ruby" | |
} | |
} | |
}, | |
{ | |
"name": "invalid.deprecated.ruby", | |
"match": "(?\u003c!\\.)\\belse(\\s)+if\\b" | |
}, | |
{ | |
"name": "constant.other.symbol.hashkey.ruby", | |
"match": "(?\u003e[a-zA-Z_]\\w*(?\u003e[?!])?)(:)(?!:)", | |
"captures": { | |
"1": { | |
"name": "punctuation.definition.constant.hashkey.ruby" | |
} | |
} | |
}, | |
{ | |
"name": "constant.other.symbol.hashkey.ruby", | |
"match": "(?\u003c!:)(:)(?\u003e[a-zA-Z_]\\w*(?\u003e[?!])?)(?=\\s*=\u003e)", | |
"captures": { | |
"1": { | |
"name": "punctuation.definition.constant.ruby" | |
} | |
} | |
}, | |
{ | |
"name": "keyword.control.ruby", | |
"match": "(?\u003c!\\.)\\b(BEGIN|begin|case|class|else|elsif|END|end|ensure|for|if|in|module|rescue|then|unless|until|when|while)\\b(?![?!])" | |
}, | |
{ | |
"name": "keyword.control.start-block.ruby", | |
"match": "(?\u003c!\\.)\\bdo\\b" | |
}, | |
{ | |
"name": "meta.syntax.ruby.start-block", | |
"match": "(?\u003c={)(\\s+)" | |
}, | |
{ | |
"name": "keyword.control.pseudo-method.ruby", | |
"match": "(?\u003c!\\.)\\b(alias|alias_method|break|next|redo|retry|return|super|undef|yield)\\b(?![?!])|\\bdefined\\?|\\b(block_given|iterator)\\?" | |
}, | |
{ | |
"name": "constant.language.nil.ruby", | |
"match": "\\bnil\\b(?![?!])" | |
}, | |
{ | |
"name": "constant.language.boolean.ruby", | |
"match": "\\b(true|false)\\b(?![?!])" | |
}, | |
{ | |
"name": "variable.language.ruby", | |
"match": "\\b(__(FILE|LINE)__)\\b(?![?!])" | |
}, | |
{ | |
"name": "variable.language.self.ruby", | |
"match": "\\bself\\b(?![?!])" | |
}, | |
{ | |
"name": "keyword.other.special-method.ruby", | |
"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(?![?!])" | |
}, | |
{ | |
"name": "meta.require.ruby", | |
"begin": "\\b(?\u003c!\\.|::)(require|require_relative)\\b(?![?!])", | |
"end": "$|(?=#|})", | |
"patterns": [ | |
{ | |
"include": "$self" | |
} | |
], | |
"captures": { | |
"1": { | |
"name": "keyword.other.special-method.ruby" | |
} | |
} | |
}, | |
{ | |
"name": "variable.other.readwrite.instance.ruby", | |
"match": "(@)[a-zA-Z_]\\w*", | |
"captures": { | |
"1": { | |
"name": "punctuation.definition.variable.ruby" | |
} | |
} | |
}, | |
{ | |
"name": "variable.other.readwrite.class.ruby", | |
"match": "(@@)[a-zA-Z_]\\w*", | |
"captures": { | |
"1": { | |
"name": "punctuation.definition.variable.ruby" | |
} | |
} | |
}, | |
{ | |
"name": "variable.other.readwrite.global.ruby", | |
"match": "(\\$)[a-zA-Z_]\\w*", | |
"captures": { | |
"1": { | |
"name": "punctuation.definition.variable.ruby" | |
} | |
} | |
}, | |
{ | |
"name": "variable.other.readwrite.global.pre-defined.ruby", | |
"match": "(\\$)(!|@|\u0026|`|'|\\+|\\d+|~|=|/|\\\\|,|;|\\.|\u003c|\u003e|_|\\*|\\$|\\?|:|\"|-[0adFiIlpv])", | |
"captures": { | |
"1": { | |
"name": "punctuation.definition.variable.ruby" | |
} | |
} | |
}, | |
{ | |
"name": "meta.environment-variable.ruby", | |
"begin": "\\b(ENV)\\[", | |
"end": "]", | |
"patterns": [ | |
{ | |
"include": "$self" | |
} | |
], | |
"beginCaptures": { | |
"1": { | |
"name": "variable.other.constant.ruby" | |
} | |
} | |
}, | |
{ | |
"name": "support.class.ruby", | |
"match": "\\b[A-Z]\\w*(?=((\\.|::)[A-Za-z]|\\[))" | |
}, | |
{ | |
"name": "support.function.kernel.ruby", | |
"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|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(?![?!])|autoload\\?|exit!)" | |
}, | |
{ | |
"name": "variable.other.constant.ruby", | |
"match": "\\b[_A-Z]\\w*\\b" | |
}, | |
{ | |
"name": "meta.function.method.with-arguments.ruby", | |
"begin": "(?x)\n(?=def\\b) # optimization to help Oniguruma fail fast\n(?\u003c=^|\\s)(def)\\s+\n(\n (?\u003e[a-zA-Z_]\\w*(?\u003e\\.|::))? # method prefix\n (?\u003e # method name\n [a-zA-Z_]\\w*(?\u003e[?!]|=(?!\u003e))?\n |\n ===?|!=|\u003e[\u003e=]?|\u003c=\u003e|\u003c[\u003c=]?|[%\u0026`/\\|]|\\*\\*?|=?~|[-+]@?|\\[]=?\n )\n)\n\\s*(\\()", | |
"end": "\\)", | |
"patterns": [ | |
{ | |
"begin": "(?![\\s,)])", | |
"end": "(?=,|\\)\\s*$)", | |
"patterns": [ | |
{ | |
"match": "\\G([\u0026*]?)(?:([_a-zA-Z]\\w*(:))|([_a-zA-Z]\\w*))", | |
"captures": { | |
"1": { | |
"name": "storage.type.variable.ruby" | |
}, | |
"2": { | |
"name": "constant.other.symbol.hashkey.parameter.function.ruby" | |
}, | |
"3": { | |
"name": "punctuation.definition.constant.hashkey.ruby" | |
}, | |
"4": { | |
"name": "variable.parameter.function.ruby" | |
} | |
} | |
}, | |
{ | |
"include": "$self" | |
} | |
] | |
} | |
], | |
"beginCaptures": { | |
"1": { | |
"name": "keyword.control.def.ruby" | |
}, | |
"2": { | |
"name": "entity.name.function.ruby" | |
}, | |
"3": { | |
"name": "punctuation.definition.parameters.ruby" | |
} | |
}, | |
"endCaptures": { | |
"0": { | |
"name": "punctuation.definition.parameters.ruby" | |
} | |
} | |
}, | |
{ | |
"name": "meta.function.method.with-arguments.ruby", | |
"begin": "(?x)\n(?=def\\b) # optimization to help Oniguruma fail fast\n(?\u003c=^|\\s)(def)\\s+\n(\n (?\u003e[a-zA-Z_]\\w*(?\u003e\\.|::))? # method prefix\n (?\u003e # method name\n [a-zA-Z_]\\w*(?\u003e[?!]|=(?!\u003e))?\n |\n ===?|!=|\u003e[\u003e=]?|\u003c=\u003e|\u003c[\u003c=]?|[%\u0026`/\\|]|\\*\\*?|=?~|[-+]@?|\\[]=?\n )\n)\n[ \\t]\n(?=[ \\t]*[^\\s#;]) # make sure the following is not comment", | |
"end": "$", | |
"patterns": [ | |
{ | |
"begin": "(?![\\s,])", | |
"end": "(?=,|$)", | |
"patterns": [ | |
{ | |
"match": "\\G([\u0026*]?)(?:([_a-zA-Z]\\w*(:))|([_a-zA-Z]\\w*))", | |
"captures": { | |
"1": { | |
"name": "storage.type.variable.ruby" | |
}, | |
"2": { | |
"name": "constant.other.symbol.hashkey.parameter.function.ruby" | |
}, | |
"3": { | |
"name": "punctuation.definition.constant.hashkey.ruby" | |
}, | |
"4": { | |
"name": "variable.parameter.function.ruby" | |
} | |
} | |
}, | |
{ | |
"include": "$self" | |
} | |
] | |
} | |
], | |
"beginCaptures": { | |
"1": { | |
"name": "keyword.control.def.ruby" | |
}, | |
"2": { | |
"name": "entity.name.function.ruby" | |
} | |
} | |
}, | |
{ | |
"name": "meta.function.method.without-arguments.ruby", | |
"match": "(?x)\n(?=def\\b) # optimization to help Oniguruma fail fast\n(?\u003c=^|\\s)(def)\\b\n(\n \\s+\n (\n (?\u003e[a-zA-Z_]\\w*(?\u003e\\.|::))? # method prefix\n (?\u003e # method name\n [a-zA-Z_]\\w*(?\u003e[?!]|=(?!\u003e))?\n |\n ===?|!=|\u003e[\u003e=]?|\u003c=\u003e|\u003c[\u003c=]?|[%\u0026`/\\|]|\\*\\*?|=?~|[-+]@?|\\[]=?\n )\n )\n)?", | |
"captures": { | |
"1": { | |
"name": "keyword.control.def.ruby" | |
}, | |
"3": { | |
"name": "entity.name.function.ruby" | |
} | |
} | |
}, | |
{ | |
"name": "constant.numeric.ruby", | |
"match": "(?x)\n\\b\n(\n [\\d](?\u003e_?\\d)* # 100_000\n (\\.(?![^[:space:][:digit:]])(?\u003e_?\\d)*)? # fractional part\n ([eE][-+]?\\d(?\u003e_?\\d)*)? # 1.23e-4\n |\n 0\n (?:\n [xX][[:xdigit:]](?\u003e_?[[:xdigit:]])*|\n [oO]?[0-7](?\u003e_?[0-7])*|\n [bB][01](?\u003e_?[01])*|\n [dD]\\d(?\u003e_?\\d)*\n ) # A base indicator can only be used with an integer\n)\\b" | |
}, | |
{ | |
"name": "constant.other.symbol.ruby", | |
"begin": ":'", | |
"end": "'", | |
"patterns": [ | |
{ | |
"name": "constant.character.escape.ruby", | |
"match": "\\\\['\\\\]" | |
} | |
], | |
"beginCaptures": { | |
"0": { | |
"name": "punctuation.definition.symbol.begin.ruby" | |
} | |
}, | |
"endCaptures": { | |
"0": { | |
"name": "punctuation.definition.symbol.end.ruby" | |
} | |
} | |
}, | |
{ | |
"name": "constant.other.symbol.interpolated.ruby", | |
"begin": ":\"", | |
"end": "\"", | |
"patterns": [ | |
{ | |
"include": "#interpolated_ruby" | |
}, | |
{ | |
"include": "#escaped_char" | |
} | |
], | |
"beginCaptures": { | |
"0": { | |
"name": "punctuation.section.symbol.begin.ruby" | |
} | |
}, | |
"endCaptures": { | |
"0": { | |
"name": "punctuation.section.symbol.end.ruby" | |
} | |
} | |
}, | |
{ | |
"name": "keyword.operator.assignment.augmented.ruby", | |
"match": "(?\u003c!\\()/=" | |
}, | |
{ | |
"name": "string.quoted.single.ruby", | |
"begin": "'", | |
"end": "'", | |
"patterns": [ | |
{ | |
"name": "constant.character.escape.ruby", | |
"match": "\\\\'|\\\\\\\\" | |
} | |
], | |
"beginCaptures": { | |
"0": { | |
"name": "punctuation.definition.string.begin.ruby" | |
} | |
}, | |
"endCaptures": { | |
"0": { | |
"name": "punctuation.definition.string.end.ruby" | |
} | |
} | |
}, | |
{ | |
"name": "string.quoted.double.interpolated.ruby", | |
"begin": "\"", | |
"end": "\"", | |
"patterns": [ | |
{ | |
"include": "#interpolated_ruby" | |
}, | |
{ | |
"include": "#escaped_char" | |
} | |
], | |
"beginCaptures": { | |
"0": { | |
"name": "punctuation.definition.string.begin.ruby" | |
} | |
}, | |
"endCaptures": { | |
"0": { | |
"name": "punctuation.definition.string.end.ruby" | |
} | |
} | |
}, | |
{ | |
"name": "string.interpolated.ruby", | |
"begin": "`", | |
"end": "`", | |
"patterns": [ | |
{ | |
"include": "#interpolated_ruby" | |
}, | |
{ | |
"include": "#escaped_char" | |
} | |
], | |
"beginCaptures": { | |
"0": { | |
"name": "punctuation.definition.string.begin.ruby" | |
} | |
}, | |
"endCaptures": { | |
"0": { | |
"name": "punctuation.definition.string.end.ruby" | |
} | |
} | |
}, | |
{ | |
"contentName": "string.regexp.interpolated.ruby", | |
"begin": "(?x)\n(?\u003c![\\w)])((/))(?![?*+])\n(?=\n (?:\\\\/|[^/])*+ # Do NOT change the order\n /[eimnosux]*\\s*\n (?:\n [)\\]}#.,?:]|\\|\\||\u0026\u0026|\u003c=\u003e|=\u003e|==|=~|!~|!=|;|$|\n if|else|elsif|then|do|end|unless|while|until|or|and\n )\n |\n $\n)", | |
"end": "((/[eimnosux]*))", | |
"patterns": [ | |
{ | |
"include": "#regex_sub" | |
} | |
], | |
"captures": { | |
"1": { | |
"name": "string.regexp.interpolated.ruby" | |
}, | |
"2": { | |
"name": "punctuation.section.regexp.ruby" | |
} | |
} | |
}, | |
{ | |
"name": "string.regexp.interpolated.ruby", | |
"begin": "%r{", | |
"end": "}[eimnosux]*", | |
"patterns": [ | |
{ | |
"include": "#regex_sub" | |
}, | |
{ | |
"include": "#nest_curly_r" | |
} | |
], | |
"beginCaptures": { | |
"0": { | |
"name": "punctuation.section.regexp.begin.ruby" | |
} | |
}, | |
"endCaptures": { | |
"0": { | |
"name": "punctuation.section.regexp.end.ruby" | |
} | |
} | |
}, | |
{ | |
"name": "string.regexp.interpolated.ruby", | |
"begin": "%r\\[", | |
"end": "][eimnosux]*", | |
"patterns": [ | |
{ | |
"include": "#regex_sub" | |
}, | |
{ | |
"include": "#nest_brackets_r" | |
} | |
], | |
"beginCaptures": { | |
"0": { | |
"name": "punctuation.section.regexp.begin.ruby" | |
} | |
}, | |
"endCaptures": { | |
"0": { | |
"name": "punctuation.section.regexp.end.ruby" | |
} | |
} | |
}, | |
{ | |
"name": "string.regexp.interpolated.ruby", | |
"begin": "%r\\(", | |
"end": "\\)[eimnosux]*", | |
"patterns": [ | |
{ | |
"include": "#regex_sub" | |
}, | |
{ | |
"include": "#nest_parens_r" | |
} | |
], | |
"beginCaptures": { | |
"0": { | |
"name": "punctuation.section.regexp.begin.ruby" | |
} | |
}, | |
"endCaptures": { | |
"0": { | |
"name": "punctuation.section.regexp.end.ruby" | |
} | |
} | |
}, | |
{ | |
"name": "string.regexp.interpolated.ruby", | |
"begin": "%r\u003c", | |
"end": "\u003e[eimnosux]*", | |
"patterns": [ | |
{ | |
"include": "#regex_sub" | |
}, | |
{ | |
"include": "#nest_ltgt_r" | |
} | |
], | |
"beginCaptures": { | |
"0": { | |
"name": "punctuation.section.regexp.begin.ruby" | |
} | |
}, | |
"endCaptures": { | |
"0": { | |
"name": "punctuation.section.regexp.end.ruby" | |
} | |
} | |
}, | |
{ | |
"name": "string.regexp.interpolated.ruby", | |
"begin": "%r([^\\w])", | |
"end": "\\1[eimnosux]*", | |
"patterns": [ | |
{ | |
"include": "#regex_sub" | |
} | |
], | |
"beginCaptures": { | |
"0": { | |
"name": "punctuation.section.regexp.begin.ruby" | |
} | |
}, | |
"endCaptures": { | |
"0": { | |
"name": "punctuation.section.regexp.end.ruby" | |
} | |
} | |
}, | |
{ | |
"name": "constant.other.symbol.interpolated.ruby", | |
"begin": "%I\\[", | |
"end": "]", | |
"patterns": [ | |
{ | |
"include": "#interpolated_ruby" | |
}, | |
{ | |
"include": "#escaped_char" | |
}, | |
{ | |
"include": "#nest_brackets_i" | |
} | |
], | |
"beginCaptures": { | |
"0": { | |
"name": "punctuation.section.array.begin.ruby" | |
} | |
}, | |
"endCaptures": { | |
"0": { | |
"name": "punctuation.section.array.end.ruby" | |
} | |
} | |
}, | |
{ | |
"name": "constant.other.symbol.interpolated.ruby", | |
"begin": "%I\\(", | |
"end": "\\)", | |
"patterns": [ | |
{ | |
"include": "#interpolated_ruby" | |
}, | |
{ | |
"include": "#escaped_char" | |
}, | |
{ | |
"include": "#nest_parens_i" | |
} | |
], | |
"beginCaptures": { | |
"0": { | |
"name": "punctuation.section.array.begin.ruby" | |
} | |
}, | |
"endCaptures": { | |
"0": { | |
"name": "punctuation.section.array.end.ruby" | |
} | |
} | |
}, | |
{ | |
"name": "constant.other.symbol.interpolated.ruby", | |
"begin": "%I\u003c", | |
"end": "\u003e", | |
"patterns": [ | |
{ | |
"include": "#interpolated_ruby" | |
}, | |
{ | |
"include": "#escaped_char" | |
}, | |
{ | |
"include": "#nest_ltgt_i" | |
} | |
], | |
"beginCaptures": { | |
"0": { | |
"name": "punctuation.section.array.begin.ruby" | |
} | |
}, | |
"endCaptures": { | |
"0": { | |
"name": "punctuation.section.array.end.ruby" | |
} | |
} | |
}, | |
{ | |
"name": "constant.other.symbol.interpolated.ruby", | |
"begin": "%I{", | |
"end": "}", | |
"patterns": [ | |
{ | |
"include": "#interpolated_ruby" | |
}, | |
{ | |
"include": "#escaped_char" | |
}, | |
{ | |
"include": "#nest_curly_i" | |
} | |
], | |
"beginCaptures": { | |
"0": { | |
"name": "punctuation.section.array.begin.ruby" | |
} | |
}, | |
"endCaptures": { | |
"0": { | |
"name": "punctuation.section.array.end.ruby" | |
} | |
} | |
}, | |
{ | |
"name": "constant.other.symbol.interpolated.ruby", | |
"begin": "%I([^\\w])", | |
"end": "\\1", | |
"patterns": [ | |
{ | |
"include": "#interpolated_ruby" | |
}, | |
{ | |
"include": "#escaped_char" | |
} | |
], | |
"beginCaptures": { | |
"0": { | |
"name": "punctuation.section.array.begin.ruby" | |
} | |
}, | |
"endCaptures": { | |
"0": { | |
"name": "punctuation.section.array.end.ruby" | |
} | |
} | |
}, | |
{ | |
"name": "constant.other.symbol.ruby", | |
"begin": "%i\\[", | |
"end": "]", | |
"patterns": [ | |
{ | |
"name": "constant.character.escape.ruby", | |
"match": "\\\\]|\\\\\\\\" | |
}, | |
{ | |
"include": "#nest_brackets" | |
} | |
], | |
"beginCaptures": { | |
"0": { | |
"name": "punctuation.section.array.begin.ruby" | |
} | |
}, | |
"endCaptures": { | |
"0": { | |
"name": "punctuation.section.array.end.ruby" | |
} | |
} | |
}, | |
{ | |
"name": "constant.other.symbol.ruby", | |
"begin": "%i\\(", | |
"end": "\\)", | |
"patterns": [ | |
{ | |
"name": "constant.character.escape.ruby", | |
"match": "\\\\\\)|\\\\\\\\" | |
}, | |
{ | |
"include": "#nest_parens" | |
} | |
], | |
"beginCaptures": { | |
"0": { | |
"name": "punctuation.section.array.begin.ruby" | |
} | |
}, | |
"endCaptures": { | |
"0": { | |
"name": "punctuation.section.array.end.ruby" | |
} | |
} | |
}, | |
{ | |
"name": "constant.other.symbol.ruby", | |
"begin": "%i\u003c", | |
"end": "\u003e", | |
"patterns": [ | |
{ | |
"name": "constant.character.escape.ruby", | |
"match": "\\\\\u003e|\\\\\\\\" | |
}, | |
{ | |
"include": "#nest_ltgt" | |
} | |
], | |
"beginCaptures": { | |
"0": { | |
"name": "punctuation.section.array.begin.ruby" | |
} | |
}, | |
"endCaptures": { | |
"0": { | |
"name": "punctuation.section.array.end.ruby" | |
} | |
} | |
}, | |
{ | |
"name": "constant.other.symbol.ruby", | |
"begin": "%i{", | |
"end": "}", | |
"patterns": [ | |
{ | |
"name": "constant.character.escape.ruby", | |
"match": "\\\\}|\\\\\\\\" | |
}, | |
{ | |
"include": "#nest_curly" | |
} | |
], | |
"beginCaptures": { | |
"0": { | |
"name": "punctuation.section.array.begin.ruby" | |
} | |
}, | |
"endCaptures": { | |
"0": { | |
"name": "punctuation.section.array.end.ruby" | |
} | |
} | |
}, | |
{ | |
"name": "constant.other.symbol.ruby", | |
"begin": "%i([^\\w])", | |
"end": "\\1", | |
"patterns": [ | |
{ | |
"match": "\\\\." | |
} | |
], | |
"beginCaptures": { | |
"0": { | |
"name": "punctuation.section.array.begin.ruby" | |
} | |
}, | |
"endCaptures": { | |
"0": { | |
"name": "punctuation.section.array.end.ruby" | |
} | |
} | |
}, | |
{ | |
"name": "string.quoted.other.interpolated.ruby", | |
"begin": "%W\\[", | |
"end": "]", | |
"patterns": [ | |
{ | |
"include": "#interpolated_ruby" | |
}, | |
{ | |
"include": "#escaped_char" | |
}, | |
{ | |
"include": "#nest_brackets_i" | |
} | |
], | |
"beginCaptures": { | |
"0": { | |
"name": "punctuation.section.array.begin.ruby" | |
} | |
}, | |
"endCaptures": { | |
"0": { | |
"name": "punctuation.section.array.end.ruby" | |
} | |
} | |
}, | |
{ | |
"name": "string.quoted.other.interpolated.ruby", | |
"begin": "%W\\(", | |
"end": "\\)", | |
"patterns": [ | |
{ | |
"include": "#interpolated_ruby" | |
}, | |
{ | |
"include": "#escaped_char" | |
}, | |
{ | |
"include": "#nest_parens_i" | |
} | |
], | |
"beginCaptures": { | |
"0": { | |
"name": "punctuation.section.array.begin.ruby" | |
} | |
}, | |
"endCaptures": { | |
"0": { | |
"name": "punctuation.section.array.end.ruby" | |
} | |
} | |
}, | |
{ | |
"name": "string.quoted.other.interpolated.ruby", | |
"begin": "%W\u003c", | |
"end": "\u003e", | |
"patterns": [ | |
{ | |
"include": "#interpolated_ruby" | |
}, | |
{ | |
"include": "#escaped_char" | |
}, | |
{ | |
"include": "#nest_ltgt_i" | |
} | |
], | |
"beginCaptures": { | |
"0": { | |
"name": "punctuation.section.array.begin.ruby" | |
} | |
}, | |
"endCaptures": { | |
"0": { | |
"name": "punctuation.section.array.end.ruby" | |
} | |
} | |
}, | |
{ | |
"name": "string.quoted.other.interpolated.ruby", | |
"begin": "%W{", | |
"end": "}", | |
"patterns": [ | |
{ | |
"include": "#interpolated_ruby" | |
}, | |
{ | |
"include": "#escaped_char" | |
}, | |
{ | |
"include": "#nest_curly_i" | |
} | |
], | |
"beginCaptures": { | |
"0": { | |
"name": "punctuation.section.array.begin.ruby" | |
} | |
}, | |
"endCaptures": { | |
"0": { | |
"name": "punctuation.section.array.end.ruby" | |
} | |
} | |
}, | |
{ | |
"name": "string.quoted.other.interpolated.ruby", | |
"begin": "%W([^\\w])", | |
"end": "\\1", | |
"patterns": [ | |
{ | |
"include": "#interpolated_ruby" | |
}, | |
{ | |
"include": "#escaped_char" | |
} | |
], | |
"beginCaptures": { | |
"0": { | |
"name": "punctuation.section.array.begin.ruby" | |
} | |
}, | |
"endCaptures": { | |
"0": { | |
"name": "punctuation.section.array.end.ruby" | |
} | |
} | |
}, | |
{ | |
"name": "string.quoted.other.ruby", | |
"begin": "%w\\[", | |
"end": "]", | |
"patterns": [ | |
{ | |
"name": "constant.character.escape.ruby", | |
"match": "\\\\]|\\\\\\\\" | |
}, | |
{ | |
"include": "#nest_brackets" | |
} | |
], | |
"beginCaptures": { | |
"0": { | |
"name": "punctuation.section.array.begin.ruby" | |
} | |
}, | |
"endCaptures": { | |
"0": { | |
"name": "punctuation.section.array.end.ruby" | |
} | |
} | |
}, | |
{ | |
"name": "string.quoted.other.ruby", | |
"begin": "%w\\(", | |
"end": "\\)", | |
"patterns": [ | |
{ | |
"name": "constant.character.escape.ruby", | |
"match": "\\\\\\)|\\\\\\\\" | |
}, | |
{ | |
"include": "#nest_parens" | |
} | |
], | |
"beginCaptures": { | |
"0": { | |
"name": "punctuation.section.array.begin.ruby" | |
} | |
}, | |
"endCaptures": { | |
"0": { | |
"name": "punctuation.section.array.end.ruby" | |
} | |
} | |
}, | |
{ | |
"name": "string.quoted.other.ruby", | |
"begin": "%w\u003c", | |
"end": "\u003e", | |
"patterns": [ | |
{ | |
"name": "constant.character.escape.ruby", | |
"match": "\\\\\u003e|\\\\\\\\" | |
}, | |
{ | |
"include": "#nest_ltgt" | |
} | |
], | |
"beginCaptures": { | |
"0": { | |
"name": "punctuation.section.array.begin.ruby" | |
} | |
}, | |
"endCaptures": { | |
"0": { | |
"name": "punctuation.section.array.end.ruby" | |
} | |
} | |
}, | |
{ | |
"name": "string.quoted.other.ruby", | |
"begin": "%w{", | |
"end": "}", | |
"patterns": [ | |
{ | |
"name": "constant.character.escape.ruby", | |
"match": "\\\\}|\\\\\\\\" | |
}, | |
{ | |
"include": "#nest_curly" | |
} | |
], | |
"beginCaptures": { | |
"0": { | |
"name": "punctuation.section.array.begin.ruby" | |
} | |
}, | |
"endCaptures": { | |
"0": { | |
"name": "punctuation.section.array.end.ruby" | |
} | |
} | |
}, | |
{ | |
"name": "string.quoted.other.ruby", | |
"begin": "%w([^\\w])", | |
"end": "\\1", | |
"patterns": [ | |
{ | |
"match": "\\\\." | |
} | |
], | |
"beginCaptures": { | |
"0": { | |
"name": "punctuation.section.array.begin.ruby" | |
} | |
}, | |
"endCaptures": { | |
"0": { | |
"name": "punctuation.section.array.end.ruby" | |
} | |
} | |
}, | |
{ | |
"name": "string.quoted.other.interpolated.ruby", | |
"begin": "%[Qx]?\\(", | |
"end": "\\)", | |
"patterns": [ | |
{ | |
"include": "#interpolated_ruby" | |
}, | |
{ | |
"include": "#escaped_char" | |
}, | |
{ | |
"include": "#nest_parens_i" | |
} | |
], | |
"beginCaptures": { | |
"0": { | |
"name": "punctuation.definition.string.begin.ruby" | |
} | |
}, | |
"endCaptures": { | |
"0": { | |
"name": "punctuation.definition.string.end.ruby" | |
} | |
} | |
}, | |
{ | |
"name": "string.quoted.other.interpolated.ruby", | |
"begin": "%[Qx]?\\[", | |
"end": "]", | |
"patterns": [ | |
{ | |
"include": "#interpolated_ruby" | |
}, | |
{ | |
"include": "#escaped_char" | |
}, | |
{ | |
"include": "#nest_brackets_i" | |
} | |
], | |
"beginCaptures": { | |
"0": { | |
"name": "punctuation.definition.string.begin.ruby" | |
} | |
}, | |
"endCaptures": { | |
"0": { | |
"name": "punctuation.definition.string.end.ruby" | |
} | |
} | |
}, | |
{ | |
"name": "string.quoted.other.interpolated.ruby", | |
"begin": "%[Qx]?{", | |
"end": "}", | |
"patterns": [ | |
{ | |
"include": "#interpolated_ruby" | |
}, | |
{ | |
"include": "#escaped_char" | |
}, | |
{ | |
"include": "#nest_curly_i" | |
} | |
], | |
"beginCaptures": { | |
"0": { | |
"name": "punctuation.definition.string.begin.ruby" | |
} | |
}, | |
"endCaptures": { | |
"0": { | |
"name": "punctuation.definition.string.end.ruby" | |
} | |
} | |
}, | |
{ | |
"name": "string.quoted.other.interpolated.ruby", | |
"begin": "%[Qx]?\u003c", | |
"end": "\u003e", | |
"patterns": [ | |
{ | |
"include": "#interpolated_ruby" | |
}, | |
{ | |
"include": "#escaped_char" | |
}, | |
{ | |
"include": "#nest_ltgt_i" | |
} | |
], | |
"beginCaptures": { | |
"0": { | |
"name": "punctuation.definition.string.begin.ruby" | |
} | |
}, | |
"endCaptures": { | |
"0": { | |
"name": "punctuation.definition.string.end.ruby" | |
} | |
} | |
}, | |
{ | |
"name": "string.quoted.other.interpolated.ruby", | |
"begin": "%[Qx]([^\\w])", | |
"end": "\\1", | |
"patterns": [ | |
{ | |
"include": "#interpolated_ruby" | |
}, | |
{ | |
"include": "#escaped_char" | |
} | |
], | |
"beginCaptures": { | |
"0": { | |
"name": "punctuation.definition.string.begin.ruby" | |
} | |
}, | |
"endCaptures": { | |
"0": { | |
"name": "punctuation.definition.string.end.ruby" | |
} | |
} | |
}, | |
{ | |
"name": "string.quoted.other.interpolated.ruby", | |
"begin": "%([^\\w\\s=])", | |
"end": "\\1", | |
"patterns": [ | |
{ | |
"include": "#interpolated_ruby" | |
}, | |
{ | |
"include": "#escaped_char" | |
} | |
], | |
"beginCaptures": { | |
"0": { | |
"name": "punctuation.definition.string.begin.ruby" | |
} | |
}, | |
"endCaptures": { | |
"0": { | |
"name": "punctuation.definition.string.end.ruby" | |
} | |
} | |
}, | |
{ | |
"name": "string.quoted.other.ruby", | |
"begin": "%q\\(", | |
"end": "\\)", | |
"patterns": [ | |
{ | |
"name": "constant.character.escape.ruby", | |
"match": "\\\\\\)|\\\\\\\\" | |
}, | |
{ | |
"include": "#nest_parens" | |
} | |
], | |
"beginCaptures": { | |
"0": { | |
"name": "punctuation.definition.string.begin.ruby" | |
} | |
}, | |
"endCaptures": { | |
"0": { | |
"name": "punctuation.definition.string.end.ruby" | |
} | |
} | |
}, | |
{ | |
"name": "string.quoted.other.ruby", | |
"begin": "%q\u003c", | |
"end": "\u003e", | |
"patterns": [ | |
{ | |
"name": "constant.character.escape.ruby", | |
"match": "\\\\\u003e|\\\\\\\\" | |
}, | |
{ | |
"include": "#nest_ltgt" | |
} | |
], | |
"beginCaptures": { | |
"0": { | |
"name": "punctuation.definition.string.begin.ruby" | |
} | |
}, | |
"endCaptures": { | |
"0": { | |
"name": "punctuation.definition.string.end.ruby" | |
} | |
} | |
}, | |
{ | |
"name": "string.quoted.other.ruby", | |
"begin": "%q\\[", | |
"end": "]", | |
"patterns": [ | |
{ | |
"name": "constant.character.escape.ruby", | |
"match": "\\\\]|\\\\\\\\" | |
}, | |
{ | |
"include": "#nest_brackets" | |
} | |
], | |
"beginCaptures": { | |
"0": { | |
"name": "punctuation.definition.string.begin.ruby" | |
} | |
}, | |
"endCaptures": { | |
"0": { | |
"name": "punctuation.definition.string.end.ruby" | |
} | |
} | |
}, | |
{ | |
"name": "string.quoted.other.ruby", | |
"begin": "%q{", | |
"end": "}", | |
"patterns": [ | |
{ | |
"name": "constant.character.escape.ruby", | |
"match": "\\\\}|\\\\\\\\" | |
}, | |
{ | |
"include": "#nest_curly" | |
} | |
], | |
"beginCaptures": { | |
"0": { | |
"name": "punctuation.definition.string.begin.ruby" | |
} | |
}, | |
"endCaptures": { | |
"0": { | |
"name": "punctuation.definition.string.end.ruby" | |
} | |
} | |
}, | |
{ | |
"name": "string.quoted.other.ruby", | |
"begin": "%q([^\\w])", | |
"end": "\\1", | |
"patterns": [ | |
{ | |
"match": "\\\\." | |
} | |
], | |
"beginCaptures": { | |
"0": { | |
"name": "punctuation.definition.string.begin.ruby" | |
} | |
}, | |
"endCaptures": { | |
"0": { | |
"name": "punctuation.definition.string.end.ruby" | |
} | |
} | |
}, | |
{ | |
"name": "constant.other.symbol.ruby", | |
"begin": "%s\\(", | |
"end": "\\)", | |
"patterns": [ | |
{ | |
"name": "constant.character.escape.ruby", | |
"match": "\\\\\\)|\\\\\\\\" | |
}, | |
{ | |
"include": "#nest_parens" | |
} | |
], | |
"beginCaptures": { | |
"0": { | |
"name": "punctuation.definition.symbol.begin.ruby" | |
} | |
}, | |
"endCaptures": { | |
"0": { | |
"name": "punctuation.definition.symbol.end.ruby" | |
} | |
} | |
}, | |
{ | |
"name": "constant.other.symbol.ruby", | |
"begin": "%s\u003c", | |
"end": "\u003e", | |
"patterns": [ | |
{ | |
"name": "constant.character.escape.ruby", | |
"match": "\\\\\u003e|\\\\\\\\" | |
}, | |
{ | |
"include": "#nest_ltgt" | |
} | |
], | |
"beginCaptures": { | |
"0": { | |
"name": "punctuation.definition.symbol.begin.ruby" | |
} | |
}, | |
"endCaptures": { | |
"0": { | |
"name": "punctuation.definition.symbol.end.ruby" | |
} | |
} | |
}, | |
{ | |
"name": "constant.other.symbol.ruby", | |
"begin": "%s\\[", | |
"end": "]", | |
"patterns": [ | |
{ | |
"name": "constant.character.escape.ruby", | |
"match": "\\\\]|\\\\\\\\" | |
}, | |
{ | |
"include": "#nest_brackets" | |
} | |
], | |
"beginCaptures": { | |
"0": { | |
"name": "punctuation.definition.symbol.begin.ruby" | |
} | |
}, | |
"endCaptures": { | |
"0": { | |
"name": "punctuation.definition.symbol.end.ruby" | |
} | |
} | |
}, | |
{ | |
"name": "constant.other.symbol.ruby", | |
"begin": "%s{", | |
"end": "}", | |
"patterns": [ | |
{ | |
"name": "constant.character.escape.ruby", | |
"match": "\\\\}|\\\\\\\\" | |
}, | |
{ | |
"include": "#nest_curly" | |
} | |
], | |
"beginCaptures": { | |
"0": { | |
"name": "punctuation.definition.symbol.begin.ruby" | |
} | |
}, | |
"endCaptures": { | |
"0": { | |
"name": "punctuation.definition.symbol.end.ruby" | |
} | |
} | |
}, | |
{ | |
"name": "constant.other.symbol.ruby", | |
"begin": "%s([^\\w])", | |
"end": "\\1", | |
"patterns": [ | |
{ | |
"match": "\\\\." | |
} | |
], | |
"beginCaptures": { | |
"0": { | |
"name": "punctuation.definition.symbol.begin.ruby" | |
} | |
}, | |
"endCaptures": { | |
"0": { | |
"name": "punctuation.definition.symbol.end.ruby" | |
} | |
} | |
}, | |
{ | |
"name": "constant.other.symbol.ruby", | |
"match": "(?x)\n(?\u003c!:)(:)\n(?\u003e\n [$a-zA-Z_]\\w*(?\u003e[?!]|=(?![\u003e=]))?\n |\n ===?|\u003c=\u003e|\u003e[\u003e=]?|\u003c[\u003c=]?|[%\u0026`/\\|]|\\*\\*?|=?~|[-+]@?|\\[]=?\n |\n @@?[a-zA-Z_]\\w*\n)", | |
"captures": { | |
"1": { | |
"name": "punctuation.definition.constant.ruby" | |
} | |
} | |
}, | |
{ | |
"name": "comment.block.documentation.ruby", | |
"begin": "^=begin", | |
"end": "^=end", | |
"captures": { | |
"0": { | |
"name": "punctuation.definition.comment.ruby" | |
} | |
} | |
}, | |
{ | |
"begin": "(^[ \\t]+)?(?=#)", | |
"end": "(?!\\G)", | |
"patterns": [ | |
{ | |
"name": "comment.line.number-sign.ruby", | |
"begin": "#", | |
"end": "\\n", | |
"patterns": [ | |
{ | |
"include": "#yard" | |
} | |
], | |
"beginCaptures": { | |
"0": { | |
"name": "punctuation.definition.comment.ruby" | |
} | |
} | |
} | |
], | |
"beginCaptures": { | |
"1": { | |
"name": "punctuation.whitespace.comment.leading.ruby" | |
} | |
} | |
}, | |
{ | |
"name": "constant.numeric.ruby", | |
"match": "(?\u003c!\\w)\\?(\\\\(x[[:xdigit:]]{1,2}(?![[:xdigit:]])\\b|0[0-7]{0,2}(?![0-7])\\b|[^x0MC])|(\\\\[MC]-)+\\w|[^\\s\\\\])" | |
}, | |
{ | |
"contentName": "text.plain", | |
"begin": "^__END__\\n", | |
"end": "(?=not)impossible", | |
"patterns": [ | |
{ | |
"name": "text.html.embedded.ruby", | |
"begin": "(?=\u003c?xml|\u003c(?i:html\\b)|!DOCTYPE (?i:html\\b))", | |
"end": "(?=not)impossible", | |
"patterns": [ | |
{ | |
"include": "text.html.basic" | |
} | |
] | |
} | |
], | |
"captures": { | |
"0": { | |
"name": "string.unquoted.program-block.ruby" | |
} | |
} | |
}, | |
{ | |
"name": "meta.embedded.block.html", | |
"begin": "(?=(?\u003e\u003c\u003c[-~](\"?)((?:[_\\w]+_|)HTML)\\b\\1))", | |
"end": "(?!\\G)", | |
"patterns": [ | |
{ | |
"name": "string.unquoted.heredoc.ruby", | |
"contentName": "text.html", | |
"begin": "(?\u003e\u003c\u003c[-~](\"?)((?:[_\\w]+_|)HTML)\\b\\1)", | |
"end": "^\\s*\\2$\\n?", | |
"patterns": [ | |
{ | |
"include": "#heredoc" | |
}, | |
{ | |
"include": "#interpolated_ruby" | |
}, | |
{ | |
"include": "text.html.basic" | |
}, | |
{ | |
"include": "#escaped_char" | |
} | |
], | |
"beginCaptures": { | |
"0": { | |
"name": "punctuation.definition.string.begin.ruby" | |
} | |
}, | |
"endCaptures": { | |
"0": { | |
"name": "punctuation.definition.string.end.ruby" | |
} | |
} | |
} | |
] | |
}, | |
{ | |
"name": "meta.embedded.block.xml", | |
"begin": "(?=(?\u003e\u003c\u003c[-~](\"?)((?:[_\\w]+_|)XML)\\b\\1))", | |
"end": "(?!\\G)", | |
"patterns": [ | |
{ | |
"name": "string.unquoted.heredoc.ruby", | |
"contentName": "text.xml", | |
"begin": "(?\u003e\u003c\u003c[-~](\"?)((?:[_\\w]+_|)XML)\\b\\1)", | |
"end": "^\\s*\\2$\\n?", | |
"patterns": [ | |
{ | |
"include": "#heredoc" | |
}, | |
{ | |
"include": "#interpolated_ruby" | |
}, | |
{ | |
"include": "text.xml" | |
}, | |
{ | |
"include": "#escaped_char" | |
} | |
], | |
"beginCaptures": { | |
"0": { | |
"name": "punctuation.definition.string.begin.ruby" | |
} | |
}, | |
"endCaptures": { | |
"0": { | |
"name": "punctuation.definition.string.end.ruby" | |
} | |
} | |
} | |
] | |
}, | |
{ | |
"name": "meta.embedded.block.sql", | |
"begin": "(?=(?\u003e\u003c\u003c[-~](\"?)((?:[_\\w]+_|)SQL)\\b\\1))", | |
"end": "(?!\\G)", | |
"patterns": [ | |
{ | |
"name": "string.unquoted.heredoc.ruby", | |
"contentName": "source.sql", | |
"begin": "(?\u003e\u003c\u003c[-~](\"?)((?:[_\\w]+_|)SQL)\\b\\1)", | |
"end": "^\\s*\\2$\\n?", | |
"patterns": [ | |
{ | |
"include": "#heredoc" | |
}, | |
{ | |
"include": "#interpolated_ruby" | |
}, | |
{ | |
"include": "source.sql" | |
}, | |
{ | |
"include": "#escaped_char" | |
} | |
], | |
"beginCaptures": { | |
"0": { | |
"name": "punctuation.definition.string.begin.ruby" | |
} | |
}, | |
"endCaptures": { | |
"0": { | |
"name": "punctuation.definition.string.end.ruby" | |
} | |
} | |
} | |
] | |
}, | |
{ | |
"name": "meta.embedded.block.graphql", | |
"begin": "(?=(?\u003e\u003c\u003c[-~](\"?)((?:[_\\w]+_|)GRAPHQL)\\b\\1))", | |
"end": "(?!\\G)", | |
"patterns": [ | |
{ | |
"name": "string.unquoted.heredoc.ruby", | |
"contentName": "source.graphql", | |
"begin": "(?\u003e\u003c\u003c[-~](\"?)((?:[_\\w]+_|)GRAPHQL)\\b\\1)", | |
"end": "^\\s*\\2$\\n?", | |
"patterns": [ | |
{ | |
"include": "#heredoc" | |
}, | |
{ | |
"include": "#interpolated_ruby" | |
}, | |
{ | |
"include": "source.graphql" | |
}, | |
{ | |
"include": "#escaped_char" | |
} | |
], | |
"beginCaptures": { | |
"0": { | |
"name": "punctuation.definition.string.begin.ruby" | |
} | |
}, | |
"endCaptures": { | |
"0": { | |
"name": "punctuation.definition.string.end.ruby" | |
} | |
} | |
} | |
] | |
}, | |
{ | |
"name": "meta.embedded.block.css", | |
"begin": "(?=(?\u003e\u003c\u003c[-~](\"?)((?:[_\\w]+_|)CSS)\\b\\1))", | |
"end": "(?!\\G)", | |
"patterns": [ | |
{ | |
"name": "string.unquoted.heredoc.ruby", | |
"contentName": "source.css", | |
"begin": "(?\u003e\u003c\u003c[-~](\"?)((?:[_\\w]+_|)CSS)\\b\\1)", | |
"end": "^\\s*\\2$\\n?", | |
"patterns": [ | |
{ | |
"include": "#heredoc" | |
}, | |
{ | |
"include": "#interpolated_ruby" | |
}, | |
{ | |
"include": "source.css" | |
}, | |
{ | |
"include": "#escaped_char" | |
} | |
], | |
"beginCaptures": { | |
"0": { | |
"name": "punctuation.definition.string.begin.ruby" | |
} | |
}, | |
"endCaptures": { | |
"0": { | |
"name": "punctuation.definition.string.end.ruby" | |
} | |
} | |
} | |
] | |
}, | |
{ | |
"name": "meta.embedded.block.cpp", | |
"begin": "(?=(?\u003e\u003c\u003c[-~](\"?)((?:[_\\w]+_|)CPP)\\b\\1))", | |
"end": "(?!\\G)", | |
"patterns": [ | |
{ | |
"name": "string.unquoted.heredoc.ruby", | |
"contentName": "source.cpp", | |
"begin": "(?\u003e\u003c\u003c[-~](\"?)((?:[_\\w]+_|)CPP)\\b\\1)", | |
"end": "^\\s*\\2$\\n?", | |
"patterns": [ | |
{ | |
"include": "#heredoc" | |
}, | |
{ | |
"include": "#interpolated_ruby" | |
}, | |
{ | |
"include": "source.c++" | |
}, | |
{ | |
"include": "#escaped_char" | |
} | |
], | |
"beginCaptures": { | |
"0": { | |
"name": "punctuation.definition.string.begin.ruby" | |
} | |
}, | |
"endCaptures": { | |
"0": { | |
"name": "punctuation.definition.string.end.ruby" | |
} | |
} | |
} | |
] | |
}, | |
{ | |
"name": "meta.embedded.block.c", | |
"begin": "(?=(?\u003e\u003c\u003c[-~](\"?)((?:[_\\w]+_|)C)\\b\\1))", | |
"end": "(?!\\G)", | |
"patterns": [ | |
{ | |
"name": "string.unquoted.heredoc.ruby", | |
"contentName": "source.c", | |
"begin": "(?\u003e\u003c\u003c[-~](\"?)((?:[_\\w]+_|)C)\\b\\1)", | |
"end": "^\\s*\\2$\\n?", | |
"patterns": [ | |
{ | |
"include": "#heredoc" | |
}, | |
{ | |
"include": "#interpolated_ruby" | |
}, | |
{ | |
"include": "source.c" | |
}, | |
{ | |
"include": "#escaped_char" | |
} | |
], | |
"beginCaptures": { | |
"0": { | |
"name": "punctuation.definition.string.begin.ruby" | |
} | |
}, | |
"endCaptures": { | |
"0": { | |
"name": "punctuation.definition.string.end.ruby" | |
} | |
} | |
} | |
] | |
}, | |
{ | |
"name": "meta.embedded.block.js", | |
"begin": "(?=(?\u003e\u003c\u003c[-~](\"?)((?:[_\\w]+_|)(?:JS|JAVASCRIPT))\\b\\1))", | |
"end": "(?!\\G)", | |
"patterns": [ | |
{ | |
"name": "string.unquoted.heredoc.ruby", | |
"contentName": "source.js", | |
"begin": "(?\u003e\u003c\u003c[-~](\"?)((?:[_\\w]+_|)(?:JS|JAVASCRIPT))\\b\\1)", | |
"end": "^\\s*\\2$\\n?", | |
"patterns": [ | |
{ | |
"include": "#heredoc" | |
}, | |
{ | |
"include": "#interpolated_ruby" | |
}, | |
{ | |
"include": "source.js" | |
}, | |
{ | |
"include": "#escaped_char" | |
} | |
], | |
"beginCaptures": { | |
"0": { | |
"name": "punctuation.definition.string.begin.ruby" | |
} | |
}, | |
"endCaptures": { | |
"0": { | |
"name": "punctuation.definition.string.end.ruby" | |
} | |
} | |
} | |
] | |
}, | |
{ | |
"name": "meta.embedded.block.js.jquery", | |
"begin": "(?=(?\u003e\u003c\u003c[-~](\"?)((?:[_\\w]+_|)JQUERY)\\b\\1))", | |
"end": "(?!\\G)", | |
"patterns": [ | |
{ | |
"name": "string.unquoted.heredoc.ruby", | |
"contentName": "source.js.jquery", | |
"begin": "(?\u003e\u003c\u003c[-~](\"?)((?:[_\\w]+_|)JQUERY)\\b\\1)", | |
"end": "^\\s*\\2$\\n?", | |
"patterns": [ | |
{ | |
"include": "#heredoc" | |
}, | |
{ | |
"include": "#interpolated_ruby" | |
}, | |
{}, | |
{ | |
"include": "#escaped_char" | |
} | |
], | |
"beginCaptures": { | |
"0": { | |
"name": "punctuation.definition.string.begin.ruby" | |
} | |
}, | |
"endCaptures": { | |
"0": { | |
"name": "punctuation.definition.string.end.ruby" | |
} | |
} | |
} | |
] | |
}, | |
{ | |
"name": "meta.embedded.block.shell", | |
"begin": "(?=(?\u003e\u003c\u003c[-~](\"?)((?:[_\\w]+_|)(?:SH|SHELL))\\b\\1))", | |
"end": "(?!\\G)", | |
"patterns": [ | |
{ | |
"name": "string.unquoted.heredoc.ruby", | |
"contentName": "source.shell", | |
"begin": "(?\u003e\u003c\u003c[-~](\"?)((?:[_\\w]+_|)(?:SH|SHELL))\\b\\1)", | |
"end": "^\\s*\\2$\\n?", | |
"patterns": [ | |
{ | |
"include": "#heredoc" | |
}, | |
{ | |
"include": "#interpolated_ruby" | |
}, | |
{ | |
"include": "source.shell" | |
}, | |
{ | |
"include": "#escaped_char" | |
} | |
], | |
"beginCaptures": { | |
"0": { | |
"name": "punctuation.definition.string.begin.ruby" | |
} | |
}, | |
"endCaptures": { | |
"0": { | |
"name": "punctuation.definition.string.end.ruby" | |
} | |
} | |
} | |
] | |
}, | |
{ | |
"name": "meta.embedded.block.lua", | |
"begin": "(?=(?\u003e\u003c\u003c[-~](\"?)((?:[_\\w]+_|)LUA)\\b\\1))", | |
"end": "(?!\\G)", | |
"patterns": [ | |
{ | |
"name": "string.unquoted.heredoc.ruby", | |
"contentName": "source.lua", | |
"begin": "(?\u003e\u003c\u003c[-~](\"?)((?:[_\\w]+_|)LUA)\\b\\1)", | |
"end": "^\\s*\\2$\\n?", | |
"patterns": [ | |
{ | |
"include": "#heredoc" | |
}, | |
{ | |
"include": "#interpolated_ruby" | |
}, | |
{ | |
"include": "source.lua" | |
}, | |
{ | |
"include": "#escaped_char" | |
} | |
], | |
"beginCaptures": { | |
"0": { | |
"name": "punctuation.definition.string.begin.ruby" | |
} | |
}, | |
"endCaptures": { | |
"0": { | |
"name": "punctuation.definition.string.end.ruby" | |
} | |
} | |
} | |
] | |
}, | |
{ | |
"name": "meta.embedded.block.ruby", | |
"begin": "(?=(?\u003e\u003c\u003c[-~](\"?)((?:[_\\w]+_|)RUBY)\\b\\1))", | |
"end": "(?!\\G)", | |
"patterns": [ | |
{ | |
"name": "string.unquoted.heredoc.ruby", | |
"contentName": "source.ruby", | |
"begin": "(?\u003e\u003c\u003c[-~](\"?)((?:[_\\w]+_|)RUBY)\\b\\1)", | |
"end": "^\\s*\\2$\\n?", | |
"patterns": [ | |
{ | |
"include": "#heredoc" | |
}, | |
{ | |
"include": "#interpolated_ruby" | |
}, | |
{ | |
"include": "source.ruby" | |
}, | |
{ | |
"include": "#escaped_char" | |
} | |
], | |
"beginCaptures": { | |
"0": { | |
"name": "punctuation.definition.string.begin.ruby" | |
} | |
}, | |
"endCaptures": { | |
"0": { | |
"name": "punctuation.definition.string.end.ruby" | |
} | |
} | |
} | |
] | |
}, | |
{ | |
"name": "string.unquoted.heredoc.ruby", | |
"begin": "(?\u003e=\\s*\u003c\u003c(\\w+))", | |
"end": "^\\1$", | |
"patterns": [ | |
{ | |
"include": "#heredoc" | |
}, | |
{ | |
"include": "#interpolated_ruby" | |
}, | |
{ | |
"include": "#escaped_char" | |
} | |
], | |
"beginCaptures": { | |
"0": { | |
"name": "punctuation.definition.string.begin.ruby" | |
} | |
}, | |
"endCaptures": { | |
"0": { | |
"name": "punctuation.definition.string.end.ruby" | |
} | |
} | |
}, | |
{ | |
"name": "string.unquoted.heredoc.ruby", | |
"begin": "(?\u003e((\u003c\u003c[-~](\\w+),\\s?)*\u003c\u003c[-~](\\w+)))", | |
"end": "^\\s*\\4$", | |
"patterns": [ | |
{ | |
"include": "#heredoc" | |
}, | |
{ | |
"include": "#interpolated_ruby" | |
}, | |
{ | |
"include": "#escaped_char" | |
} | |
], | |
"beginCaptures": { | |
"0": { | |
"name": "punctuation.definition.string.begin.ruby" | |
} | |
}, | |
"endCaptures": { | |
"0": { | |
"name": "punctuation.definition.string.end.ruby" | |
} | |
} | |
}, | |
{ | |
"begin": "(?\u003c={|{\\s|[^A-Za-z0-9_]do|^do|[^A-Za-z0-9_]do\\s|^do\\s)(\\|)", | |
"end": "(?\u003c!\\|)(\\|)(?!\\|)", | |
"patterns": [ | |
{ | |
"include": "source.ruby" | |
}, | |
{ | |
"name": "variable.other.block.ruby", | |
"match": "[_a-zA-Z][_a-zA-Z0-9]*" | |
}, | |
{ | |
"name": "punctuation.separator.variable.ruby", | |
"match": "," | |
} | |
], | |
"captures": { | |
"1": { | |
"name": "punctuation.separator.variable.ruby" | |
} | |
} | |
}, | |
{ | |
"name": "punctuation.separator.key-value", | |
"match": "=\u003e" | |
}, | |
{ | |
"name": "support.function.kernel.ruby", | |
"match": "-\u003e" | |
}, | |
{ | |
"name": "keyword.operator.assignment.augmented.ruby", | |
"match": "\u003c\u003c=|%=|\u0026{1,2}=|\\*=|\\*\\*=|\\+=|-=|\\^=|\\|{1,2}=|\u003c\u003c" | |
}, | |
{ | |
"name": "keyword.operator.comparison.ruby", | |
"match": "\u003c=\u003e|\u003c(?!\u003c|=)|\u003e(?!\u003c|=|\u003e)|\u003c=|\u003e=|===|==|=~|!=|!~|(?\u003c=[ \\t])\\?" | |
}, | |
{ | |
"name": "keyword.operator.logical.ruby", | |
"match": "(?\u003c!\\.)\\b(and|not|or)\\b(?![?!])" | |
}, | |
{ | |
"name": "keyword.operator.logical.ruby", | |
"match": "(?\u003c=^|[ \\t])!|\u0026\u0026|\\|\\||\\^" | |
}, | |
{ | |
"match": "(\u0026\\.)\\s*(?![A-Z])", | |
"captures": { | |
"1": { | |
"name": "punctuation.separator.method.ruby" | |
} | |
} | |
}, | |
{ | |
"name": "keyword.operator.arithmetic.ruby", | |
"match": "(%|\u0026|\\*\\*|\\*|\\+|-|/)" | |
}, | |
{ | |
"name": "keyword.operator.assignment.ruby", | |
"match": "=" | |
}, | |
{ | |
"name": "keyword.operator.other.ruby", | |
"match": "\\||~|\u003e\u003e" | |
}, | |
{ | |
"name": "punctuation.separator.statement.ruby", | |
"match": ";" | |
}, | |
{ | |
"name": "punctuation.separator.object.ruby", | |
"match": "," | |
}, | |
{ | |
"match": "(::)\\s*(?=[A-Z])", | |
"captures": { | |
"1": { | |
"name": "punctuation.separator.namespace.ruby" | |
} | |
} | |
}, | |
{ | |
"match": "(\\.|::)\\s*(?![A-Z])", | |
"captures": { | |
"1": { | |
"name": "punctuation.separator.method.ruby" | |
} | |
} | |
}, | |
{ | |
"name": "punctuation.separator.other.ruby", | |
"match": ":" | |
}, | |
{ | |
"name": "punctuation.section.scope.begin.ruby", | |
"match": "{" | |
}, | |
{ | |
"name": "punctuation.section.scope.end.ruby", | |
"match": "}" | |
}, | |
{ | |
"name": "punctuation.section.array.begin.ruby", | |
"match": "\\[" | |
}, | |
{ | |
"name": "punctuation.section.array.end.ruby", | |
"match": "]" | |
}, | |
{ | |
"name": "punctuation.section.function.ruby", | |
"match": "\\(|\\)" | |
} | |
], | |
"repository": { | |
"escaped_char": { | |
"name": "constant.character.escape.ruby", | |
"match": "\\\\(?:[0-7]{1,3}|x[\\da-fA-F]{1,2}|.)" | |
}, | |
"heredoc": { | |
"begin": "^\u003c\u003c[-~]?\\w+", | |
"end": "$", | |
"patterns": [ | |
{ | |
"include": "$self" | |
} | |
] | |
}, | |
"interpolated_ruby": { | |
"patterns": [ | |
{ | |
"name": "meta.embedded.line.ruby", | |
"contentName": "source.ruby", | |
"begin": "#{", | |
"end": "}", | |
"patterns": [ | |
{ | |
"include": "#nest_curly_and_self" | |
}, | |
{ | |
"include": "$self" | |
} | |
], | |
"beginCaptures": { | |
"0": { | |
"name": "punctuation.section.embedded.begin.ruby" | |
} | |
}, | |
"endCaptures": { | |
"0": { | |
"name": "punctuation.section.embedded.end.ruby" | |
} | |
} | |
}, | |
{ | |
"name": "variable.other.readwrite.instance.ruby", | |
"match": "(#@)[a-zA-Z_]\\w*", | |
"captures": { | |
"1": { | |
"name": "punctuation.definition.variable.ruby" | |
} | |
} | |
}, | |
{ | |
"name": "variable.other.readwrite.class.ruby", | |
"match": "(#@@)[a-zA-Z_]\\w*", | |
"captures": { | |
"1": { | |
"name": "punctuation.definition.variable.ruby" | |
} | |
} | |
}, | |
{ | |
"name": "variable.other.readwrite.global.ruby", | |
"match": "(#\\$)[a-zA-Z_]\\w*", | |
"captures": { | |
"1": { | |
"name": "punctuation.definition.variable.ruby" | |
} | |
} | |
} | |
] | |
}, | |
"nest_brackets": { | |
"begin": "\\[", | |
"end": "]", | |
"patterns": [ | |
{ | |
"include": "#nest_brackets" | |
} | |
], | |
"captures": { | |
"0": { | |
"name": "punctuation.section.scope.ruby" | |
} | |
} | |
}, | |
"nest_brackets_i": { | |
"begin": "\\[", | |
"end": "]", | |
"patterns": [ | |
{ | |
"include": "#interpolated_ruby" | |
}, | |
{ | |
"include": "#escaped_char" | |
}, | |
{ | |
"include": "#nest_brackets_i" | |
} | |
], | |
"captures": { | |
"0": { | |
"name": "punctuation.section.scope.ruby" | |
} | |
} | |
}, | |
"nest_brackets_r": { | |
"begin": "\\[", | |
"end": "]", | |
"patterns": [ | |
{ | |
"include": "#regex_sub" | |
}, | |
{ | |
"include": "#nest_brackets_r" | |
} | |
], | |
"captures": { | |
"0": { | |
"name": "punctuation.section.scope.ruby" | |
} | |
} | |
}, | |
"nest_curly": { | |
"begin": "{", | |
"end": "}", | |
"patterns": [ | |
{ | |
"include": "#nest_curly" | |
} | |
], | |
"captures": { | |
"0": { | |
"name": "punctuation.section.scope.ruby" | |
} | |
} | |
}, | |
"nest_curly_and_self": { | |
"patterns": [ | |
{ | |
"begin": "{", | |
"end": "}", | |
"patterns": [ | |
{ | |
"include": "#nest_curly_and_self" | |
} | |
], | |
"captures": { | |
"0": { | |
"name": "punctuation.section.scope.ruby" | |
} | |
} | |
}, | |
{ | |
"include": "$self" | |
} | |
] | |
}, | |
"nest_curly_i": { | |
"begin": "{", | |
"end": "}", | |
"patterns": [ | |
{ | |
"include": "#interpolated_ruby" | |
}, | |
{ | |
"include": "#escaped_char" | |
}, | |
{ | |
"include": "#nest_curly_i" | |
} | |
], | |
"captures": { | |
"0": { | |
"name": "punctuation.section.scope.ruby" | |
} | |
} | |
}, | |
"nest_curly_r": { | |
"begin": "{", | |
"end": "}", | |
"patterns": [ | |
{ | |
"include": "#regex_sub" | |
}, | |
{ | |
"include": "#nest_curly_r" | |
} | |
], | |
"captures": { | |
"0": { | |
"name": "punctuation.section.scope.ruby" | |
} | |
} | |
}, | |
"nest_ltgt": { | |
"begin": "\u003c", | |
"end": "\u003e", | |
"patterns": [ | |
{ | |
"include": "#nest_ltgt" | |
} | |
], | |
"captures": { | |
"0": { | |
"name": "punctuation.section.scope.ruby" | |
} | |
} | |
}, | |
"nest_ltgt_i": { | |
"begin": "\u003c", | |
"end": "\u003e", | |
"patterns": [ | |
{ | |
"include": "#interpolated_ruby" | |
}, | |
{ | |
"include": "#escaped_char" | |
}, | |
{ | |
"include": "#nest_ltgt_i" | |
} | |
], | |
"captures": { | |
"0": { | |
"name": "punctuation.section.scope.ruby" | |
} | |
} | |
}, | |
"nest_ltgt_r": { | |
"begin": "\u003c", | |
"end": "\u003e", | |
"patterns": [ | |
{ | |
"include": "#regex_sub" | |
}, | |
{ | |
"include": "#nest_ltgt_r" | |
} | |
], | |
"captures": { | |
"0": { | |
"name": "punctuation.section.scope.ruby" | |
} | |
} | |
}, | |
"nest_parens": { | |
"begin": "\\(", | |
"end": "\\)", | |
"patterns": [ | |
{ | |
"include": "#nest_parens" | |
} | |
], | |
"captures": { | |
"0": { | |
"name": "punctuation.section.scope.ruby" | |
} | |
} | |
}, | |
"nest_parens_i": { | |
"begin": "\\(", | |
"end": "\\)", | |
"patterns": [ | |
{ | |
"include": "#interpolated_ruby" | |
}, | |
{ | |
"include": "#escaped_char" | |
}, | |
{ | |
"include": "#nest_parens_i" | |
} | |
], | |
"captures": { | |
"0": { | |
"name": "punctuation.section.scope.ruby" | |
} | |
} | |
}, | |
"nest_parens_r": { | |
"begin": "\\(", | |
"end": "\\)", | |
"patterns": [ | |
{ | |
"include": "#regex_sub" | |
}, | |
{ | |
"include": "#nest_parens_r" | |
} | |
], | |
"captures": { | |
"0": { | |
"name": "punctuation.section.scope.ruby" | |
} | |
} | |
}, | |
"regex_sub": { | |
"patterns": [ | |
{ | |
"include": "#interpolated_ruby" | |
}, | |
{ | |
"include": "#escaped_char" | |
}, | |
{ | |
"name": "string.regexp.arbitrary-repetition.ruby", | |
"match": "({)\\d+(,\\d+)?(})", | |
"captures": { | |
"1": { | |
"name": "punctuation.definition.arbitrary-repetition.ruby" | |
}, | |
"3": { | |
"name": "punctuation.definition.arbitrary-repetition.ruby" | |
} | |
} | |
}, | |
{ | |
"name": "string.regexp.character-class.ruby", | |
"begin": "\\[(?:\\^?])?", | |
"end": "]", | |
"patterns": [ | |
{ | |
"include": "#escaped_char" | |
} | |
], | |
"captures": { | |
"0": { | |
"name": "punctuation.definition.character-class.ruby" | |
} | |
} | |
}, | |
{ | |
"name": "comment.line.number-sign.ruby", | |
"begin": "\\(\\?#", | |
"end": "\\)", | |
"patterns": [ | |
{ | |
"include": "#escaped_char" | |
} | |
], | |
"beginCaptures": { | |
"0": { | |
"name": "punctuation.definition.comment.begin.ruby" | |
} | |
}, | |
"endCaptures": { | |
"0": { | |
"name": "punctuation.definition.comment.end.ruby" | |
} | |
} | |
}, | |
{ | |
"name": "string.regexp.group.ruby", | |
"begin": "\\(", | |
"end": "\\)", | |
"patterns": [ | |
{ | |
"include": "#regex_sub" | |
} | |
], | |
"captures": { | |
"0": { | |
"name": "punctuation.definition.group.ruby" | |
} | |
} | |
}, | |
{ | |
"name": "comment.line.number-sign.ruby", | |
"begin": "(?\u003c=^|\\s)(#)\\s(?=[[a-zA-Z0-9,. \\t?!-][^\\x{00}-\\x{7F}]]*$)", | |
"end": "$\\n?", | |
"beginCaptures": { | |
"1": { | |
"name": "punctuation.definition.comment.ruby" | |
} | |
}, | |
"endCaptures": { | |
"0": { | |
"name": "punctuation.definition.comment.ruby" | |
} | |
} | |
} | |
] | |
}, | |
"yard": { | |
"name": "comment.line.yard.ruby", | |
"patterns": [ | |
{ | |
"include": "#yard_comment" | |
}, | |
{ | |
"include": "#yard_name_types" | |
}, | |
{ | |
"include": "#yard_tag" | |
}, | |
{ | |
"include": "#yard_types" | |
}, | |
{ | |
"include": "#yard_directive" | |
} | |
] | |
}, | |
"yard_comment": { | |
"match": "(@)(abstract|api|author|deprecated|example|note|overload|since|todo|version)(?=\\s)(.*)$", | |
"captures": { | |
"1": { | |
"name": "comment.line.keyword.punctuation.yard.ruby" | |
}, | |
"2": { | |
"name": "comment.line.keyword.yard.ruby" | |
}, | |
"3": { | |
"name": "comment.line.string.yard.ruby" | |
} | |
} | |
}, | |
"yard_directive": { | |
"match": "(@!)(attribute|endgroup|group|macro|method|parse|scope|visibility)(\\s+((\\[).+(])))?(?=\\s)(.*)$", | |
"captures": { | |
"1": { | |
"name": "comment.line.keyword.punctuation.yard.ruby" | |
}, | |
"2": { | |
"name": "comment.line.keyword.yard.ruby" | |
}, | |
"3": { | |
"name": "comment.line.yard.ruby" | |
}, | |
"4": { | |
"name": "comment.line.type.yard.ruby" | |
}, | |
"5": { | |
"name": "comment.line.punctuation.yard.ruby" | |
}, | |
"6": { | |
"name": "comment.line.punctuation.yard.ruby" | |
}, | |
"7": { | |
"name": "comment.line.string.yard.ruby" | |
} | |
} | |
}, | |
"yard_name_types": { | |
"match": "(@)(attr|attr_reader|attr_writer|option|param|see|yieldparam)(?=\\s)(\\s+([a-z_][a-zA-Z_]*))?(\\s+((\\[).+(])))?(.*)$", | |
"captures": { | |
"1": { | |
"name": "comment.line.keyword.punctuation.yard.ruby" | |
}, | |
"2": { | |
"name": "comment.line.keyword.yard.ruby" | |
}, | |
"3": { | |
"name": "comment.line.yard.ruby" | |
}, | |
"4": { | |
"name": "comment.line.parameter.yard.ruby" | |
}, | |
"5": { | |
"name": "comment.line.yard.ruby" | |
}, | |
"6": { | |
"name": "comment.line.type.yard.ruby" | |
}, | |
"7": { | |
"name": "comment.line.punctuation.yard.ruby" | |
}, | |
"8": { | |
"name": "comment.line.punctuation.yard.ruby" | |
}, | |
"9": { | |
"name": "comment.line.string.yard.ruby" | |
} | |
} | |
}, | |
"yard_tag": { | |
"match": "(@)(private)$", | |
"captures": { | |
"1": { | |
"name": "comment.line.keyword.punctuation.yard.ruby" | |
}, | |
"2": { | |
"name": "comment.line.keyword.yard.ruby" | |
} | |
} | |
}, | |
"yard_types": { | |
"match": "(@)(raise|return|yield(?:return)?)(?=\\s)(\\s+((\\[).+(])))?(.*)$", | |
"captures": { | |
"1": { | |
"name": "comment.line.keyword.punctuation.yard.ruby" | |
}, | |
"2": { | |
"name": "comment.line.keyword.yard.ruby" | |
}, | |
"3": { | |
"name": "comment.line.yard.ruby" | |
}, | |
"4": { | |
"name": "comment.line.type.yard.ruby" | |
}, | |
"5": { | |
"name": "comment.line.punctuation.yard.ruby" | |
}, | |
"6": { | |
"name": "comment.line.punctuation.yard.ruby" | |
}, | |
"7": { | |
"name": "comment.line.string.yard.ruby" | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment