{ "fileTypes": [ "rsc" ], "name": "Rascal", "patterns": [ { "include": "#top_level" } ], "repository": { "annotation": { "patterns": [ { "begin": "(@[^ {]+)({)", "beginCaptures": { "1": { "name": "storage.type.annotation.block.rascal" }, "2": { "name": "punctuation.annotation-argument.begin.rascal" } }, "end": "(})", "endCaptures": { "1": { "name": "punctuation.annotation-argument.end.rascal" } }, "name": "meta.annotation.block.rascal" }, { "captures": { "1": { "name": "storage.type.annotation.inline.rascal" } }, "match": "(@[A-Za-z_0-9]+)", "name": "meta.annotation.inline.rascal" } ] }, "char_set": { "patterns": [ { "begin": "\\[", "end": "\\]", "name": "punctuation.other.lexicalcharset.rascal", "patterns": [ { "include": "#string_escape" } ] } ] }, "comment": { "patterns": [ { "match": "//.*$\\n?", "name": "comment.line.double-slash.rascal" }, { "begin": "/\\*", "end": "\\*/", "name": "comment.block.rascal" } ] }, "regex": { "patterns": [ { "begin": "/(?!/|*)", "end": "/([dims]*)", "endCaptures": { "1": { "name": "storage.modifier.regex.rascal" } }, "name": "string.regexp.rascal", "patterns": [ { "include": "#regex_escape" }, { "include": "#string_interpolation" } ] } ] }, "regex_escape": { "patterns": [ { "match": "\\\\(/|<|>|\\\\)", "name": "constant.character.escape.regex.rascal" } ] }, "string": { "patterns": [ { "begin": "'", "end": "'", "name": "string.quoted.single.rascal", "patterns": [ { "include": "#string_escape" } ] }, { "begin": "\"", "end": "\"", "name": "string.quoted.double.rascal", "patterns": [ { "include": "#string_escape" }, { "include": "#string_interpolation" } ] }, { "begin": "`", "end": "`", "name": "string.interpolated.rascal", "patterns": [ { "include": "#string_interpolation" }, { "include": "#syntax_escape" } ] } ] }, "string_escape": { "patterns": [ { "match": "\\\\(\\\"|\\'|<|>|\\\\|[bnfrt])", "name": "constant.character.escape.ordinary.rascal" }, { "match": "\\\\(u[0-9A-Fa-f][0-9A-Fa-f][0-9A-Fa-f][0-9A-Fa-f] |U(0[0-9 A-F a-f]|10)[0-9A-Fa-f][0-9A-Fa-f][0-9A-Fa-f][0-9A-Fa-f] |a[0-7][0-9A-Fa-f] )", "name": "constant.character.escape.unicode.rascal" } ] }, "string_interpolation": { "patterns": [ { "begin": "(<)", "beginCaptures": { "1": { "name": "punctuation.interpolation.begin.rascal" } }, "end": "(>)", "endCaptures": { "2": { "name": "punctuation.interpolation.end.rascal" } }, "name": "support.interpolated-string.rascal", "patterns": [ { "include": "#top_level" } ] } ] }, "syntax_escape": { "patterns": [ { "match": "\\\\(\\\\|<|>|`)", "name": "constant.character.escape.syntax.rascal" } ] }, "top_level": { "patterns": [ { "begin": "(lexical|syntax)\\s+([a-zA-Z][A-Za-z_0-9]*)", "captures": { "1": { "name": "keyword.control.rascal" }, "2": { "name": "entity.name.type.rascal" } }, "end": ";", "name": "punctuation.other.syntactic.rascal", "patterns": [ { "include": "#char_set" }, { "include": "#string" }, { "include": "#comment" }, { "include": "#regex" }, { "include": "#annotation" } ] }, { "match": "(?