{ "name": "typst", "patterns": [ { "include": "#markup" } ], "repository": { "comments": { "patterns": [ { "name": "comment.block.typst", "begin": "/\\*", "end": "\\*/", "captures": { "0": { "name": "punctuation.definition.comment.typst" } }, "patterns": [{ "include": "#comments" }] }, { "name": "comment.line.double-slash.typst", "begin": "(?", "captures": { "1": { "name": "punctuation.definition.label.typst" } } }, { "name": "entity.other.reference.typst", "match": "(@)[[:alpha:]_][[:alnum:]_-]*", "captures": { "1": { "name": "punctuation.definition.reference.typst" } } }, { "begin": "(#)(let|set|show|context)\\b", "end": "\n|(;)|(?=])", "beginCaptures": { "0": { "name": "keyword.other.typst" }, "1": { "name": "punctuation.definition.keyword.typst" } }, "endCaptures": { "1": { "name": "punctuation.terminator.statement.typst" } }, "patterns": [{ "include": "#code" }] }, { "name": "keyword.other.typst", "match": "(#)(as|in)\\b", "captures": { "1": { "name": "punctuation.definition.keyword.typst" } } }, { "begin": "((#)if|(?<=(}|])\\s*)else)\\b", "end": "\n|(?=])|(?<=}|])", "beginCaptures": { "0": { "name": "keyword.control.conditional.typst" }, "2": { "name": "punctuation.definition.keyword.typst" } }, "patterns": [{ "include": "#code" }] }, { "begin": "(#)(for|while)\\b", "end": "\n|(?=])|(?<=}|])", "beginCaptures": { "0": { "name": "keyword.control.loop.typst" }, "1": { "name": "punctuation.definition.keyword.typst" } }, "patterns": [{ "include": "#code" }] }, { "name": "keyword.control.loop.typst", "match": "(#)(break|continue)\\b", "captures": { "1": { "name": "punctuation.definition.keyword.typst" } } }, { "begin": "(#)(import|include|export)\\b", "end": "\n|(;)|(?=])", "beginCaptures": { "0": { "name": "keyword.control.import.typst" }, "1": { "name": "punctuation.definition.keyword.typst" } }, "endCaptures": { "1": { "name": "punctuation.terminator.statement.typst" } }, "patterns": [{ "include": "#code" }] }, { "name": "keyword.control.flow.typst", "match": "(#)(return)\\b", "captures": { "1": { "name": "punctuation.definition.keyword.typst" } } }, { "comment": "Function name", "name": "entity.name.function.typst", "match": "((#)[[:alpha:]_][[:alnum:]_-]*!?)(?=\\[|\\()", "captures": { "2": { "name": "punctuation.definition.function.typst" } } }, { "comment": "Function arguments", "begin": "(?<=#[[:alpha:]_][[:alnum:]_-]*!?)\\(", "end": "\\)", "captures": { "0": { "name": "punctuation.definition.group.typst" } }, "patterns": [{ "include": "#arguments" }] }, { "name": "entity.other.interpolated.typst", "match": "(#)[[:alpha:]_][.[:alnum:]_-]*", "captures": { "1": { "name": "punctuation.definition.variable.typst" } } }, { "name": "meta.block.content.typst", "begin": "#", "end": "\\s", "patterns": [{ "include": "#code" }] } ] }, "code": { "patterns": [ { "include": "#common" }, { "name": "meta.block.code.typst", "begin": "{", "end": "}", "captures": { "0": { "name": "punctuation.definition.block.code.typst" } }, "patterns": [{ "include": "#code" }] }, { "name": "meta.block.content.typst", "begin": "\\[", "end": "\\]", "captures": { "0": { "name": "punctuation.definition.block.content.typst" } }, "patterns": [{ "include": "#markup" }] }, { "name": "comment.line.double-slash.typst", "begin": "//", "end": "\n", "beginCaptures": { "0": { "name": "punctuation.definition.comment.typst" } } }, { "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": "\\+=|-=|\\*=|/=|=" }, { "name": "keyword.operator.arithmetic.typst", "match": "\\+|\\*|/|(?