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

7 lines
8.9 KiB
JavaScript
Raw Permalink Normal View History

2024-10-14 06:09:33 +00:00
const lang = Object.freeze({ "displayName": "Typst", "name": "typst", "patterns": [{ "include": "#markup" }], "repository": { "arguments": { "patterns": [{ "match": "\\b[[:alpha:]_][[:alnum:]_-]*(?=:)", "name": "variable.parameter.typst" }, { "include": "#code" }] }, "code": { "patterns": [{ "include": "#common" }, { "begin": "{", "captures": { "0": { "name": "punctuation.definition.block.code.typst" } }, "end": "}", "name": "meta.block.code.typst", "patterns": [{ "include": "#code" }] }, { "begin": "\\[", "captures": { "0": { "name": "punctuation.definition.block.content.typst" } }, "end": "\\]", "name": "meta.block.content.typst", "patterns": [{ "include": "#markup" }] }, { "begin": "//", "beginCaptures": { "0": { "name": "punctuation.definition.comment.typst" } }, "end": "\n", "name": "comment.line.double-slash.typst" }, { "match": ":", "name": "punctuation.separator.colon.typst" }, { "match": ",", "name": "punctuation.separator.comma.typst" }, { "match": "=>|\\.\\.", "name": "keyword.operator.typst" }, { "match": "==|!=|<=|<|>=|>", "name": "keyword.operator.relational.typst" }, { "match": "\\+=|-=|\\*=|/=|=", "name": "keyword.operator.assignment.typst" }, { "match": "\\+|\\*|/|(?<![[:alpha:]_][[:alnum:]_-]*)-(?![:alnum:]_-]*[[:alpha:]_])", "name": "keyword.operator.arithmetic.typst" }, { "match": "\\b(and|or|not)\\b", "name": "keyword.operator.word.typst" }, { "match": "\\b(let|as|in|set|show)\\b", "name": "keyword.other.typst" }, { "match": "\\b(if|else)\\b", "name": "keyword.control.conditional.typst" }, { "match": "\\b(for|while|break|continue)\\b", "name": "keyword.control.loop.typst" }, { "match": "\\b(import|include|export)\\b", "name": "keyword.control.import.typst" }, { "match": "\\b(return)\\b", "name": "keyword.control.flow.typst" }, { "include": "#constants" }, { "comment": "Function name", "match": "\\b[[:alpha:]_][[:alnum:]_-]*!?(?=\\[|\\()", "name": "entity.name.function.typst" }, { "comment": "Function name", "match": "(?<=\\bshow\\s*)\\b[[:alpha:]_][[:alnum:]_-]*(?=\\s*[:.])", "name": "entity.name.function.typst" }, { "begin": "(?<=\\b[[:alpha:]_][[:alnum:]_-]*!?)\\(", "captures": { "0": { "name": "punctuation.definition.group.typst" } }, "comment": "Function arguments", "end": "\\)", "patterns": [{ "include": "#arguments" }] }, { "match": "\\b[[:alpha:]_][[:alnum:]_-]*\\b", "name": "variable.other.typst" }, { "begin": "\\(", "captures": { "0": { "name": "punctuation.definition.group.typst" } }, "end": "\\)|(?=;)", "name": "meta.group.typst", "patterns": [{ "include": "#code" }] }] }, "comments": { "patterns": [{ "begin": "/\\*", "captures": { "0": { "name": "punctuation.definition.comment.typst" } }, "end": "\\*/", "name": "comment.block.typst", "patterns": [{ "include": "#comments" }] }, { "begin": "(?<!:)//", "beginCaptures": { "0": { "name": "punctuation.definition.comment.typst" } }, "end": "\n", "name": "comment.line.double-slash.typst", "patterns": [{ "include": "#comments" }] }] }, "common": { "patterns": [{ "include": "#comments" }] }, "constants": { "patterns": [{ "match": "\\bnone\\b", "name": "constant.language.none.typst" }, { "match": "\\bauto\\b", "name": "constant.language.auto.typst" }, { "match": "\\b(true|false)\\b", "name": "constant.language.boolean.typst" }, { "match": "\\b(\\d*)?\\.?\\d+([eE][+-]?\\d+)?(mm|pt|cm|in|em)\\b", "name": "constant.numeric.length.typst" }, { "match": "\\b(\\d*)?\\.?\\d+([eE][+-]?\\d+)?(rad|deg)\\b", "name": "constant.numeric.angle.typst" }, { "match": "\\b(\\d*)?\\.?\\d+([eE][+-]?\\d+)?%", "name": "constant.numeric.percentage.typst" }, { "match": "\\b(\\d*)?\\.?\\d+([eE][+-]?\\d+)?fr", "name": "constant.numeric.fr.typst" }, { "match": "\\b\\d+\\b", "name": "constant.numeric.integer.typst" }, { "match": "\\b(\\d*)?\\.?\\d+([eE][+-]?\\d+)?\\b", "name": "constant.numeric.float.typst" }, { "begin": '"', "captures": { "0": { "name": "punctuation.definition.string.typst" } }, "end": '"', "name": "string.quoted.double.typst", "patterns": [{ "match": '\\\\([\\\\"nrt]|u\\{?[0-9a-zA-Z]*\\}?)', "name": "constant.character.escape.string.typst" }] }, { "begin": "\
var typst = [
lang
];
export { typst as default };