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

12 lines
7.5 KiB
JavaScript
Raw Normal View History

2024-10-14 06:09:33 +00:00
import html from './html.mjs';
import './javascript.mjs';
import './css.mjs';
const lang = Object.freeze({ "displayName": "Closure Templates", "fileTypes": ["soy"], "injections": { "meta.tag": { "patterns": [{ "include": "#body" }] } }, "name": "soy", "patterns": [{ "include": "#alias" }, { "include": "#delpackage" }, { "include": "#namespace" }, { "include": "#template" }, { "include": "#comment" }], "repository": { "alias": { "captures": { "1": { "name": "storage.type.soy" }, "2": { "name": "entity.name.type.soy" }, "3": { "name": "storage.type.soy" }, "4": { "name": "entity.name.type.soy" } }, "match": "{(alias)\\s+([\\w\\.]+)(?:\\s+(as)\\s+(\\w+))?}" }, "attribute": { "captures": { "1": { "name": "storage.other.attribute.soy" }, "2": { "name": "string.double.quoted.soy" } }, "match": '(\\w+)=("(?:\\\\?.)*?")' }, "body": { "patterns": [{ "include": "#comment" }, { "include": "#let" }, { "include": "#call" }, { "include": "#css" }, { "include": "#xid" }, { "include": "#condition" }, { "include": "#condition-control" }, { "include": "#for" }, { "include": "#literal" }, { "include": "#msg" }, { "include": "#special-character" }, { "include": "#print" }, { "include": "text.html.basic" }] }, "boolean": { "match": "true|false", "name": "language.constant.boolean.soy" }, "call": { "patterns": [{ "begin": "{((?:del)?call)\\s+([\\w\\.]+)(?=[^/]*?})", "beginCaptures": { "1": { "name": "storage.type.function.soy" }, "2": { "name": "entity.name.function.soy" } }, "end": "{/(\\1)}", "endCaptures": { "1": { "name": "storage.type.function.soy" } }, "patterns": [{ "include": "#comment" }, { "include": "#variant" }, { "include": "#attribute" }, { "include": "#param" }] }, { "begin": "{((?:del)?call)(\\s+[\\w\\.]+)", "beginCaptures": { "1": { "name": "storage.type.function.soy" }, "2": { "name": "entity.name.function.soy" } }, "end": "/}", "patterns": [{ "include": "#variant" }, { "include": "#attribute" }] }] }, "comment": { "patterns": [{ "begin": "/\\*", "end": "\\*/", "name": "comment.block.documentation.soy", "patterns": [{ "captures": { "1": { "name": "keyword.parameter.soy" }, "2": { "name": "variable.parameter.soy" } }, "match": "(@param\\??)\\s+(\\S+)" }] }, { "match": "^\\s*(\\/\\/.*)$", "name": "comment.line.double-slash.soy" }] }, "condition": { "begin": "{/?(if|elseif|switch|case)\\s*", "beginCaptures": { "1": { "name": "keyword.control.soy" } }, "end": "}", "patterns": [{ "include": "#attribute" }, { "include": "#expression" }] }, "condition-control": { "captures": { "1": { "name": "keyword.control.soy" } }, "match": "{(else|ifempty|default)}" }, "css": { "begin": "{(css)\\s+", "beginCaptures": { "1": { "name": "keyword.other.soy" } }, "end": "}", "patterns": [{ "include": "#expression" }] }, "delpackage": { "captures": { "1": { "name": "storage.type.soy" }, "2": { "name": "entity.name.type.soy" } }, "match": "{(delpackage)\\s+([\\w\\.]+)}" }, "expression": { "patterns": [{ "include": "#boolean" }, { "include": "#number" }, { "include": "#function" }, { "include": "#null" }, { "include": "#string" }, { "include": "#variable-ref" }, { "include": "#operator" }] }, "for": { "begin": "{/?(foreach|for)(?=\\s|})", "beginCaptures": { "1": { "name": "keyword.control.soy" } }, "end": "}", "patterns": [{ "match": "in", "name": "keyword.control.soy" }, { "include": "#expression" }, { "include": "#body" }] }, "function": { "begin": "(\\w+)\\(", "beginCaptures": { "1": { "name": "support.function.soy" } }, "end": "\\)", "patterns": [{ "include": "#expression" }] }, "let": { "patterns": [{ "begin": "{(let)\\s+(\\$\\w+\\s*:)", "beginCaptures": { "1": { "name": "storage.type.soy" }, "2": { "name": "variable.soy" } }, "end": "/}", "patterns": [{ "include": "#comment" }, { "include": "#expression" }] }, { "begin": "{(let)\\s+(\\$\\w+)", "beginCaptures": { "1": { "name": "storage.type.soy" }, "2": { "name": "variable.soy" } }, "end": "{/(\\1)}", "endCaptures": { "1": { "name": "storage.type.soy" } }, "patterns": [{ "include": "#attribute" }, { "include": "#body" }] }] }, "literal": { "begin": "{(literal)}", "beginCaptures": { "1": { "name": "keyword.other.soy" } }, "end": "{/(\\1)}", "endCaptures": { "1": { "name":
var soy = [
...html,
lang
];
export { soy as default };