{ "name": "Crystal", "scopeName": "source.crystal", "patterns": [ { "name": "meta.class.crystal", "match": "^\\s*(?:(abstract)\\s+)?(class|struct|def)\\s+([.\\w\\d_:]+)(?:(\\()([.\\w\\d_:]+)(\\)))?(?:\\s+(\u003c)\\s+([.\\w\\d_:]+))?", "captures": { "1": { "name": "keyword.control.abstract.crystal" }, "2": { "name": "keyword.control.class.crystal" }, "3": { "name": "entity.name.type.class.crystal" }, "4": { "name": "punctuation.section.function.crystal" }, "5": { "name": "entity.name.type.generic.crystal" }, "6": { "name": "punctuation.section.function.crystal" }, "7": { "name": "punctuation.separator.inheritance.crystal" }, "8": { "name": "entity.other.inherited-class.crystal" } } }, { "name": "meta.class.crystal", "match": "^\\s*(struct)\\s+(?:([.\\w\\d_:]+)(?:\\s+(\u003c)\\s+([.\\w\\d_:]+))?)", "captures": { "1": { "name": "keyword.control.struct.crystal" }, "2": { "name": "entity.name.type.struct.crystal" }, "3": { "name": "punctuation.separator.inheritance.crystal" }, "4": { "name": "entity.other.inherited-struct.crystal" } } }, { "name": "meta.module.crystal", "match": "^\\s*(module)\\s+([.\\w\\d_:]+)", "captures": { "1": { "name": "keyword.control.module.crystal" }, "2": { "name": "entity.name.type.module.crystal" } } }, { "name": "meta.enum.crystal", "match": "^\\s*(enum)\\s+([.\\w\\d_:]+)", "captures": { "1": { "name": "keyword.control.enum.crystal" }, "2": { "name": "entity.name.type.enum.crystal" } } }, { "name": "meta.module.crystal", "match": "^\\s*(lib)\\s+([.\\w\\d_]+)", "captures": { "1": { "name": "keyword.control.lib.crystal" }, "2": { "name": "entity.name.type.lib.crystal" } } }, { "name": "constant.other.symbol.hashkey.crystal", "match": "(?\u003e[a-zA-Z_]\\w*(?\u003e[?!])?)(:)(?!:)", "captures": { "1": { "name": "punctuation.definition.constant.hashkey.crystal" } } }, { "name": "constant.other.symbol.hashkey.crystal", "match": "(?\u003c!:)(:)(?\u003e[a-zA-Z_]\\w*(?\u003e[?!])?)(?=\\s*=\u003e)", "captures": { "1": { "name": "punctuation.definition.constant.crystal" } } }, { "name": "keyword.control.crystal", "match": "(?\u003c!\\.)\\b(BEGIN|begin|case|class|else|elsif|END|end|ensure|forall|for|if|ifdef|in|module|rescue|struct|then|unless|until|when|while)\\b(?![?!])" }, { "name": "keyword.control.start-block.crystal", "match": "(?\u003c!\\.)\\bdo\\b\\S*" }, { "name": "meta.syntax.crystal.start-block", "match": "(?\u003c=\\{)(\\s+)" }, { "name": "keyword.operator.logical.crystal", "match": "(?\u003c!\\.)\\b(and|not|or)\\b" }, { "name": "keyword.control.pseudo-method.crystal", "match": "(?\u003c!\\.)\\b(alias|alias_method|break|next|redo|retry|return|super|type|undef|yield|out|pointerof|typeof)\\b(?![?!])|\\bdefined\\?|\\bblock_given\\?" }, { "name": "constant.language.nil.crystal", "match": "\\bnil\\b(?![?!])" }, { "name": "constant.language.boolean.crystal", "match": "\\b(true|false)\\b(?![?!])" }, { "name": "variable.language.crystal", "match": "\\b(__(FILE|LINE)__)\\b(?![?!])" }, { "name": "variable.language.self.crystal", "match": "\\bself\\b(?![?!])" }, { "name": "keyword.other.special-method.crystal", "match": "((?\u003c=\\s)|(?\u003c=^))\\b(initialize|new|loop|include|extend|prepend|raise|fail|getter(?:[?])?|setter(?:[?])?|property(?:[?])?|catch|throw)\\b\\w?((?=\\s)|(?=$))" }, { "name": "meta.require.crystal", "begin": "\\b(?\u003c!\\.|::)(require)\\b", "end": "$|(?=#|\\})", "patterns": [ { "include": "$self" } ], "captures": { "1": { "name": "keyword.other.special-method.crystal" } } }, { "name": "variable.other.readwrite.instance.crystal", "match": "(@)[a-zA-Z_]\\w*", "captures": { "1": { "name": "punctuation.definition.variable.crystal" } } }, { "name": "variable.other.readwrite.class.crystal", "match": "(@@)[a-zA-Z_]\\w*", "captures": { "1": { "name": "punctuation.definition.variable.crystal" } } }, { "name": "variable.other.readwrite.global.crystal", "match": "(\\$)[a-zA-Z_]\\w*", "captures": { "1": { "name": "punctuation.definition.variable.crystal" } } }, { "name": "variable.other.readwrite.global.pre-defined.crystal", "match": "(\\$)(!|@|\u0026|`|'|\\+|\\d+|~|=|/|\\\\|,|;|\\.|\u003c|\u003e|_|\\*|\\$|\\?|:|\"|-[0adFiIlpv])", "captures": { "1": { "name": "punctuation.definition.variable.crystal" } } }, { "name": "meta.environment-variable.crystal", "begin": "\\b(ENV)\\[", "end": "\\]", "patterns": [ { "include": "$self" } ], "beginCaptures": { "1": { "name": "variable.other.constant.crystal" } } }, { "name": "support.class.crystal", "match": "\\b[A-Z]\\w*(?=((\\.|::)[A-Za-z]|\\[))" }, { "name": "support.struct.crystal", "match": "\\b(Nil|Int|Int8|Int16|Int32|Int64|UInt8|UInt16|UInt32|UInt64|Float32|Float64|Set|Slice|Float|Number|StaticArray|Symbol|BigFloat|BigInt|BigRational|BitArray|Bool|Char|Atomic|Complex|Time|String|Tuple|NamedTuple|Proc|Union|Pointer|Range)\\b\\w?" }, { "name": "support.function.kernel.crystal", "match": "((?\u003c=\\s)|(?\u003c=^))\\b(abort|at_exit|autoload\\??|binding|callcc|caller|caller_locations|chomp|chop|eval|exec|exit|exit!|fork|format|gets|global_variables|gsub|iterator\\?|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\\w?((?=\\s)|(?=$))" }, { "name": "variable.other.constant.crystal", "match": "\\b[A-Z]\\w*\\b" }, { "name": "meta.function.method.with-arguments.crystal", "begin": "\\b(?:(private|protected)\\s+)?(def|macro)\\s+(\\S+)\\s*(\\()", "end": "\\)", "patterns": [ { "begin": "(?![\\s,)])", "end": "(?=[,)])", "patterns": [ { "match": "\\G([\u0026*]?)([_a-zA-Z][_a-zA-Z0-9]*)", "captures": { "1": { "name": "storage.type.variable.crystal" }, "2": { "name": "variable.parameter.function.crystal" } } }, { "include": "$self" } ] } ], "beginCaptures": { "1": { "name": "keyword.control.visibility.crystal" }, "2": { "name": "keyword.control.def.crystal" }, "3": { "name": "entity.name.function.crystal" }, "4": { "name": "punctuation.definition.parameters.crystal" } }, "endCaptures": { "0": { "name": "punctuation.definition.parameters.crystal" } } }, { "name": "meta.function.method.with-arguments.crystal", "begin": "\\b(fun)\\s+(\\S+)(?:\\s+(=)\\s+(\\S+))?\\s*(\\()", "end": "\\)", "patterns": [ { "begin": "(?![\\s,)])", "end": "(?=[,)])", "patterns": [ { "match": "\\G([\u0026*]?)([_a-zA-Z][_a-zA-Z0-9]*)", "captures": { "1": { "name": "storage.type.variable.crystal" }, "2": { "name": "variable.parameter.function.crystal" } } }, { "include": "$self" } ] } ], "beginCaptures": { "1": { "name": "keyword.control.function.crystal" }, "2": { "name": "entity.name.function.crystal" }, "4": { "name": "entity.name.function.crystal" }, "5": { "name": "punctuation.definition.parameters.crystal" } }, "endCaptures": { "0": { "name": "punctuation.definition.parameters.crystal" } } }, { "name": "meta.function.method.with-arguments.crystal", "begin": "\\b(?:(private|protected)\\s+)?(def|macro)\\s+(\\S+)", "end": "$", "patterns": [ { "begin": "(?![\\s,])", "end": "(?=,|$)", "patterns": [ { "name": "variable.parameter.function.crystal", "match": "\\G([\u0026*]?)[_a-zA-Z][_a-zA-Z0-9]*", "captures": { "1": { "name": "punctuation.definition.variable.crystal" } } }, { "include": "$self" } ] } ], "beginCaptures": { "1": { "name": "keyword.control.visibility.crystal" }, "2": { "name": "keyword.control.def.crystal" }, "3": { "name": "entity.name.function.crystal" } } }, { "name": "meta.function.method.without-arguments.crystal", "match": "\\b(?:(private|protected)\\s+)?(def|macro)\\s+(\\S+)", "captures": { "1": { "name": "keyword.control.visibility.crystal" }, "2": { "name": "keyword.control.def.crystal" }, "3": { "name": "entity.name.function.crystal" } } }, { "name": "constant.numeric.hexadecimal.crystal", "match": "0x[A-Fa-f0-9]+" }, { "name": "constant.numeric.octal.crystal", "match": "0o[0-7]+" }, { "name": "constant.numeric.binary.crystal", "match": "0b[10]+" }, { "name": "constant.numeric.crystal", "match": "((((?\u003c=\\s)\\d*)|(^\\d*)|((?\u003c=[\\s\u0026\\|^eE\u003c\u003e%*!\\/=\\[\\](){};,+-])))(((((?\u003c=\\d)((\\.){0,1}|(\\.{3})))|([+-]*))((\\d+\\_*)+)\\.?(((?\u003c=[eE])[+-]?))?\\d*)|((?\u003c=\\d)(_\\d+)+\\.?\\d*))(((?\u003c=\\d)[eE]?\\d*)(?=[.eE\\s_iuf\u0026\\|^\u003c\u003e%*!\\/=\\[\\](){};,+-])|($))|((?\u003c=\\d)\\.{3}\\w*(?=\\))))" }, { "name": "entity.name.type.unsigned-int.crystal", "match": "((?\u003c=\\d_)|(?\u003c=\\d))(u(8|16|32|64))(?!\\w)" }, { "name": "entity.name.type.signed-int.crystal", "match": "((?\u003c=\\d_)|(?\u003c=\\d))(i(8|16|32|64))(?!\\w)" }, { "name": "entity.name.type.float.crystal", "match": "((?\u003c=\\d_)|(?\u003c=\\d))(f(32|64))(?!\\w)" }, { "name": "constant.other.symbol.crystal", "begin": ":'", "end": "'", "patterns": [ { "name": "constant.character.escape.crystal", "match": "\\\\['\\\\]" } ], "beginCaptures": { "0": { "name": "punctuation.definition.symbol.begin.crystal" } }, "endCaptures": { "0": { "name": "punctuation.definition.symbol.end.crystal" } } }, { "name": "constant.other.symbol.interpolated.crystal", "begin": ":\"", "end": "\"", "patterns": [ { "include": "#interpolated_crystal" }, { "include": "#escaped_char" } ], "beginCaptures": { "0": { "name": "punctuation.section.symbol.begin.crystal" } }, "endCaptures": { "0": { "name": "punctuation.section.symbol.end.crystal" } } }, { "name": "keyword.operator.assignment.augmented.crystal", "match": "(?\u003c!\\()/=" }, { "name": "string.quoted.single.crystal", "begin": "'", "end": "'", "patterns": [ { "name": "constant.character.escape.crystal", "match": "\\\\'|\\\\\\\\" } ], "beginCaptures": { "0": { "name": "punctuation.definition.char.begin.crystal" } }, "endCaptures": { "0": { "name": "punctuation.definition.char.end.crystal" } } }, { "name": "string.quoted.double.crystal", "begin": "\"", "end": "\"", "patterns": [ { "include": "#interpolated_crystal" }, { "include": "#escaped_char" } ], "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.crystal" } }, "endCaptures": { "0": { "name": "punctuation.definition.string.end.crystal" } } }, { "name": "string.interpolated.crystal", "begin": "`", "end": "`", "patterns": [ { "include": "#interpolated_crystal" }, { "include": "#escaped_char" } ], "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.crystal" } }, "endCaptures": { "0": { "name": "punctuation.definition.string.end.crystal" } } }, { "name": "string.interpolated.crystal", "begin": "%x\\{", "end": "\\}", "patterns": [ { "include": "#interpolated_crystal" }, { "include": "#escaped_char" }, { "include": "#nest_curly_i" } ], "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.crystal" } }, "endCaptures": { "0": { "name": "punctuation.definition.string.end.crystal" } } }, { "name": "string.interpolated.crystal", "begin": "%x\\[", "end": "\\]", "patterns": [ { "include": "#interpolated_crystal" }, { "include": "#escaped_char" }, { "include": "#nest_brackets_i" } ], "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.crystal" } }, "endCaptures": { "0": { "name": "punctuation.definition.string.end.crystal" } } }, { "name": "string.interpolated.crystal", "begin": "%x\\\u003c", "end": "\\\u003e", "patterns": [ { "include": "#interpolated_crystal" }, { "include": "#escaped_char" }, { "include": "#nest_ltgt_i" } ], "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.crystal" } }, "endCaptures": { "0": { "name": "punctuation.definition.string.end.crystal" } } }, { "name": "string.interpolated.crystal", "begin": "%x\\(", "end": "\\)", "patterns": [ { "include": "#interpolated_crystal" }, { "include": "#escaped_char" }, { "include": "#nest_parens_i" } ], "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.crystal" } }, "endCaptures": { "0": { "name": "punctuation.definition.string.end.crystal" } } }, { "name": "string.interpolated.crystal", "begin": "%x([^\\w])", "end": "\\1", "patterns": [ { "include": "#interpolated_crystal" }, { "include": "#escaped_char" } ], "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.crystal" } }, "endCaptures": { "0": { "name": "punctuation.definition.string.end.crystal" } } }, { "contentName": "string.regexp.interpolated.crystal", "begin": "(?\u003c![\\w)])((/))(?![*+?])(?=(?:\\\\/|[^/])*/[eimnosux]*\\s*([\\]#).,?:}]|$|\\|\\||\u0026\u0026|\u003c=\u003e|=\u003e|==|=~|!~|!=|;|if|else|elsif|then|do|end|unless|while|until|or|and))", "end": "((/[eimnosux]*))(?=[^eimnosux])", "patterns": [ { "include": "#regex_sub" } ], "captures": { "1": { "name": "string.regexp.interpolated.crystal" }, "2": { "name": "punctuation.section.regexp.crystal" } } }, { "name": "string.regexp.interpolated.crystal", "begin": "%r\\{", "end": "\\}[eimnosux]*", "patterns": [ { "include": "#regex_sub" }, { "include": "#nest_curly_r" } ], "beginCaptures": { "0": { "name": "punctuation.section.regexp.begin.crystal" } }, "endCaptures": { "0": { "name": "punctuation.section.regexp.end.crystal" } } }, { "name": "string.regexp.interpolated.crystal", "begin": "%r\\[", "end": "\\][eimnosux]*", "patterns": [ { "include": "#regex_sub" }, { "include": "#nest_brackets_r" } ], "beginCaptures": { "0": { "name": "punctuation.section.regexp.begin.crystal" } }, "endCaptures": { "0": { "name": "punctuation.section.regexp.end.crystal" } } }, { "name": "string.regexp.interpolated.crystal", "begin": "%r\\(", "end": "\\)[eimnosux]*", "patterns": [ { "include": "#regex_sub" }, { "include": "#nest_parens_r" } ], "beginCaptures": { "0": { "name": "punctuation.section.regexp.begin.crystal" } }, "endCaptures": { "0": { "name": "punctuation.section.regexp.end.crystal" } } }, { "name": "string.regexp.interpolated.crystal", "begin": "%r\\\u003c", "end": "\\\u003e[eimnosux]*", "patterns": [ { "include": "#regex_sub" }, { "include": "#nest_ltgt_r" } ], "beginCaptures": { "0": { "name": "punctuation.section.regexp.begin.crystal" } }, "endCaptures": { "0": { "name": "punctuation.section.regexp.end.crystal" } } }, { "name": "string.regexp.interpolated.crystal", "begin": "%r([^\\w])", "end": "\\1[eimnosux]*", "patterns": [ { "include": "#regex_sub" } ], "beginCaptures": { "0": { "name": "punctuation.section.regexp.begin.crystal" } }, "endCaptures": { "0": { "name": "punctuation.section.regexp.end.crystal" } } }, { "name": "constant.other.symbol.interpolated.crystal", "begin": "%I\\[", "end": "\\]", "patterns": [ { "include": "#interpolated_crystal" }, { "include": "#escaped_char" }, { "include": "#nest_brackets_i" } ], "beginCaptures": { "0": { "name": "punctuation.section.array.begin.crystal" } }, "endCaptures": { "0": { "name": "punctuation.section.array.end.crystal" } } }, { "name": "constant.other.symbol.interpolated.crystal", "begin": "%I\\(", "end": "\\)", "patterns": [ { "include": "#interpolated_crystal" }, { "include": "#escaped_char" }, { "include": "#nest_parens_i" } ], "beginCaptures": { "0": { "name": "punctuation.section.array.begin.crystal" } }, "endCaptures": { "0": { "name": "punctuation.section.array.end.crystal" } } }, { "name": "constant.other.symbol.interpolated.crystal", "begin": "%I\\\u003c", "end": "\\\u003e", "patterns": [ { "include": "#interpolated_crystal" }, { "include": "#escaped_char" }, { "include": "#nest_ltgt_i" } ], "beginCaptures": { "0": { "name": "punctuation.section.array.begin.crystal" } }, "endCaptures": { "0": { "name": "punctuation.section.array.end.crystal" } } }, { "name": "constant.other.symbol.interpolated.crystal", "begin": "%I\\{", "end": "\\}", "patterns": [ { "include": "#interpolated_crystal" }, { "include": "#escaped_char" }, { "include": "#nest_curly_i" } ], "beginCaptures": { "0": { "name": "punctuation.section.array.begin.crystal" } }, "endCaptures": { "0": { "name": "punctuation.section.array.end.crystal" } } }, { "name": "constant.other.symbol.interpolated.crystal", "begin": "%I([^\\w])", "end": "\\1", "patterns": [ { "include": "#interpolated_crystal" }, { "include": "#escaped_char" } ], "beginCaptures": { "0": { "name": "punctuation.section.array.begin.crystal" } }, "endCaptures": { "0": { "name": "punctuation.section.array.end.crystal" } } }, { "name": "constant.other.symbol.crystal", "begin": "%i\\[", "end": "\\]", "patterns": [ { "name": "constant.character.escape.crystal", "match": "\\\\\\]|\\\\\\\\" }, { "include": "#nest_brackets" } ], "beginCaptures": { "0": { "name": "punctuation.section.array.begin.crystal" } }, "endCaptures": { "0": { "name": "punctuation.section.array.end.crystal" } } }, { "name": "constant.other.symbol.crystal", "begin": "%i\\(", "end": "\\)", "patterns": [ { "name": "constant.character.escape.crystal", "match": "\\\\\\)|\\\\\\\\" }, { "include": "#nest_parens" } ], "beginCaptures": { "0": { "name": "punctuation.section.array.begin.crystal" } }, "endCaptures": { "0": { "name": "punctuation.section.array.end.crystal" } } }, { "name": "constant.other.symbol.crystal", "begin": "%i\\\u003c", "end": "\\\u003e", "patterns": [ { "name": "constant.character.escape.crystal", "match": "\\\\\\\u003e|\\\\\\\\" }, { "include": "#nest_ltgt" } ], "beginCaptures": { "0": { "name": "punctuation.section.array.begin.crystal" } }, "endCaptures": { "0": { "name": "punctuation.section.array.end.crystal" } } }, { "name": "constant.other.symbol.crystal", "begin": "%i\\{", "end": "\\}", "patterns": [ { "name": "constant.character.escape.crystal", "match": "\\\\\\}|\\\\\\\\" }, { "include": "#nest_curly" } ], "beginCaptures": { "0": { "name": "punctuation.section.array.begin.crystal" } }, "endCaptures": { "0": { "name": "punctuation.section.array.end.crystal" } } }, { "name": "constant.other.symbol.crystal", "begin": "%i([^\\w])", "end": "\\1", "patterns": [ { "match": "\\\\." } ], "beginCaptures": { "0": { "name": "punctuation.section.array.begin.crystal" } }, "endCaptures": { "0": { "name": "punctuation.section.array.end.crystal" } } }, { "name": "string.quoted.other.interpolated.crystal", "begin": "%W\\[", "end": "\\]", "patterns": [ { "include": "#interpolated_crystal" }, { "include": "#escaped_char" }, { "include": "#nest_brackets_i" } ], "beginCaptures": { "0": { "name": "punctuation.section.array.begin.crystal" } }, "endCaptures": { "0": { "name": "punctuation.section.array.end.crystal" } } }, { "name": "string.quoted.other.interpolated.crystal", "begin": "%W\\(", "end": "\\)", "patterns": [ { "include": "#interpolated_crystal" }, { "include": "#escaped_char" }, { "include": "#nest_parens_i" } ], "beginCaptures": { "0": { "name": "punctuation.section.array.begin.crystal" } }, "endCaptures": { "0": { "name": "punctuation.section.array.end.crystal" } } }, { "name": "string.quoted.other.interpolated.crystal", "begin": "%W\\\u003c", "end": "\\\u003e", "patterns": [ { "include": "#interpolated_crystal" }, { "include": "#escaped_char" }, { "include": "#nest_ltgt_i" } ], "beginCaptures": { "0": { "name": "punctuation.section.array.begin.crystal" } }, "endCaptures": { "0": { "name": "punctuation.section.array.end.crystal" } } }, { "name": "string.quoted.other.interpolated.crystal", "begin": "%W\\{", "end": "\\}", "patterns": [ { "include": "#interpolated_crystal" }, { "include": "#escaped_char" }, { "include": "#nest_curly_i" } ], "beginCaptures": { "0": { "name": "punctuation.section.array.begin.crystal" } }, "endCaptures": { "0": { "name": "punctuation.section.array.end.crystal" } } }, { "name": "string.quoted.other.interpolated.crystal", "begin": "%W([^\\w])", "end": "\\1", "patterns": [ { "include": "#interpolated_crystal" }, { "include": "#escaped_char" } ], "beginCaptures": { "0": { "name": "punctuation.section.array.begin.crystal" } }, "endCaptures": { "0": { "name": "punctuation.section.array.end.crystal" } } }, { "name": "string.quoted.other.crystal", "begin": "%w\\[", "end": "\\]", "patterns": [ { "name": "constant.character.escape.crystal", "match": "\\\\\\]|\\\\\\\\" }, { "include": "#nest_brackets" } ], "beginCaptures": { "0": { "name": "punctuation.section.array.begin.crystal" } }, "endCaptures": { "0": { "name": "punctuation.section.array.end.crystal" } } }, { "name": "string.quoted.other.crystal", "begin": "%w\\(", "end": "\\)", "patterns": [ { "name": "constant.character.escape.crystal", "match": "\\\\\\)|\\\\\\\\" }, { "include": "#nest_parens" } ], "beginCaptures": { "0": { "name": "punctuation.section.array.begin.crystal" } }, "endCaptures": { "0": { "name": "punctuation.section.array.end.crystal" } } }, { "name": "string.quoted.other.crystal", "begin": "%w\\\u003c", "end": "\\\u003e", "patterns": [ { "name": "constant.character.escape.crystal", "match": "\\\\\\\u003e|\\\\\\\\" }, { "include": "#nest_ltgt" } ], "beginCaptures": { "0": { "name": "punctuation.section.array.begin.crystal" } }, "endCaptures": { "0": { "name": "punctuation.section.array.end.crystal" } } }, { "name": "string.quoted.other.crystal", "begin": "%w\\{", "end": "\\}", "patterns": [ { "name": "constant.character.escape.crystal", "match": "\\\\\\}|\\\\\\\\" }, { "include": "#nest_curly" } ], "beginCaptures": { "0": { "name": "punctuation.section.array.begin.crystal" } }, "endCaptures": { "0": { "name": "punctuation.section.array.end.crystal" } } }, { "name": "string.quoted.other.crystal", "begin": "%w([^\\w])", "end": "\\1", "patterns": [ { "match": "\\\\." } ], "beginCaptures": { "0": { "name": "punctuation.section.array.begin.crystal" } }, "endCaptures": { "0": { "name": "punctuation.section.array.end.crystal" } } }, { "name": "string.quoted.other.interpolated.crystal", "begin": "%Q\\(", "end": "\\)", "patterns": [ { "include": "#interpolated_crystal" }, { "include": "#escaped_char" }, { "include": "#nest_parens_i" } ], "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.crystal" } }, "endCaptures": { "0": { "name": "punctuation.definition.string.end.crystal" } } }, { "name": "string.quoted.other.interpolated.crystal", "begin": "%Q\\[", "end": "\\]", "patterns": [ { "include": "#interpolated_crystal" }, { "include": "#escaped_char" }, { "include": "#nest_brackets_i" } ], "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.crystal" } }, "endCaptures": { "0": { "name": "punctuation.definition.string.end.crystal" } } }, { "name": "string.quoted.other.interpolated.crystal", "begin": "%Q\\\u003c", "end": "\\\u003e", "patterns": [ { "include": "#interpolated_crystal" }, { "include": "#escaped_char" }, { "include": "#nest_ltgt_i" } ], "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.crystal" } }, "endCaptures": { "0": { "name": "punctuation.definition.string.end.crystal" } } }, { "name": "string.quoted.other.interpolated.crystal", "begin": "%Q\\{", "end": "\\}", "patterns": [ { "include": "#interpolated_crystal" }, { "include": "#escaped_char" }, { "include": "#nest_curly_i" } ], "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.crystal" } }, "endCaptures": { "0": { "name": "punctuation.definition.string.end.crystal" } } }, { "name": "string.quoted.other.interpolated.crystal", "begin": "%Q([^\\w])", "end": "\\1", "patterns": [ { "include": "#interpolated_crystal" }, { "include": "#escaped_char" } ], "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.crystal" } }, "endCaptures": { "0": { "name": "punctuation.definition.string.end.crystal" } } }, { "name": "string.quoted.other.interpolated.crystal", "begin": "%\\{", "end": "\\}", "patterns": [ { "include": "#interpolated_crystal" }, { "include": "#escaped_char" }, { "include": "#nest_curly" } ], "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.crystal" } }, "endCaptures": { "0": { "name": "punctuation.definition.string.end.crystal" } } }, { "name": "string.quoted.other.interpolated.crystal", "begin": "%\\[", "end": "\\]", "patterns": [ { "include": "#interpolated_crystal" }, { "include": "#escaped_char" }, { "include": "#nest_brackets" } ], "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.crystal" } }, "endCaptures": { "0": { "name": "punctuation.definition.string.end.crystal" } } }, { "name": "string.quoted.other.interpolated.crystal", "begin": "%\\(", "end": "\\)", "patterns": [ { "include": "#interpolated_crystal" }, { "include": "#escaped_char" }, { "include": "#nest_parens" } ], "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.crystal" } }, "endCaptures": { "0": { "name": "punctuation.definition.string.end.crystal" } } }, { "name": "string.quoted.other.interpolated.crystal", "begin": "%\\\u003c", "end": "\\\u003e", "patterns": [ { "include": "#interpolated_crystal" }, { "include": "#escaped_char" }, { "include": "#nest_ltgt" } ], "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.crystal" } }, "endCaptures": { "0": { "name": "punctuation.definition.string.end.crystal" } } }, { "name": "string.quoted.other.crystal", "begin": "%q\\(", "end": "\\)", "patterns": [ { "name": "constant.character.escape.crystal", "match": "\\\\\\)|\\\\\\\\" }, { "include": "#nest_parens" } ], "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.crystal" } }, "endCaptures": { "0": { "name": "punctuation.definition.string.end.crystal" } } }, { "name": "string.quoted.other.crystal", "begin": "%q\\\u003c", "end": "\\\u003e", "patterns": [ { "name": "constant.character.escape.crystal", "match": "\\\\\\\u003e|\\\\\\\\" }, { "include": "#nest_ltgt" } ], "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.crystal" } }, "endCaptures": { "0": { "name": "punctuation.definition.string.end.crystal" } } }, { "name": "string.quoted.other.crystal", "begin": "%q\\[", "end": "\\]", "patterns": [ { "name": "constant.character.escape.crystal", "match": "\\\\\\]|\\\\\\\\" }, { "include": "#nest_brackets" } ], "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.crystal" } }, "endCaptures": { "0": { "name": "punctuation.definition.string.end.crystal" } } }, { "name": "string.quoted.other.crystal", "begin": "%q\\{", "end": "\\}", "patterns": [ { "name": "constant.character.escape.crystal", "match": "\\\\\\}|\\\\\\\\" }, { "include": "#nest_curly" } ], "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.crystal" } }, "endCaptures": { "0": { "name": "punctuation.definition.string.end.crystal" } } }, { "name": "string.quoted.other.crystal", "begin": "%q([^\\w])", "end": "\\1", "patterns": [ { "match": "\\\\." } ], "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.crystal" } }, "endCaptures": { "0": { "name": "punctuation.definition.string.end.crystal" } } }, { "name": "constant.other.symbol.crystal", "begin": "%s\\(", "end": "\\)", "patterns": [ { "name": "constant.character.escape.crystal", "match": "\\\\\\)|\\\\\\\\" }, { "include": "#nest_parens" } ], "beginCaptures": { "0": { "name": "punctuation.definition.symbol.begin.crystal" } }, "endCaptures": { "0": { "name": "punctuation.definition.symbol.end.crystal" } } }, { "name": "constant.other.symbol.crystal", "begin": "%s\\\u003c", "end": "\\\u003e", "patterns": [ { "name": "constant.character.escape.crystal", "match": "\\\\\\\u003e|\\\\\\\\" }, { "include": "#nest_ltgt" } ], "beginCaptures": { "0": { "name": "punctuation.definition.symbol.begin.crystal" } }, "endCaptures": { "0": { "name": "punctuation.definition.symbol.end.crystal" } } }, { "name": "constant.other.symbol.crystal", "begin": "%s\\[", "end": "\\]", "patterns": [ { "name": "constant.character.escape.crystal", "match": "\\\\\\]|\\\\\\\\" }, { "include": "#nest_brackets" } ], "beginCaptures": { "0": { "name": "punctuation.definition.symbol.begin.crystal" } }, "endCaptures": { "0": { "name": "punctuation.definition.symbol.end.crystal" } } }, { "name": "constant.other.symbol.crystal", "begin": "%s\\{", "end": "\\}", "patterns": [ { "name": "constant.character.escape.crystal", "match": "\\\\\\}|\\\\\\\\" }, { "include": "#nest_curly" } ], "beginCaptures": { "0": { "name": "punctuation.definition.symbol.begin.crystal" } }, "endCaptures": { "0": { "name": "punctuation.definition.symbol.end.crystal" } } }, { "name": "constant.other.symbol.crystal", "begin": "%s([^\\w])", "end": "\\1", "patterns": [ { "match": "\\\\." } ], "beginCaptures": { "0": { "name": "punctuation.definition.symbol.begin.crystal" } }, "endCaptures": { "0": { "name": "punctuation.definition.symbol.end.crystal" } } }, { "name": "constant.other.symbol.crystal", "match": "(?\u003c!:)(:)(?\u003e[$a-zA-Z_]\\w*(?\u003e[?!]|=(?![\u003e=]))?|===?|\u003c=\u003e|\u003e[\u003e=]?|\u003c[\u003c=]?|[%\u0026`/\\|]|\\*\\*?|=?~|[-+]@?|\\[\\]=?|@@?[a-zA-Z_]\\w*)", "captures": { "1": { "name": "punctuation.definition.constant.crystal" } } }, { "begin": "(^[ \\t]+)?(?=#)", "end": "(?!\\G)", "patterns": [ { "name": "comment.line.number-sign.crystal", "begin": "#", "end": "\\n", "patterns": [ { "include": "#yard" } ], "beginCaptures": { "0": { "name": "punctuation.definition.comment.crystal" } } } ], "beginCaptures": { "1": { "name": "punctuation.whitespace.comment.leading.crystal" } } }, { "contentName": "text.plain", "begin": "^__END__\\n", "end": "(?=not)impossible", "patterns": [ { "name": "text.html.embedded.crystal", "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.crystal" } } }, { "name": "meta.embedded.block.html", "begin": "(?=(?\u003e\u003c\u003c-(\"?)((?:[_\\w]+_|)HTML)\\b\\1))", "end": "(?!\\G)", "patterns": [ { "name": "string.unquoted.heredoc.crystal", "contentName": "text.html", "begin": "(?\u003e\u003c\u003c-(\"?)((?:[_\\w]+_|)HTML)\\b\\1)", "end": "\\s*\\2$\\n?", "patterns": [ { "include": "#heredoc" }, { "include": "#interpolated_crystal" }, { "include": "text.html.basic" }, { "include": "#escaped_char" } ], "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.crystal" } }, "endCaptures": { "0": { "name": "punctuation.definition.string.end.crystal" } } } ] }, { "name": "meta.embedded.block.sql", "begin": "(?=(?\u003e\u003c\u003c-(\"?)((?:[_\\w]+_|)SQL)\\b\\1))", "end": "(?!\\G)", "patterns": [ { "name": "string.unquoted.heredoc.crystal", "contentName": "source.sql", "begin": "(?\u003e\u003c\u003c-(\"?)((?:[_\\w]+_|)SQL)\\b\\1)", "end": "\\s*\\2$\\n?", "patterns": [ { "include": "#heredoc" }, { "include": "#interpolated_crystal" }, { "include": "source.sql" }, { "include": "#escaped_char" } ], "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.crystal" } }, "endCaptures": { "0": { "name": "punctuation.definition.string.end.crystal" } } } ] }, { "name": "meta.embedded.block.css", "begin": "(?=(?\u003e\u003c\u003c-(\"?)((?:[_\\w]+_|)CSS)\\b\\1))", "end": "(?!\\G)", "patterns": [ { "name": "string.unquoted.heredoc.crystal", "contentName": "source.css", "begin": "(?\u003e\u003c\u003c-(\"?)((?:[_\\w]+_|)CSS)\\b\\1)", "end": "\\s*\\2$\\n?", "patterns": [ { "include": "#heredoc" }, { "include": "#interpolated_crystal" }, { "include": "source.css" }, { "include": "#escaped_char" } ], "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.crystal" } }, "endCaptures": { "0": { "name": "punctuation.definition.string.end.crystal" } } } ] }, { "name": "meta.embedded.block.cpp", "begin": "(?=(?\u003e\u003c\u003c-(\"?)((?:[_\\w]+_|)CPP)\\b\\1))", "end": "(?!\\G)", "patterns": [ { "name": "string.unquoted.heredoc.crystal", "contentName": "source.cpp", "begin": "(?\u003e\u003c\u003c-(\"?)((?:[_\\w]+_|)CPP)\\b\\1)", "end": "\\s*\\2$\\n?", "patterns": [ { "include": "#heredoc" }, { "include": "#interpolated_crystal" }, { "include": "source.c++" }, { "include": "#escaped_char" } ], "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.crystal" } }, "endCaptures": { "0": { "name": "punctuation.definition.string.end.crystal" } } } ] }, { "name": "meta.embedded.block.c", "begin": "(?=(?\u003e\u003c\u003c-(\"?)((?:[_\\w]+_|)C)\\b\\1))", "end": "(?!\\G)", "patterns": [ { "name": "string.unquoted.heredoc.crystal", "contentName": "source.c", "begin": "(?\u003e\u003c\u003c-(\"?)((?:[_\\w]+_|)C)\\b\\1)", "end": "\\s*\\2$\\n?", "patterns": [ { "include": "#heredoc" }, { "include": "#interpolated_crystal" }, { "include": "source.c" }, { "include": "#escaped_char" } ], "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.crystal" } }, "endCaptures": { "0": { "name": "punctuation.definition.string.end.crystal" } } } ] }, { "name": "meta.embedded.block.js", "begin": "(?=(?\u003e\u003c\u003c-(\"?)((?:[_\\w]+_|)(?:JS|JAVASCRIPT))\\b\\1))", "end": "(?!\\G)", "patterns": [ { "name": "string.unquoted.heredoc.crystal", "contentName": "source.js", "begin": "(?\u003e\u003c\u003c-(\"?)((?:[_\\w]+_|)(?:JS|JAVASCRIPT))\\b\\1)", "end": "\\s*\\2$\\n?", "patterns": [ { "include": "#heredoc" }, { "include": "#interpolated_crystal" }, { "include": "source.js" }, { "include": "#escaped_char" } ], "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.crystal" } }, "endCaptures": { "0": { "name": "punctuation.definition.string.end.crystal" } } } ] }, { "name": "meta.embedded.block.js.jquery", "begin": "(?=(?\u003e\u003c\u003c-(\"?)((?:[_\\w]+_|)JQUERY)\\b\\1))", "end": "(?!\\G)", "patterns": [ { "name": "string.unquoted.heredoc.crystal", "contentName": "source.js.jquery", "begin": "(?\u003e\u003c\u003c-(\"?)((?:[_\\w]+_|)JQUERY)\\b\\1)", "end": "\\s*\\2$\\n?", "patterns": [ { "include": "#heredoc" }, { "include": "#interpolated_crystal" }, {}, { "include": "#escaped_char" } ], "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.crystal" } }, "endCaptures": { "0": { "name": "punctuation.definition.string.end.crystal" } } } ] }, { "name": "meta.embedded.block.shell", "begin": "(?=(?\u003e\u003c\u003c-(\"?)((?:[_\\w]+_|)(?:SH|SHELL))\\b\\1))", "end": "(?!\\G)", "patterns": [ { "name": "string.unquoted.heredoc.crystal", "contentName": "source.shell", "begin": "(?\u003e\u003c\u003c-(\"?)((?:[_\\w]+_|)(?:SH|SHELL))\\b\\1)", "end": "\\s*\\2$\\n?", "patterns": [ { "include": "#heredoc" }, { "include": "#interpolated_crystal" }, { "include": "source.shell" }, { "include": "#escaped_char" } ], "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.crystal" } }, "endCaptures": { "0": { "name": "punctuation.definition.string.end.crystal" } } } ] }, { "name": "meta.embedded.block.lua", "begin": "(?=(?\u003e\u003c\u003c-(\"?)((?:[_\\w]+_|)LUA)\\b\\1))", "end": "(?!\\G)", "patterns": [ { "name": "string.unquoted.heredoc.crystal", "contentName": "source.lua", "begin": "(?\u003e\u003c\u003c-(\"?)((?:[_\\w]+_|)LUA)\\b\\1)", "end": "\\s*\\2$\\n?", "patterns": [ { "include": "#heredoc" }, { "include": "#interpolated_crystal" }, { "include": "source.lua" }, { "include": "#escaped_char" } ], "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.crystal" } }, "endCaptures": { "0": { "name": "punctuation.definition.string.end.crystal" } } } ] }, { "name": "meta.embedded.block.crystal", "begin": "(?=(?\u003e\u003c\u003c-(\"?)((?:[_\\w]+_|)crystal)\\b\\1))", "end": "(?!\\G)", "patterns": [ { "name": "string.unquoted.heredoc.crystal", "contentName": "source.crystal", "begin": "(?\u003e\u003c\u003c-(\"?)((?:[_\\w]+_|)crystal)\\b\\1)", "end": "\\s*\\2$\\n?", "patterns": [ { "include": "#heredoc" }, { "include": "#interpolated_crystal" }, { "include": "source.crystal" }, { "include": "#escaped_char" } ], "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.crystal" } }, "endCaptures": { "0": { "name": "punctuation.definition.string.end.crystal" } } } ] }, { "name": "string.unquoted.heredoc.crystal", "begin": "(?\u003e\\=\\s*\u003c\u003c(\\w+))", "end": "^\\1$", "patterns": [ { "include": "#heredoc" }, { "include": "#interpolated_crystal" }, { "include": "#escaped_char" } ], "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.crystal" } }, "endCaptures": { "0": { "name": "punctuation.definition.string.end.crystal" } } }, { "name": "string.unquoted.heredoc.crystal", "begin": "(?\u003e\u003c\u003c-(\\w+))", "end": "\\s*\\1$", "patterns": [ { "include": "#heredoc" }, { "include": "#interpolated_crystal" }, { "include": "#escaped_char" } ], "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.crystal" } }, "endCaptures": { "0": { "name": "punctuation.definition.string.end.crystal" } } }, { "begin": "(?\u003c=\\{|do|\\{\\s|do\\s)(\\|)", "end": "(\\|)", "patterns": [ { "name": "variable.other.block.crystal", "match": "[_a-zA-Z][_a-zA-Z0-9]*" }, { "name": "punctuation.separator.variable.crystal", "match": "," } ], "captures": { "1": { "name": "punctuation.separator.variable.crystal" } } }, { "name": "punctuation.separator.key-value", "match": "=\u003e" }, { "name": "keyword.operator.assignment.augmented.crystal", "match": "\u003c\u003c=|%=|\u0026{1,2}=|\\*=|\\*\\*=|\\+=|\\-=|\\^=|\\|{1,2}=|\u003c\u003c" }, { "name": "keyword.operator.comparison.crystal", "match": "\u003c=\u003e|\u003c(?!\u003c|=)|\u003e(?!\u003c|=|\u003e)|\u003c=|\u003e=|===|==|=~|!=|!~|(?\u003c=[ \\t])\\?" }, { "name": "keyword.operator.logical.crystal", "match": "(?\u003c=[ \\t])!+|\\bnot\\b|\u0026\u0026|\\band\\b|\\|\\||\\bor\\b|\\^" }, { "name": "keyword.operator.arithmetic.crystal", "match": "(%|\u0026|\\*\\*|\\*|\\+|\\-|/)" }, { "name": "keyword.operator.assignment.crystal", "match": "=" }, { "name": "keyword.operator.other.crystal", "match": "\\||~|\u003e\u003e" }, { "name": "punctuation.separator.statement.crystal", "match": "\\;" }, { "name": "punctuation.separator.object.crystal", "match": "," }, { "match": "(::)\\s*(?=[A-Z])", "captures": { "1": { "name": "punctuation.separator.namespace.crystal" } } }, { "match": "(\\.|::)\\s*(?![A-Z])", "captures": { "1": { "name": "punctuation.separator.method.crystal" } } }, { "name": "punctuation.separator.other.crystal", "match": ":" }, { "name": "punctuation.section.scope.begin.crystal", "match": "\\{" }, { "name": "punctuation.section.scope.end.crystal", "match": "\\}" }, { "name": "punctuation.section.array.begin.crystal", "match": "\\[" }, { "name": "punctuation.section.array.end.crystal", "match": "\\]" }, { "name": "punctuation.section.function.crystal", "match": "\\(|\\)" } ], "repository": { "escaped_char": { "name": "constant.character.escape.crystal", "match": "\\\\(?:[0-7]{1,3}|x[\\da-fA-F]{1,2}|.)" }, "heredoc": { "begin": "^\u003c\u003c-?\\w+", "end": "$", "patterns": [ { "include": "$self" } ] }, "interpolated_crystal": { "patterns": [ { "name": "meta.embedded.line.crystal", "contentName": "source.crystal", "begin": "(#\\{)", "end": "(\\})", "patterns": [ { "include": "#nest_curly_and_self" }, { "include": "$self" } ], "beginCaptures": { "0": { "name": "punctuation.section.embedded.begin.crystal" }, "1": { "name": "source.crystal" } }, "endCaptures": { "0": { "name": "punctuation.section.embedded.end.crystal" }, "1": { "name": "source.crystal" } } }, { "name": "variable.other.readwrite.instance.crystal", "match": "(#@)[a-zA-Z_]\\w*", "captures": { "1": { "name": "punctuation.definition.variable.crystal" } } }, { "name": "variable.other.readwrite.class.crystal", "match": "(#@@)[a-zA-Z_]\\w*", "captures": { "1": { "name": "punctuation.definition.variable.crystal" } } }, { "name": "variable.other.readwrite.global.crystal", "match": "(#\\$)[a-zA-Z_]\\w*", "captures": { "1": { "name": "punctuation.definition.variable.crystal" } } } ] }, "nest_brackets": { "begin": "\\[", "end": "\\]", "patterns": [ { "include": "#nest_brackets" } ], "captures": { "0": { "name": "punctuation.section.scope.crystal" } } }, "nest_brackets_i": { "begin": "\\[", "end": "\\]", "patterns": [ { "include": "#interpolated_crystal" }, { "include": "#escaped_char" }, { "include": "#nest_brackets_i" } ], "captures": { "0": { "name": "punctuation.section.scope.crystal" } } }, "nest_brackets_r": { "begin": "\\[", "end": "\\]", "patterns": [ { "include": "#regex_sub" }, { "include": "#nest_brackets_r" } ], "captures": { "0": { "name": "punctuation.section.scope.crystal" } } }, "nest_curly": { "begin": "\\{", "end": "\\}", "patterns": [ { "include": "#nest_curly" } ], "captures": { "0": { "name": "punctuation.section.scope.crystal" } } }, "nest_curly_and_self": { "patterns": [ { "begin": "\\{", "end": "\\}", "patterns": [ { "include": "#nest_curly_and_self" } ], "captures": { "0": { "name": "punctuation.section.scope.crystal" } } }, { "include": "$self" } ] }, "nest_curly_i": { "begin": "\\{", "end": "\\}", "patterns": [ { "include": "#interpolated_crystal" }, { "include": "#escaped_char" }, { "include": "#nest_curly_i" } ], "captures": { "0": { "name": "punctuation.section.scope.crystal" } } }, "nest_curly_r": { "begin": "\\{", "end": "\\}", "patterns": [ { "include": "#regex_sub" }, { "include": "#nest_curly_r" } ], "captures": { "0": { "name": "punctuation.section.scope.crystal" } } }, "nest_ltgt": { "begin": "\\\u003c", "end": "\\\u003e", "patterns": [ { "include": "#nest_ltgt" } ], "captures": { "0": { "name": "punctuation.section.scope.crystal" } } }, "nest_ltgt_i": { "begin": "\\\u003c", "end": "\\\u003e", "patterns": [ { "include": "#interpolated_crystal" }, { "include": "#escaped_char" }, { "include": "#nest_ltgt_i" } ], "captures": { "0": { "name": "punctuation.section.scope.crystal" } } }, "nest_ltgt_r": { "begin": "\\\u003c", "end": "\\\u003e", "patterns": [ { "include": "#regex_sub" }, { "include": "#nest_ltgt_r" } ], "captures": { "0": { "name": "punctuation.section.scope.crystal" } } }, "nest_parens": { "begin": "\\(", "end": "\\)", "patterns": [ { "include": "#nest_parens" } ], "captures": { "0": { "name": "punctuation.section.scope.crystal" } } }, "nest_parens_i": { "begin": "\\(", "end": "\\)", "patterns": [ { "include": "#interpolated_crystal" }, { "include": "#escaped_char" }, { "include": "#nest_parens_i" } ], "captures": { "0": { "name": "punctuation.section.scope.crystal" } } }, "nest_parens_r": { "begin": "\\(", "end": "\\)", "patterns": [ { "include": "#regex_sub" }, { "include": "#nest_parens_r" } ], "captures": { "0": { "name": "punctuation.section.scope.crystal" } } }, "regex_sub": { "patterns": [ { "include": "#interpolated_crystal" }, { "include": "#escaped_char" }, { "name": "string.regexp.arbitrary-repetition.crystal", "match": "(\\{)\\d+(,\\d+)?(\\})", "captures": { "1": { "name": "punctuation.definition.arbitrary-repetition.crystal" }, "3": { "name": "punctuation.definition.arbitrary-repetition.crystal" } } }, { "name": "string.regexp.character-class.crystal", "begin": "\\[(?:\\^?\\])?", "end": "\\]", "patterns": [ { "include": "#escaped_char" } ], "captures": { "0": { "name": "punctuation.definition.character-class.crystal" } } }, { "name": "comment.line.number-sign.crystal", "begin": "\\(\\?#", "end": "\\)", "patterns": [ { "include": "#escaped_char" } ], "beginCaptures": { "0": { "name": "punctuation.definition.comment.begin.crystal" } }, "endCaptures": { "0": { "name": "punctuation.definition.comment.end.crystal" } } }, { "name": "string.regexp.group.crystal", "begin": "\\(", "end": "\\)", "patterns": [ { "include": "#regex_sub" } ], "captures": { "0": { "name": "punctuation.definition.group.crystal" } } }, { "name": "comment.line.number-sign.crystal", "begin": "(?\u003c=^|\\s)(#)\\s(?=[[a-zA-Z0-9,. \\t?!-][^\\x{00}-\\x{7F}]]*$)", "end": "$\\n?", "beginCaptures": { "1": { "name": "punctuation.definition.comment.crystal" } }, "endCaptures": { "0": { "name": "punctuation.definition.comment.crystal" } } } ] } } }