7 lines
8.5 KiB
JavaScript
7 lines
8.5 KiB
JavaScript
|
const lang = Object.freeze({ "displayName": "RegExp", "fileTypes": ["re"], "name": "regexp", "patterns": [{ "include": "#regexp-expression" }], "repository": { "codetags": { "captures": { "1": { "name": "keyword.codetag.notation.python" } }, "match": "(?:\\b(NOTE|XXX|HACK|FIXME|BUG|TODO)\\b)" }, "fregexp-base-expression": { "patterns": [{ "include": "#fregexp-quantifier" }, { "include": "#fstring-formatting-braces" }, { "match": "\\{.*?\\}" }, { "include": "#regexp-base-common" }] }, "fregexp-quantifier": { "match": "(?x)\n\\{\\{(\n\\d+ | \\d+,(\\d+)? | ,\\d+\n)\\}\\}\n", "name": "keyword.operator.quantifier.regexp" }, "fstring-formatting-braces": { "patterns": [{ "captures": { "1": { "name": "constant.character.format.placeholder.other.python" }, "2": { "name": "invalid.illegal.brace.python" }, "3": { "name": "constant.character.format.placeholder.other.python" } }, "comment": "empty braces are illegal", "match": "({)(\\s*?)(})" }, { "match": "({{|}})", "name": "constant.character.escape.python" }] }, "regexp-backreference": { "captures": { "1": { "name": "support.other.parenthesis.regexp punctuation.parenthesis.backreference.named.begin.regexp" }, "2": { "name": "entity.name.tag.named.backreference.regexp" }, "3": { "name": "support.other.parenthesis.regexp punctuation.parenthesis.backreference.named.end.regexp" } }, "match": "(?x)\n(\\() (\\?P= \\w+(?:\\s+[[:alnum:]]+)?) (\\))\n", "name": "meta.backreference.named.regexp" }, "regexp-backreference-number": { "captures": { "1": { "name": "entity.name.tag.backreference.regexp" } }, "match": "(\\\\[1-9]\\d?)", "name": "meta.backreference.regexp" }, "regexp-base-common": { "patterns": [{ "match": "\\.", "name": "support.other.match.any.regexp" }, { "match": "\\^", "name": "support.other.match.begin.regexp" }, { "match": "\\$", "name": "support.other.match.end.regexp" }, { "match": "[+*?]\\??", "name": "keyword.operator.quantifier.regexp" }, { "match": "\\|", "name": "keyword.operator.disjunction.regexp" }, { "include": "#regexp-escape-sequence" }] }, "regexp-base-expression": { "patterns": [{ "include": "#regexp-quantifier" }, { "include": "#regexp-base-common" }] }, "regexp-character-set": { "patterns": [{ "match": "(?x)\n\\[ \\^? \\] (?! .*?\\])\n" }, { "begin": "(\\[)(\\^)?(\\])?", "beginCaptures": { "1": { "name": "punctuation.character.set.begin.regexp constant.other.set.regexp" }, "2": { "name": "keyword.operator.negation.regexp" }, "3": { "name": "constant.character.set.regexp" } }, "end": "(\\])", "endCaptures": { "1": { "name": "punctuation.character.set.end.regexp constant.other.set.regexp" }, "2": { "name": "invalid.illegal.newline.python" } }, "name": "meta.character.set.regexp", "patterns": [{ "include": "#regexp-charecter-set-escapes" }, { "match": "[^\\n]", "name": "constant.character.set.regexp" }] }] }, "regexp-charecter-set-escapes": { "patterns": [{ "match": "\\\\[abfnrtv\\\\]", "name": "constant.character.escape.regexp" }, { "include": "#regexp-escape-special" }, { "match": "\\\\([0-7]{1,3})", "name": "constant.character.escape.regexp" }, { "include": "#regexp-escape-character" }, { "include": "#regexp-escape-unicode" }, { "include": "#regexp-escape-catchall" }] }, "regexp-comments": { "begin": "\\(\\?#", "beginCaptures": { "0": { "name": "punctuation.comment.begin.regexp" } }, "end": "(\\))", "endCaptures": { "1": { "name": "punctuation.comment.end.regexp" }, "2": { "name": "invalid.illegal.newline.python" } }, "name": "comment.regexp", "patterns": [{ "include": "#codetags" }] }, "regexp-conditional": { "begin": "(\\()\\?\\((\\w+(?:\\s+[[:alnum:]]+)?|\\d+)\\)", "beginCaptures": { "0": { "name": "keyword.operator.conditional.regexp" }, "1": { "name": "punctuation.parenthesis.conditional.begin.regexp" } }, "end": "(\\))", "endCaptures": { "1": { "name": "keyword.operator.conditional.negative.regexp punctuation.parenthesis.conditional.end.regexp" }, "2": { "name": "invalid.illegal.newline.python" } }, "patterns": [{ "include": "#regexp-expression" }] }, "regexp-escape-catchall": { "match": "\\\\(.|\\n)", "name": "constant.character.escape.regexp" }, "r
|
||
|
var regexp = [
|
||
|
lang
|
||
|
];
|
||
|
|
||
|
export { regexp as default };
|