site/node_modules/shiki/dist/langs/twig.mjs

35 lines
23 KiB
JavaScript
Raw Permalink Normal View History

2024-10-14 06:09:33 +00:00
import css from './css.mjs';
import javascript from './javascript.mjs';
import scss from './scss.mjs';
import php from './php.mjs';
import python from './python.mjs';
import ruby from './ruby.mjs';
import './html.mjs';
import './xml.mjs';
import './java.mjs';
import './sql.mjs';
import './json.mjs';
import './c.mjs';
import './shellscript.mjs';
import './lua.mjs';
const lang = Object.freeze({ "displayName": "Twig", "fileTypes": ["twig", "html.twig"], "firstLineMatch": "<!(?i:DOCTYPE)|<(?i:html)|<\\?(?i:php)|\\{\\{|\\{%|\\{#", "foldingStartMarker": "(?x)\n (<(?i:body|div|dl|fieldset|form|head|li|ol|script|select|style|table|tbody|tfoot|thead|tr|ul)\\b.*?>\n |<!--(?!.*--\\s*>)\n |^<!--\\ \\#tminclude\\ (?>.*?-->)$\n |\\{%\\s+(autoescape|block|embed|filter|for|if|macro|raw|sandbox|set|spaceless|trans|verbatim)\n )", "foldingStopMarker": "(?x)\n (</(?i:body|div|dl|fieldset|form|head|li|ol|script|select|style|table|tbody|tfoot|thead|tr|ul)>\n |^(?!.*?<!--).*?--\\s*>\n |^<!--\\ end\\ tminclude\\ -->$\n |\\{%\\s+end(autoescape|block|embed|filter|for|if|macro|raw|sandbox|set|spaceless|trans|verbatim)\n )", "name": "twig", "patterns": [{ "begin": "(<)([a-zA-Z0-9:]++)(?=[^>]*></\\2>)", "beginCaptures": { "1": { "name": "punctuation.definition.tag.html" }, "2": { "name": "entity.name.tag.html" } }, "end": "(>(<)/)(\\2)(>)", "endCaptures": { "1": { "name": "punctuation.definition.tag.html" }, "2": { "name": "meta.scope.between-tag-pair.html" }, "3": { "name": "entity.name.tag.html" }, "4": { "name": "punctuation.definition.tag.html" } }, "name": "meta.tag.any.html", "patterns": [{ "include": "#tag-stuff" }] }, { "begin": "(<\\?)(xml)", "captures": { "1": { "name": "punctuation.definition.tag.html" }, "2": { "name": "entity.name.tag.xml.html" } }, "end": "(\\?>)", "name": "meta.tag.preprocessor.xml.html", "patterns": [{ "include": "#tag-generic-attribute" }, { "include": "#string-double-quoted" }, { "include": "#string-single-quoted" }] }, { "begin": "<!--", "captures": { "0": { "name": "punctuation.definition.comment.html" } }, "end": "--\\s*>", "name": "comment.block.html", "patterns": [{ "match": "--", "name": "invalid.illegal.bad-comments-or-CDATA.html" }, { "include": "#embedded-code" }] }, { "begin": "<!", "captures": { "0": { "name": "punctuation.definition.tag.html" } }, "end": ">", "name": "meta.tag.sgml.html", "patterns": [{ "begin": "(?i:DOCTYPE)", "captures": { "1": { "name": "entity.name.tag.doctype.html" } }, "end": "(?=>)", "name": "meta.tag.sgml.doctype.html", "patterns": [{ "match": '"[^">]*"', "name": "string.quoted.double.doctype.identifiers-and-DTDs.html" }] }, { "begin": "\\[CDATA\\[", "end": "]](?=>)", "name": "constant.other.inline-data.html" }, { "match": "(\\s*)(?!--|>)\\S(\\s*)", "name": "invalid.illegal.bad-comments-or-CDATA.html" }] }, { "include": "#embedded-code" }, { "begin": "(?:^\\s+)?(<)((?i:style))\\b(?![^>]*/>)", "captures": { "1": { "name": "punctuation.definition.tag.html" }, "2": { "name": "entity.name.tag.style.html" }, "3": { "name": "punctuation.definition.tag.html" } }, "end": "(</)((?i:style))(>)(?:\\s*\\n)?", "name": "source.css.embedded.html", "patterns": [{ "include": "#tag-stuff" }, { "begin": "(>)", "beginCaptures": { "1": { "name": "punctuation.definition.tag.html" } }, "end": "(?=</(?i:style))", "patterns": [{ "include": "#embedded-code" }, { "include": "source.css" }] }] }, { "begin": "(?:^\\s+)?(<)((?i:script))\\b(?![^>]*/>)", "beginCaptures": { "1": { "name": "punctuation.definition.tag.html" }, "2": { "name": "entity.name.tag.script.html" } }, "end": "(?<=</(script|SCRIPT))(>)(?:\\s*\\n)?", "endCaptures": { "2": { "name": "punctuation.definition.tag.html" } }, "name": "source.js.embedded.html", "patterns": [{ "include": "#tag-stuff" }, { "begin": "(?<!</(?:script|SCRIPT))(>)", "captures": { "1": { "name": "punctuation.definition.tag.html" }, "2": { "name": "entity.name.tag.script.html" } }, "end": "(</)((?i:script))", "patterns": [{ "captures": { "1": { "name": "punctuation.definition.comment.js" } }, "match": "(//).*?((?=<\/script)|$\\n?)", "name": "comment.line.double-slash.js" }, { "begin": "/\\*", "captures": { "0": { "name": "punctuation.definition.comment.js" } }, "end": "\\*/|(?=<\/script)", "name": "comment.block.js" }, { "include": "#php" }, { "include": "#twig-print-tag" }, { "include": "#twig-statement-tag" }, { "include": "#twig-comment-tag" }, { "include":
(?<=[a-zA-Z0-9_\\x{7f}-\\x{ff}\\]])
(?:
(\\[)('[a-zA-Z_\\x{7f}-\\x{ff}][a-zA-Z0-9_\\x{7f}-\\x{ff}]*')(\\])
|(\\[)("[a-zA-Z_\\x{7f}-\\x{ff}][a-zA-Z0-9_\\x{7f}-\\x{ff}]*")(\\])
|(\\[)([a-zA-Z_\\x{7f}-\\x{ff}][a-zA-Z0-9_\\x{7f}-\\x{ff}]*)(\\])
)
` }] }, "twig-statement-tag": { "begin": "\\{%-?", "beginCaptures": { "0": { "name": "punctuation.section.tag.twig" } }, "end": "-?%\\}", "endCaptures": { "0": { "name": "punctuation.section.tag.twig" } }, "name": "meta.tag.template.block.twig", "patterns": [{ "include": "#twig-constants" }, { "include": "#twig-keywords" }, { "include": "#twig-operators" }, { "include": "#twig-functions-warg" }, { "include": "#twig-functions" }, { "include": "#twig-macros" }, { "include": "#twig-filters-warg" }, { "include": "#twig-filters" }, { "include": "#twig-filters-warg-ud" }, { "include": "#twig-filters-ud" }, { "include": "#twig-objects" }, { "include": "#twig-properties" }, { "include": "#twig-strings" }, { "include": "#twig-arrays" }, { "include": "#twig-hashes" }] }, "twig-strings": { "patterns": [{ "begin": "(?:(?<!\\\\)|(?<=\\\\\\\\))'", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.twig" } }, "end": "(?:(?<!\\\\)|(?<=\\\\\\\\))'", "endCaptures": { "0": { "name": "punctuation.definition.string.end.twig" } }, "name": "string.quoted.single.twig" }, { "begin": '(?:(?<!\\\\)|(?<=\\\\\\\\))"', "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.twig" } }, "end": '(?:(?<!\\\\)|(?<=\\\\\\\\))"', "endCaptures": { "0": { "name": "punctuation.definition.string.end.twig" } }, "name": "string.quoted.double.twig" }] } }, "scopeName": "text.html.twig", "embeddedLangs": ["css", "javascript", "scss", "php", "python", "ruby"] });
var twig = [
...css,
...javascript,
...scss,
...php,
...python,
...ruby,
lang
];
export { twig as default };