-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypst-code.tmLanguage.json
More file actions
1 lines (1 loc) · 28.4 KB
/
Copy pathtypst-code.tmLanguage.json
File metadata and controls
1 lines (1 loc) · 28.4 KB
1
{"$schema":"https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json","scopeName":"source.typst-code","name":"typst-code","patterns":[{"include":"#code"}],"repository":{"common":{"patterns":[{"include":"#strictComments"},{"include":"#blockRaw"},{"include":"#inlineRaw"}]},"math":{"patterns":[{"include":"#markupEscape"},{"include":"#stringLiteral"},{"include":"#markupEnterCode"},{"begin":"([_^\\/\\u221A\\u221B\\u221C])\\s*([\\[\\(\\{\\u2308\\u230A\\u231C\\u231E\\u2772\\u27E6\\u27E8\\u27EA\\u27EC\\u27EE\\u2983\\u2985\\u2987\\u2989\\u298B\\u298D\\u298F\\u2991\\u2993\\u2995\\u2997\\u29D8\\u29DA\\u29FC])","end":"([\\]\\)\\}\\u2309\\u230B\\u231D\\u231F\\u2773\\u27E7\\u27E9\\u27EB\\u27ED\\u27EF\\u2984\\u2986\\u2988\\u298A\\u298C\\u298E\\u2990\\u2992\\u2994\\u2996\\u2998\\u29D9\\u29DB\\u29FD])|(?=\\$)|$","beginCaptures":{"1":{"name":"punctuation.math.operator.typst"},"2":{"name":"constant.other.symbol.typst"}},"endCaptures":{"0":{"name":"constant.other.symbol.typst"}},"patterns":[{"include":"#mathParen"},{"include":"#math"}]},{"match":"[_^'&\\/\\u221A\\u221B\\u221C]","name":"punctuation.math.operator.typst"},{"include":"#strictMathFuncCallOrPropAccess"},{"include":"#mathPrimary"},{"include":"#mathMoreBrace"}]},"markup":{"patterns":[{"include":"#common"},{"include":"#markupEnterCode"},{"include":"#markupEscape"},{"name":"punctuation.definition.linebreak.typst","match":"\\\\"},{"name":"punctuation.definition.nonbreaking-space.typst","match":"\\~"},{"name":"punctuation.definition.shy.typst","match":"-\\?"},{"name":"punctuation.definition.em-dash.typst","match":"---"},{"name":"punctuation.definition.en-dash.typst","match":"--"},{"name":"punctuation.definition.ellipsis.typst","match":"\\.\\.\\."},{"include":"#markupBold"},{"include":"#markupItalic"},{"include":"#markupLink"},{"include":"#markupMath"},{"include":"#markupHeading"},{"name":"punctuation.definition.list.unnumbered.typst","match":"^\\s*-\\s+"},{"name":"punctuation.definition.list.numbered.typst","match":"^\\s*([0-9]+\\.|\\+)\\s+"},{"include":"#markupLabel"},{"include":"#markupReference"},{"include":"#markupBrace"}]},"shebang":{"name":"comment.line.shebang.typst","begin":"^(#!)","beginCaptures":{"1":{"name":"punctuation.definition.comment.line.shebang.typst"}},"end":"\\n"},"code":{"patterns":[{"include":"#common"},{"include":"#comments"},{"name":"punctuation.terminator.statement.typst","match":";"},{"include":"#expression"}]},"comments":{"patterns":[{"include":"#blockComment"},{"include":"#tidyCommentTypeAnnotation"},{"include":"#docComment"},{"include":"#lineComment"}]},"codeBlock":{"begin":"\\{","end":"\\}","beginCaptures":{"0":{"name":"meta.brace.curly.typst"}},"endCaptures":{"0":{"name":"meta.brace.curly.typst"}},"patterns":[{"include":"#code"}]},"codeMath":{"name":"markup.math.typst","begin":"(?<![\\)\\]])\\$","end":"\\$","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.math.typst"}},"endCaptures":{"0":{"name":"punctuation.definition.string.end.math.typst"}},"patterns":[{"include":"#math"}]},"contentBlock":{"begin":"\\[","end":"\\]","beginCaptures":{"0":{"name":"meta.brace.square.typst"}},"endCaptures":{"0":{"name":"meta.brace.square.typst"}},"patterns":[{"include":"#contentBlock"},{"include":"#markup"}]},"keywordConstants":{"patterns":[{"name":"keyword.other.none.typst","match":"(?<!\\)|\\]|\\})\\bnone\\b(?!-)"},{"name":"keyword.other.auto.typst","match":"(?<!\\)|\\]|\\})\\bauto\\b(?!-)"},{"name":"constant.language.boolean.typst","match":"(?<!\\)|\\]|\\})\\b(false|true)\\b(?!-)"}]},"constants":{"patterns":[{"name":"constant.numeric.length.typst","match":"(?:\\d+\\.(?!\\d)|\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)(?<!\\.)(mm|pt|cm|in|em)($|\\b)"},{"name":"constant.numeric.angle.typst","match":"(?:\\d+\\.(?!\\d)|\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)(?<!\\.)(rad|deg)($|\\b)"},{"name":"constant.numeric.percentage.typst","match":"(?:\\d+\\.(?!\\d)|\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%"},{"name":"constant.numeric.fr.typst","match":"(?:\\d+\\.(?!\\d)|\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)(?<!\\.)fr"},{"name":"constant.numeric.integer.typst","match":"(?<!\\)|\\]|\\})(^|(?<=\\s|#)|\\b)\\d+\\b(?!\\.(?:[^\\p{XID_Start}_]|$)|[eE])"},{"name":"constant.numeric.hex.typst","match":"(?<!\\)|\\]|\\})(^|(?<=\\s|#)|\\b)0x[0-9a-fA-F]+\\b"},{"name":"constant.numeric.octal.typst","match":"(?<!\\)|\\]|\\})(^|(?<=\\s|#)|\\b)0o[0-7]+\\b"},{"name":"constant.numeric.binary.typst","match":"(?<!\\)|\\]|\\})(^|(?<=\\s|#)|\\b)0b[01]+\\b"},{"name":"constant.numeric.float.typst","match":"(?:\\d+\\.(?!\\d)|\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)(?:)"},{"include":"#stringLiteral"}]},"primitiveColors":{"match":"\\b(red|blue|green|black|white|gray|silver|eastern|navy|aqua|teal|purple|fuchsia|maroon|orange|yellow|olive|lime|ltr|rtl|ttb|btt|start|left|center|right|end|top|horizon|bottom)\\b(?!-)","name":"variable.other.constant.builtin.typst"},"primitiveFunctions":{"match":"\\b(?:luma|oklab|oklch|rgb|cmyk|range)\\b(?!-)","name":"support.function.builtin.typst"},"primitiveTypes":{"match":"\\b(any|str|int|float|bool|type|length|content|array|dictionary|arguments)\\b(?!-)","name":"entity.name.type.primitive.typst"},"identifier":{"match":"(?<!\\)|\\]|\\})\\b[\\p{XID_Start}_][\\p{XID_Continue}_\\-]*","name":"variable.other.readwrite.typst"},"paramOrArgName":{"match":"(?!(show|import|include)\\s*\\:)((?<!\\)|\\]|\\})\\b[\\p{XID_Start}_][\\p{XID_Continue}_\\-]*)\\s*(\\:)","captures":{"2":{"name":"variable.other.readwrite.typst"},"3":{"name":"punctuation.separator.colon.typst"}}},"stringLiteral":{"name":"string.quoted.double.typst","begin":"\"","end":"\"","beginCaptures":{"0":{"name":"punctuation.definition.string.typst"}},"endCaptures":{"0":{"name":"punctuation.definition.string.typst"}},"patterns":[{"match":"(\\\\(?:[^u]|u\\{?[0-9a-zA-Z]*\\}?))|[^\\\\\"]+","captures":{"1":{"name":"constant.character.escape.string.typst"}}}]},"strictComments":{"patterns":[{"include":"#blockComment"},{"include":"#tidyCommentTypeAnnotation"},{"include":"#docComment"},{"include":"#strictLineComment"}]},"blockComment":{"name":"comment.block.typst","begin":"\\/\\*","end":"\\*\\/","beginCaptures":{"0":{"name":"punctuation.definition.comment.typst"}},"patterns":[{"include":"#blockComment"}]},"lineComment":{"name":"comment.line.double-slash.typst","begin":"\\/\\/","end":"(?=$|\\n)","beginCaptures":{"0":{"name":"punctuation.definition.comment.typst"}}},"strictLineComment":{"name":"comment.line.double-slash.typst","begin":"(?<!:)\\/\\/","end":"(?=$|\\n)","beginCaptures":{"0":{"name":"punctuation.definition.comment.typst"}}},"tidyCommentTypeAnnotation":{"name":"comment.line.tidy.type-annotation.typst","begin":"(\\/\\/\\/)(\\s)(->)\\s*","end":"(?=$|\\n)","beginCaptures":{"1":{"name":"punctuation.definition.comment.tidy.typst"},"3":{"name":"punctuation.definition.tidy.type-annotation.typst"}},"patterns":[{"include":"#primitiveTypes"},{"name":"keyword.operator.separator.pipe.tidy.typst","match":"\\|"},{"name":"entity.name.type.custom.tidy.typst","match":"(?<!\\)|\\]|\\})\\b[\\p{XID_Start}_][\\p{XID_Continue}_\\-]*\\b(?!-)"}]},"docComment":{"name":"comment.line.tidy.typst","begin":"(\\/\\/\\/)\\s","end":"(?=$|\\n)","beginCaptures":{"1":{"name":"punctuation.definition.comment.tidy.typst"}},"patterns":[{"include":"#markupMath"}]},"mathIdentifier":{"match":"(?:(?<=_)|\\b)(?:(?!_)[\\p{XID_Start}])(?:(?!_)[\\p{XID_Continue}])+","name":"variable.other.readwrite.typst"},"mathBrace":{"name":"markup.content.brace.typst","match":"[{}]"},"mathParen":{"begin":"[\\[\\(\\{\\u2308\\u230A\\u231C\\u231E\\u2772\\u27E6\\u27E8\\u27EA\\u27EC\\u27EE\\u2983\\u2985\\u2987\\u2989\\u298B\\u298D\\u298F\\u2991\\u2993\\u2995\\u2997\\u29D8\\u29DA\\u29FC]","end":"([\\]\\)\\}\\u2309\\u230B\\u231D\\u231F\\u2773\\u27E7\\u27E9\\u27EB\\u27ED\\u27EF\\u2984\\u2986\\u2988\\u298A\\u298C\\u298E\\u2990\\u2992\\u2994\\u2996\\u2998\\u29D9\\u29DB\\u29FD])|(?=\\$)|$","beginCaptures":{"0":{"name":"markup.content.brace.typst"}},"endCaptures":{"0":{"name":"markup.content.brace.typst"}},"patterns":[{"include":"#mathParen"},{"include":"#math"}]},"mathPrimary":{"begin":"(?:(?<=_)|\\b)(?:(?!_)[\\p{XID_Start}])(?:(?!_)[\\p{XID_Continue}])+","beginCaptures":{"0":{"name":"variable.other.readwrite.typst"}},"end":"(?!(?:\\(|\\.[\\p{XID_Start}]))|(?=\\$)","patterns":[{"include":"#strictMathFuncCallOrPropAccess"},{"match":"(\\.)((?:(?!_)[\\p{XID_Start}])(?:(?!_)[\\p{XID_Continue}])*)","captures":{"1":{"name":"keyword.operator.accessor.typst"},"2":{"name":"variable.other.readwrite.typst"}}},{"include":"#mathCallArgs"},{"include":"#mathIdentifier"}]},"mathMoreBrace":{"name":"markup.content.brace.typst","match":"[{}()\\[\\]]"},"mathCallArgs":{"begin":"\\(","end":"\\)|(?=\\$)","beginCaptures":{"0":{"name":"meta.brace.round.typst"}},"endCaptures":{"0":{"name":"meta.brace.round.typst"}},"patterns":[{"include":"#comments"},{"include":"#mathParen"},{"match":",","name":"punctuation.separator.comma.typst"},{"include":"#math"}]},"strictMathFuncCallOrPropAccess":{"name":"meta.expr.call.typst","begin":"(?=(?:(?:(\\.)((?:(?!_)[\\p{XID_Start}])(?:(?!_)[\\p{XID_Continue}])*)|(?:(?<=_)|\\b)(?:(?!_)[\\p{XID_Start}])(?:(?!_)[\\p{XID_Continue}])+)(?=\\()))","end":"(?:(?<=[\\)])(?![\\(\\.]|(?:(?<=_)|\\b)(?:(?!_)[\\p{XID_Start}])(?:(?!_)[\\p{XID_Continue}])+(?=\\()))|(?=[\\$\\s;,\\}\\]\\)]|$)","patterns":[{"match":"\\.","name":"keyword.operator.accessor.typst"},{"match":"(?:(?<=_)|\\b)(?:(?!_)[\\p{XID_Start}])(?:(?!_)[\\p{XID_Continue}])+(?=\\()","name":"entity.name.function.typst","captures":{"0":{"name":"entity.name.function.typst","patterns":[{"include":"#primitiveFunctions"},{"include":"#primitiveTypes"},{"match":".*","name":"entity.name.function.typst"}]}}},{"include":"#mathIdentifier"},{"match":"(\\()\\s*(\\))","captures":{"1":{"name":"meta.brace.round.typst"},"2":{"name":"meta.brace.round.typst"}}},{"include":"#mathCallArgs"}]},"markupBrace":{"name":"markup.content.brace.typst","match":"[{}()\\[\\]]"},"markupMath":{"name":"markup.math.typst","begin":"\\$","end":"\\$","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.math.typst"}},"endCaptures":{"0":{"name":"punctuation.definition.string.end.math.typst"}},"patterns":[{"include":"#math"}]},"markupLabel":{"name":"string.other.label.typst","match":"<[\\p{XID_Start}_][\\p{XID_Continue}_\\-\\.:]*>"},"markupReference":{"name":"string.other.reference.typst","match":"(@)[\\p{XID_Start}_](?:[\\p{XID_Continue}_\\-]|[\\.:](?!:\\s|$|([\\.:]*[^\\p{XID_Continue}_\\-\\.:])))*","captures":{"1":{"name":"punctuation.definition.reference.typst"}}},"markupEscape":{"name":"constant.character.escape.content.typst","match":"\\\\(?:[^u]|u\\{?[0-9a-zA-Z]*\\}?)"},"markupHeading":{"name":"markup.heading.typst","begin":"^\\s*(=+)(?:(?=[\\r\\n]|$)|[^\\S\\n]+)","end":"\\n|(?=<)","beginCaptures":{"1":{"name":"punctuation.definition.heading.typst"}},"patterns":[{"include":"#markup"}]},"markupEnterCode":{"patterns":[{"match":"(#)\\s","captures":{"1":{"name":"punctuation.definition.hash.typst"}}},{"match":"(#)(;)","captures":{"1":{"name":"punctuation.definition.hash.typst"},"2":{"name":"punctuation.terminator.statement.typst"}}},{"begin":"#(?=(?:break|continue|and|or|not|return|as|in|include|import|let|else|if|for|while|context|set|show)\\b(?!-))","end":"(?<=;)|(?<=[\\}\\]\\)])(?![;\\(\\[\\$]|(?:\\.(?<!\\)|\\]|\\})\\b[\\p{XID_Start}_][\\p{XID_Continue}_\\-]*(?=[\\(\\[])))|(?<!#)(?=[\"\\_\\{])|(?<![#\\]\\}\\]])(?=\\[)|(?=\\.(?:[^0-9\\p{XID_Start}_]|$))|(?=[\\s,\\}\\]\\)\\#\\$\\+\\-\\*\\/\\=]|$)|(;)","beginCaptures":{"0":{"name":"keyword.control.hash.typst"}},"endCaptures":{"1":{"name":"punctuation.terminator.statement.typst"}},"patterns":[{"include":"#expression"}]},{"begin":"#(?=(?:any|str|int|float|bool|type|length|content|array|dictionary|arguments)\\b(?!-))","end":"(?<=;)|(?<=[\\}\\]\\)])(?![;\\(\\[\\$]|(?:\\.(?<!\\)|\\]|\\})\\b[\\p{XID_Start}_][\\p{XID_Continue}_\\-]*(?=[\\(\\[])))|(?<!#)(?=[\"\\_\\{])|(?<![#\\]\\}\\]])(?=\\[)|(?=\\.(?:[^0-9\\p{XID_Start}_]|$))|(?=[\\s,\\}\\]\\)\\#\\$\\+\\-\\*\\/\\=]|$)|(;)","beginCaptures":{"0":{"name":"entity.name.type.primitive.hash.typst"}},"endCaptures":{"1":{"name":"punctuation.terminator.statement.typst"}},"patterns":[{"include":"#expression"}]},{"begin":"#(?=(?:none)\\b(?!-))","end":"(?<=;)|(?<=[\\}\\]\\)])(?![;\\(\\[\\$]|(?:\\.(?<!\\)|\\]|\\})\\b[\\p{XID_Start}_][\\p{XID_Continue}_\\-]*(?=[\\(\\[])))|(?<!#)(?=[\"\\_\\{])|(?<![#\\]\\}\\]])(?=\\[)|(?=\\.(?:[^0-9\\p{XID_Start}_]|$))|(?=[\\s,\\}\\]\\)\\#\\$\\+\\-\\*\\/\\=]|$)|(;)","beginCaptures":{"0":{"name":"keyword.other.none.hash.typst"}},"endCaptures":{"1":{"name":"punctuation.terminator.statement.typst"}},"patterns":[{"include":"#expression"}]},{"begin":"#(?=(?:false|true)\\b(?!-))","end":"(?<=;)|(?<=[\\}\\]\\)])(?![;\\(\\[\\$]|(?:\\.(?<!\\)|\\]|\\})\\b[\\p{XID_Start}_][\\p{XID_Continue}_\\-]*(?=[\\(\\[])))|(?<!#)(?=[\"\\_\\{])|(?<![#\\]\\}\\]])(?=\\[)|(?=\\.(?:[^0-9\\p{XID_Start}_]|$))|(?=[\\s,\\}\\]\\)\\#\\$\\+\\-\\*\\/\\=]|$)|(;)","beginCaptures":{"0":{"name":"constant.language.boolean.hash.typst"}},"endCaptures":{"1":{"name":"punctuation.terminator.statement.typst"}},"patterns":[{"include":"#expression"}]},{"begin":"#(?=[\\p{XID_Start}_][\\p{XID_Continue}_\\-]*[\\(\\[])","end":"(?<=;)|(?<=[\\}\\]\\)])(?![;\\(\\[\\$]|(?:\\.(?<!\\)|\\]|\\})\\b[\\p{XID_Start}_][\\p{XID_Continue}_\\-]*(?=[\\(\\[])))|(?<!#)(?=[\"\\_\\{])|(?<![#\\]\\}\\]])(?=\\[)|(?=\\.(?:[^0-9\\p{XID_Start}_]|$))|(?=[\\s,\\}\\]\\)\\#\\$\\+\\-\\*\\/\\=]|$)|(;)","beginCaptures":{"0":{"name":"entity.name.function.hash.typst"}},"endCaptures":{"1":{"name":"punctuation.terminator.statement.typst"}},"patterns":[{"include":"#expression"}]},{"begin":"#(?=[\\p{XID_Start}_])","end":"(?<=;)|(?<=[\\}\\]\\)])(?![;\\(\\[\\$]|(?:\\.(?<!\\)|\\]|\\})\\b[\\p{XID_Start}_][\\p{XID_Continue}_\\-]*(?=[\\(\\[])))|(?<!#)(?=[\"\\_\\{])|(?<![#\\]\\}\\]])(?=\\[)|(?=\\.(?:[^0-9\\p{XID_Start}_]|$))|(?=[\\s,\\}\\]\\)\\#\\$\\+\\-\\*\\/\\=]|$)|(;)","beginCaptures":{"0":{"name":"variable.other.readwrite.hash.typst"}},"endCaptures":{"1":{"name":"punctuation.terminator.statement.typst"}},"patterns":[{"include":"#expression"}]},{"begin":"#(?=\\\")","end":"(?<=;)|(?<=[\\}\\]\\)])(?![;\\(\\[\\$]|(?:\\.(?<!\\)|\\]|\\})\\b[\\p{XID_Start}_][\\p{XID_Continue}_\\-]*(?=[\\(\\[])))|(?<!#)(?=[\"\\_\\{])|(?<![#\\]\\}\\]])(?=\\[)|(?=\\.(?:[^0-9\\p{XID_Start}_]|$))|(?=[\\s,\\}\\]\\)\\#\\$\\+\\-\\*\\/\\=]|$)|(;)","beginCaptures":{"0":{"name":"string.hash.hash.typst"}},"endCaptures":{"1":{"name":"punctuation.terminator.statement.typst"}},"patterns":[{"include":"#expression"}]},{"begin":"#(?=\\d|\\.\\d)","end":"(?<=;)|(?<=[\\}\\]\\)])(?![;\\(\\[\\$]|(?:\\.(?<!\\)|\\]|\\})\\b[\\p{XID_Start}_][\\p{XID_Continue}_\\-]*(?=[\\(\\[])))|(?<!#)(?=[\"\\_\\{])|(?<![#\\]\\}\\]])(?=\\[)|(?=\\.(?:[^0-9\\p{XID_Start}_]|$))|(?=[\\s,\\}\\]\\)\\#\\$\\+\\-\\*\\/\\=]|$)|(;)","beginCaptures":{"0":{"name":"constant.numeric.hash.typst"}},"endCaptures":{"1":{"name":"punctuation.terminator.statement.typst"}},"patterns":[{"include":"#expression"}]},{"begin":"#(?:)","end":"(?<=;)|(?<=[\\}\\]\\)])(?![;\\(\\[\\$]|(?:\\.(?<!\\)|\\]|\\})\\b[\\p{XID_Start}_][\\p{XID_Continue}_\\-]*(?=[\\(\\[])))|(?<!#)(?=[\"\\_\\{])|(?<![#\\]\\}\\]])(?=\\[)|(?=\\.(?:[^0-9\\p{XID_Start}_]|$))|(?=[\\s,\\}\\]\\)\\#\\$\\+\\-\\*\\/\\=]|$)|(;)","beginCaptures":{"0":{"name":"keyword.control.hash.typst"}},"endCaptures":{"1":{"name":"punctuation.terminator.statement.typst"}},"patterns":[{"include":"#expression"}]}]},"markupBold":{"name":"markup.bold.typst","begin":"(?:(^\\*|\\*$|((?<=[\\W\\p{Han}\\p{Hangul}\\p{Katakana}\\p{Hiragana}])\\*)|(\\*(?=[\\W\\p{Han}\\p{Hangul}\\p{Katakana}\\p{Hiragana}]))))","end":"(?:(^\\*|\\*$|((?<=[\\W\\p{Han}\\p{Hangul}\\p{Katakana}\\p{Hiragana}])\\*)|(\\*(?=[\\W\\p{Han}\\p{Hangul}\\p{Katakana}\\p{Hiragana}]))))|\\n|(?=\\])","beginCaptures":{"0":{"name":"punctuation.definition.bold.typst"}},"endCaptures":{"0":{"name":"punctuation.definition.bold.typst"}},"patterns":[{"include":"#markup"}]},"markupLink":{"name":"markup.underline.link.typst","begin":"(?:https?):\\/\\/","end":"(?=[\\s\\]\\)]|(?=[!,.:;?'](?:[\\s\\]\\)]|$)))","patterns":[{"include":"#markupLinkParen"},{"include":"#markupLinkBracket"},{"match":"(^|\\G)(?:[0-9a-zA-Z#$%&*\\+\\-\\/\\=\\@\\_\\~]+|(?:[!,.:;?']+(?![\\s\\]\\)]|$)))"}]},"markupLinkParen":{"begin":"\\(","end":"\\)|(?=[\\s\\]])","patterns":[{"include":"#markupLink"}]},"markupLinkBracket":{"begin":"\\[","end":"\\]|(?=[\\s\\)])","patterns":[{"include":"#markupLink"}]},"markupItalic":{"name":"markup.italic.typst","begin":"(?:(^_|_$|((?<=[\\W\\p{Han}\\p{Hangul}\\p{Katakana}\\p{Hiragana}])_)|(_(?=[\\W\\p{Han}\\p{Hangul}\\p{Katakana}\\p{Hiragana}]))))","end":"(?:(^_|_$|((?<=[\\W\\p{Han}\\p{Hangul}\\p{Katakana}\\p{Hiragana}])_)|(_(?=[\\W\\p{Han}\\p{Hangul}\\p{Katakana}\\p{Hiragana}]))))|\\n|(?=\\])","beginCaptures":{"0":{"name":"punctuation.definition.italic.typst"}},"endCaptures":{"0":{"name":"punctuation.definition.italic.typst"}},"patterns":[{"include":"#markup"}]},"inlineRaw":{"name":"markup.raw.inline.typst string.other.raw.typst","begin":"`","end":"`","beginCaptures":{"0":{"name":"punctuation.definition.raw.inline.typst"}},"endCaptures":{"0":{"name":"punctuation.definition.raw.inline.typst"}}},"blockRaw":{"patterns":[{"include":"#batchfile"},{"include":"#bibtex"},{"include":"#c"},{"include":"#clojure"},{"include":"#coffee"},{"include":"#cpp"},{"include":"#css"},{"include":"#cs"},{"include":"#dart"},{"include":"#diff"},{"include":"#dockerfile"},{"include":"#elixir"},{"include":"#erlang"},{"include":"#fs"},{"include":"#git-commit"},{"include":"#git-rebase"},{"include":"#go"},{"include":"#groovy"},{"include":"#handlebars"},{"include":"#html"},{"include":"#ini"},{"include":"#java"},{"include":"#js"},{"include":"#jsonc"},{"include":"#json"},{"include":"#julia"},{"include":"#latex"},{"include":"#less"},{"include":"#log"},{"include":"#lua"},{"include":"#makefile"},{"include":"#markdown"},{"include":"#objc"},{"include":"#perl"},{"include":"#perl6"},{"include":"#php"},{"include":"#powershell"},{"include":"#pug"},{"include":"#r"},{"include":"#regexp"},{"include":"#re"},{"include":"#ruby"},{"include":"#scss"},{"include":"#sql"},{"include":"#swift"},{"include":"#typst"},{"include":"#typst-code"},{"include":"#xml"},{"include":"#xsl"},{"include":"#yaml"},{"include":"#python"},{"include":"#rust"},{"include":"#scala"},{"include":"#shell"},{"include":"#ts"},{"include":"#tsx"},{"include":"#twig"},{"include":"#vb"},{"include":"#blockRawGeneral"}]},"blockRawGeneral":{"name":"markup.raw.block.typst","begin":"(`{3,})([\\p{XID_Start}_][\\p{XID_Continue}_\\-]*\\b)?","beginCaptures":{"1":{"name":"punctuation.definition.raw.begin.typst"},"2":{"name":"fenced_code.block.language.typst"}},"end":"(\\1)","endCaptures":{"1":{"name":"punctuation.definition.raw.end.typst"}}},"expression":{"patterns":[{"include":"#comments"},{"include":"#arrayOrDict"},{"include":"#contentBlock"},{"match":"\\b(else)\\b(?!-)","name":"keyword.control.conditional.typst"},{"match":"\\b(break|continue)\\b(?!-)","name":"keyword.control.loop.typst"},{"match":"\\b(in)\\b(?!-)","name":"keyword.other.range.typst"},{"match":"\\b(and|or|not)\\b(?!-)","name":"keyword.other.logical.typst"},{"match":"\\b(return)\\b(?!-)","name":"keyword.control.flow.typst"},{"include":"#markupLabel"},{"include":"#blockRaw"},{"include":"#inlineRaw"},{"include":"#codeBlock"},{"include":"#letStatement"},{"include":"#showStatement"},{"include":"#contextStatement"},{"include":"#setStatement"},{"include":"#forStatement"},{"include":"#whileStatement"},{"include":"#ifStatement"},{"include":"#importStatement"},{"include":"#includeStatement"},{"include":"#strictFuncCallOrPropAccess"},{"include":"#primitiveColors"},{"include":"#primitiveFunctions"},{"include":"#primitiveTypes"},{"include":"#keywordConstants"},{"include":"#identifier"},{"include":"#constants"},{"include":"#codeMath"},{"match":"(as)\\b(?!-)","name":"keyword.control.typst"},{"match":"(in)\\b(?!-)","name":"keyword.operator.range.typst"},{"match":"\\.\\.","name":"keyword.operator.spread.typst"},{"match":":","name":"punctuation.separator.colon.typst"},{"match":"\\.","name":"keyword.operator.accessor.typst"},{"match":",","name":"punctuation.separator.comma.typst"},{"match":"=>","name":"storage.type.function.arrow.typst"},{"match":"==|!=|<=|<|>=|>","name":"keyword.operator.relational.typst"},{"begin":"(\\+=|-=|\\*=|\\/=|=)","end":"(?=[\\n;\\}\\]\\)])","beginCaptures":{"1":{"name":"keyword.operator.assignment.typst"}},"patterns":[{"include":"#expression"}]},{"match":"\\+|\\\\|\\/|\\*|-","name":"keyword.operator.arithmetic.typst"}]},"arrayOrDict":{"patterns":[{"match":"(\\()\\s*(\\))","captures":{"1":{"name":"meta.brace.round.typst"},"2":{"name":"meta.brace.round.typst"}}},{"match":"(\\()\\s*(:)\\s*(\\))","captures":{"1":{"name":"meta.brace.round.typst"},"2":{"name":"punctuation.separator.colon.typst"},"3":{"name":"meta.brace.round.typst"}}},{"begin":"\\(","end":"\\)|(?=[;\\}\\]])","beginCaptures":{"0":{"name":"meta.brace.round.typst"}},"endCaptures":{"0":{"name":"meta.brace.round.typst"}},"patterns":[{"include":"#literalContent"}]}]},"literalContent":{"patterns":[{"include":"#paramOrArgName"},{"include":"#expression"}]},"contextStatement":{"name":"meta.expr.context.typst","begin":"\\bcontext\\b(?!-)","end":"(?<=[\\}\\]])|(?<!\\bcontext\\s*)(?=[\\{\\[])|(?=[$;\\}\\]\\)#\\n]|$)","beginCaptures":{"0":{"name":"keyword.control.other.typst"}},"patterns":[{"include":"#expression"}]},"includeStatement":{"name":"meta.expr.include.typst","begin":"(\\binclude\\b(?!-))\\s*","end":"(?=[\\n;\\}\\]\\)])","beginCaptures":{"1":{"name":"keyword.control.import.typst"}},"patterns":[{"include":"#comments"},{"include":"#expression"}]},"importStatement":{"name":"meta.expr.import.typst","begin":"(\\bimport\\b(?!-))\\s*","end":"(?=[\\n;\\}\\]\\)])","beginCaptures":{"1":{"name":"keyword.control.import.typst"}},"patterns":[{"include":"#comments"},{"include":"#importPathClause"},{"match":"\\:","name":"punctuation.separator.colon.typst"},{"match":"\\*","name":"keyword.operator.wildcard.typst"},{"match":"\\,","name":"punctuation.separator.comma.typst"},{"include":"#importAsClause"},{"include":"#expression"}]},"importPathClause":{"begin":"(\\bimport\\b(?!-))\\s*","end":"(?=\\:|as)","beginCaptures":{"1":{"name":"keyword.control.import.typst"}},"patterns":[{"include":"#comments"},{"include":"#expression"}]},"importAsClause":{"begin":"(\\bas\\b)\\s*","end":"(?=[\\s;\\}\\]\\)\\:])","beginCaptures":{"1":{"name":"keyword.control.import.typst"}},"patterns":[{"include":"#comments"},{"include":"#identifier"}]},"letStatement":{"name":"meta.expr.let.typst","begin":"(?=(?:(let\\b(?!-))))","end":"(?!\\=)(?=[\\s;\\}\\]\\)])","patterns":[{"include":"#comments"},{"include":"#letBindingClause"},{"include":"#letInitClause"}]},"letBindingClause":{"begin":"(let\\b(?!-))\\s*","end":"(?=[=;\\]}\\n])","beginCaptures":{"1":{"name":"storage.type.typst"}},"patterns":[{"include":"#comments"},{"begin":"(\\b[\\p{XID_Start}_][\\p{XID_Continue}_\\-]*)(\\()","end":"\\)|(?=[;\\}\\]])","beginCaptures":{"1":{"name":"entity.name.function.typst","patterns":[{"include":"#primitiveFunctions"}]},"2":{"name":"meta.brace.round.typst"}},"endCaptures":{"0":{"name":"meta.brace.round.typst"}},"patterns":[{"include":"#patternOrArgsBody"}]},{"begin":"\\(","end":"\\)|(?=[;\\}\\]])","beginCaptures":{"0":{"name":"meta.brace.round.typst"}},"endCaptures":{"0":{"name":"meta.brace.round.typst"}},"patterns":[{"include":"#patternOrArgsBody"}]},{"include":"#identifier"}]},"letInitClause":{"begin":"=\\s*","end":"(?=[\\n;\\}\\]\\)])","beginCaptures":{"0":{"name":"keyword.operator.assignment.typst"}},"patterns":[{"include":"#comments"},{"include":"#expression"}]},"ifStatement":{"name":"meta.expr.if.typst","begin":"(?=(?:(else\\s+)?(if\\b(?!-))))","end":"(?<=\\}|\\])(?!\\s*(else)\\b(?!-)|[\\[\\{])|(?<=else)(?!\\s*(?:if\\b(?!-)|[\\[\\{]))|(?=[$;\\}\\]\\)\\n]|$)","patterns":[{"include":"#comments"},{"include":"#ifClause"},{"include":"#elseClause"},{"include":"#codeBlock"},{"include":"#contentBlock"}]},"ifClause":{"begin":"\\bif\\b(?!-)","end":"(?<!(?:while|and|not|if|or|in|!=|==|<=|>=|<|>|\\+|-|\\*|\\/|=>|=|\\+=|-=|\\*=|\\/=)\\s*)(?=[\\[\\{\\n])|(?=[$;,\\}\\]\\)\\#\\n]|$)","beginCaptures":{"0":{"name":"keyword.control.conditional.typst"}},"patterns":[{"include":"#expression"}]},"elseClause":{"match":"\\belse\\b(?!-)","name":"keyword.control.conditional.typst"},"forStatement":{"name":"meta.expr.for.typst","begin":"(?=(?:(for\\b(?!-))\\s*))","end":"(?<=[\\}\\]])(?![\\{\\[])|(?=[$;\\}\\]\\)\\n]|$)","patterns":[{"include":"#comments"},{"include":"#forClause"},{"include":"#codeBlock"},{"include":"#contentBlock"}]},"forClause":{"begin":"(for\\b)\\s*","end":"(?<!(?:while|and|not|if|or|in|!=|==|<=|>=|<|>|\\+|-|\\*|\\/|=>|=|\\+=|-=|\\*=|\\/=)\\s*)(?=[\\[\\{\\n])|(?=[$;,\\}\\]\\)\\#\\n]|$)","beginCaptures":{"1":{"name":"keyword.control.loop.typst"}},"patterns":[{"include":"#expression"}]},"whileStatement":{"name":"meta.expr.while.typst","begin":"(?=(?:(while\\b(?!-))))","end":"(?<=[\\}\\]])(?![\\{\\[])|(?=[$;\\}\\]\\)\\n]|$)","patterns":[{"include":"#comments"},{"include":"#whileClause"},{"include":"#codeBlock"},{"include":"#contentBlock"}]},"whileClause":{"begin":"(while\\b)\\s*","end":"(?<!(?:while|and|not|if|or|in|!=|==|<=|>=|<|>|\\+|-|\\*|\\/|=>|=|\\+=|-=|\\*=|\\/=)\\s*)(?=[\\[\\{\\n])|(?=[$;,\\}\\]\\)\\#\\n]|$)","beginCaptures":{"1":{"name":"keyword.control.loop.typst"}},"patterns":[{"include":"#expression"}]},"setStatement":{"name":"meta.expr.set.typst","begin":"(?=(?:(set\\b(?!-))\\s*(?<!\\)|\\]|\\})\\b[\\p{XID_Start}_][\\p{XID_Continue}_\\-]*))","end":"(?<=\\))(?!\\s*if\\b)|(?=[$\\s;\\{\\[\\}\\]\\)])","patterns":[{"include":"#comments"},{"include":"#setClause"},{"include":"#setIfClause"}]},"setClause":{"begin":"(set\\b)\\s+","end":"(?=if)|(?=[$\\n;\\{\\[\\}\\]\\)])","beginCaptures":{"1":{"name":"keyword.control.other.typst"}},"patterns":[{"include":"#comments"},{"include":"#strictFuncCallOrPropAccess"},{"include":"#identifier"}]},"setIfClause":{"begin":"(if\\b(?!-))\\s*","end":"(?<=\\S)(?<!and|or|not|in|!=|==|<=|>=|<|>|\\+|-|\\*|\\/|=|\\+=|-=|\\*=|\\/=)(?!\\s*(?:and|or|not|in|!=|==|<=|>=|<|>|\\+|-|\\*|\\/|=|\\+=|-=|\\*=|\\/=|\\.))|(?=[\\n;\\}\\]\\)])","beginCaptures":{"1":{"name":"keyword.control.conditional.typst"}},"patterns":[{"include":"#comments"},{"include":"#expression"}]},"showStatement":{"name":"meta.expr.show.typst","begin":"(?=(?:(show\\b(?!-))))","end":"(?=[\\$\\s;\\{\\[\\}\\]\\)])","patterns":[{"include":"#comments"},{"include":"#showAnyClause"},{"include":"#showSelectClause"},{"include":"#showSubstClause"}]},"showAnyClause":{"match":"(show\\b)\\s*(?=\\:)","captures":{"1":{"name":"keyword.control.other.typst"}}},"showSelectClause":{"begin":"(show\\b)\\s*","end":"(?=[$:;\\}\\]\\n])","beginCaptures":{"1":{"name":"keyword.control.other.typst"}},"patterns":[{"include":"#comments"},{"include":"#markupLabel"},{"include":"#expression"}]},"showSubstClause":{"begin":"(\\:)\\s*","end":"(?=[\\n;\\}\\]\\)])","beginCaptures":{"1":{"name":"punctuation.separator.colon.typst"}},"patterns":[{"include":"#comments"},{"include":"#expression"}]},"callArgs":{"begin":"\\(","end":"\\)|(?=[;\\}\\]])","beginCaptures":{"0":{"name":"meta.brace.round.typst"}},"endCaptures":{"0":{"name":"meta.brace.round.typst"}},"patterns":[{"include":"#patternOrArgsBody"}]},"patternOrArgsBody":{"patterns":[{"include":"#comments"},{"include":"#paramOrArgName"},{"include":"#expression"}]},"strictFuncCallOrPropAccess":{"name":"meta.expr.call.typst","begin":"(?=(?:(?:(?<!\\)|\\]|\\})\\b[\\p{XID_Start}_][\\p{XID_Continue}_\\-]*.)*(?<!\\)|\\]|\\})\\b[\\p{XID_Start}_][\\p{XID_Continue}_\\-]*(?=\\(|\\[)))","end":"(?:(?<=\\)|\\])(?![\\[\\(\\.]))|(?=[\\$\\s;,\\}\\]\\)\\#]|$)","patterns":[{"match":"\\.","name":"keyword.operator.accessor.typst"},{"match":"(?<!\\)|\\]|\\})\\b[\\p{XID_Start}_][\\p{XID_Continue}_\\-]*(?=\\(|\\[)","captures":{"0":{"patterns":[{"include":"#primitiveFunctions"},{"include":"#primitiveTypes"},{"match":".*","name":"entity.name.function.typst"}]}}},{"match":"(?<!\\)|\\]|\\})\\b[\\p{XID_Start}_][\\p{XID_Continue}_\\-]*","name":"entity.name.module.typst"},{"match":"(\\()\\s*(\\))","captures":{"1":{"name":"meta.brace.round.typst"},"2":{"name":"meta.brace.round.typst"}}},{"include":"#callArgs"},{"include":"#contentBlock"}]},"funcCallOrPropAccess":{"name":"meta.expr.call.typst","begin":"(?=(?:(\\.\\s*)?(?<!\\)|\\]|\\})\\b[\\p{XID_Start}_][\\p{XID_Continue}_\\-]*\\s*(?=\\(|\\[)))","end":"(?:(?<=\\)|\\])(?![\\[\\(\\.]))|(?=[\\$\\n;,\\}\\]\\)\\#]|$)","patterns":[{"match":"\\.","name":"keyword.operator.accessor.typst"},{"match":"(?<!\\)|\\]|\\})\\b[\\p{XID_Start}_][\\p{XID_Continue}_\\-]*\\s*(?=\\(|\\[)","captures":{"0":{"patterns":[{"include":"#primitiveFunctions"},{"include":"#primitiveTypes"},{"match":".*","name":"entity.name.function.typst"}]}}},{"match":"(?<!\\)|\\]|\\})\\b[\\p{XID_Start}_][\\p{XID_Continue}_\\-]*","name":"entity.name.module.typst"},{"match":"(\\()\\s*(\\))","captures":{"1":{"name":"meta.brace.round.typst"},"2":{"name":"meta.brace.round.typst"}}},{"include":"#callArgs"},{"include":"#contentBlock"}]}}}