feat: mark correct expression boundary on all testing files from typst/typst (#85)

* fix: comment and set rules

* fix: losen for rules

* fix: chore field, escape

* fix: hash termination

* dev: handle math mode

* fix: terminate expressions on right braces

* dev: match spread operator

* dev: remove complex check on if

* dev: add two bugs

* dev: fix if/while conditions

* fix: terminate expressions on right braces 2
This commit is contained in:
Myriad-Dreamin 2024-03-23 01:19:43 +08:00 committed by GitHub
parent 10c3e0134a
commit 2e7c7732dc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
29 changed files with 1317 additions and 182 deletions

View file

@ -1,2 +1,3 @@
*.tmLanguage.json *.tmLanguage.json
dist dist
tests/official-testing

View file

@ -29,7 +29,7 @@ const CONTENT_BLOCK = generatePattern(6, "\\[", "\\]");
const BRACE_FREE_EXPR = /[^\s\}\{\[\]][^\}\{\[\]]*/.source; const BRACE_FREE_EXPR = /[^\s\}\{\[\]][^\}\{\[\]]*/.source;
const BRACE_AWARE_EXPR = const BRACE_AWARE_EXPR =
BRACE_FREE_EXPR + BRACE_FREE_EXPR +
`(?:(?:${CODE_BLOCK})|(?:${CONTENT_BLOCK})${BRACE_FREE_EXPR})?`; `(?:(?:(?:${CODE_BLOCK})|(?:${CONTENT_BLOCK}))${BRACE_FREE_EXPR})?`;
// todo: This is invokable // todo: This is invokable
const codeBlock: textmate.Pattern = { const codeBlock: textmate.Pattern = {
@ -54,7 +54,7 @@ const codeBlock: textmate.Pattern = {
}; };
const contentBlock: textmate.Pattern = { const contentBlock: textmate.Pattern = {
// name: "meta.block.continuous.typst", // name: "meta.block.content.typst",
begin: /\[/, begin: /\[/,
end: /\]/, end: /\]/,
beginCaptures: { beginCaptures: {
@ -96,11 +96,7 @@ const IDENTIFIER = /(?<!\)|\]|\})\b[\p{XID_Start}_][\p{XID_Continue}_-]*\b/;
// todo: distinguish type and variable // todo: distinguish type and variable
const identifier: textmate.PatternMatch = { const identifier: textmate.PatternMatch = {
match: IDENTIFIER, match: IDENTIFIER,
captures: {
"0": {
name: "variable.other.readwrite.typst", name: "variable.other.readwrite.typst",
},
},
}; };
const markupLabel: textmate.PatternMatch = { const markupLabel: textmate.PatternMatch = {
@ -118,37 +114,9 @@ const markupReference: textmate.PatternMatch = {
}, },
}; };
// todo: math mode const markupEscape: textmate.PatternMatch = {
const markupMath: textmate.Pattern = { name: "constant.character.escape.content.typst",
name: "markup.math.typst", match: /\\(?:[^u]|u\{?[0-9a-zA-Z]*\}?)/,
begin: /\$/,
end: /\$/,
beginCaptures: {
"0": {
name: "punctuation.definition.string.math.typst",
},
},
endCaptures: {
"0": {
name: "punctuation.definition.string.math.typst",
},
},
};
const markupHeading: textmate.Pattern = {
name: "markup.heading.typst",
begin: /^\s*=+\s+/,
end: /\n|(?=<)/,
beginCaptures: {
"0": {
name: "punctuation.definition.heading.typst",
},
},
patterns: [
{
include: "#markup",
},
],
}; };
const stringLiteral: textmate.PatternBeginEnd = { const stringLiteral: textmate.PatternBeginEnd = {
@ -177,6 +145,47 @@ const stringLiteral: textmate.PatternBeginEnd = {
], ],
}; };
// todo: math mode
const markupMath: textmate.Pattern = {
name: "markup.math.typst",
begin: /\$/,
end: /\$/,
beginCaptures: {
"0": {
name: "punctuation.definition.string.math.typst",
},
},
endCaptures: {
"0": {
name: "punctuation.definition.string.math.typst",
},
},
patterns: [
{
include: "#markupEscape",
},
{
include: "#markupEnterCode",
},
],
};
const markupHeading: textmate.Pattern = {
name: "markup.heading.typst",
begin: /^\s*=+\s+/,
end: /\n|(?=<)/,
beginCaptures: {
"0": {
name: "punctuation.definition.heading.typst",
},
},
patterns: [
{
include: "#markup",
},
],
};
const common: textmate.Pattern = { const common: textmate.Pattern = {
patterns: [ patterns: [
{ {
@ -200,8 +209,7 @@ const markup: textmate.Pattern = {
include: "#markupEnterCode", include: "#markupEnterCode",
}, },
{ {
name: "constant.character.escape.content.typst", include: "#markupEscape",
match: /\\(?:[^u]|u\{?[0-9a-zA-Z]*\}?)/,
}, },
{ {
name: "punctuation.definition.linebreak.typst", name: "punctuation.definition.linebreak.typst",
@ -306,7 +314,7 @@ const markupEnterCode: textmate.Pattern = {
{ {
/// name: 'markup.expr.typst' /// name: 'markup.expr.typst'
begin: /#/, begin: /#/,
end: /(?<=;)|(?<=[\)\]\}])(?![;\(\[])|(?=\s)|(;)/, end: /(?<=;)|(?<=[\)\]\}])(?![;\(\[])|(?=[\s\]\}\)]|$)|(;)/,
beginCaptures: { beginCaptures: {
"0": { "0": {
name: "punctuation.definition.hash.typst", name: "punctuation.definition.hash.typst",
@ -424,25 +432,26 @@ const expression = (): textmate.Grammar => {
{ include: "#codeBlock" }, { include: "#codeBlock" },
{ include: "#letStatement" }, { include: "#letStatement" },
{ include: "#showStatement" }, { include: "#showStatement" },
{ include: "#contextStatement" },
{ include: "#setStatement" }, { include: "#setStatement" },
{ include: "#forStatement" }, { include: "#forStatement" },
{ include: "#whileStatement" }, { include: "#whileStatement" },
{ include: "#ifStatement" }, { include: "#ifStatement" },
{ include: "#importStatement" }, { include: "#importStatement" },
{ include: "#includeStatement" }, { include: "#includeStatement" },
{ include: "#strictFuncCall" }, { include: "#strictFuncCallOrPropAccess" },
{ include: "#primitiveColors" }, { include: "#primitiveColors" },
{ include: "#primitiveFunctions" }, { include: "#primitiveFunctions" },
{ include: "#primitiveTypes" }, { include: "#primitiveTypes" },
{ include: "#identifier" }, { include: "#identifier" },
{ include: "#constants" }, { include: "#constants" },
{ {
match: /(as|in)\b/, match: /(as)\b/,
captures: {
"1": {
name: "keyword.control.typst", name: "keyword.control.typst",
}, },
}, {
match: /(in)\b/,
name: "keyword.operator.range.typst",
}, },
{ {
match: /\./, match: /\./,
@ -563,7 +572,7 @@ const blockComment: textmate.Pattern = {
}, },
patterns: [ patterns: [
{ {
include: "#comments", include: "#blockComment",
}, },
], ],
}; };
@ -578,11 +587,6 @@ const lineCommentInner = (strict: boolean): textmate.Pattern => {
name: "punctuation.definition.comment.typst", name: "punctuation.definition.comment.typst",
}, },
}, },
patterns: [
{
include: "#comments",
},
],
}; };
}; };
@ -666,7 +670,7 @@ const markupItalic = markupAnnotate("_", "italic");
const includeStatement: textmate.Pattern = { const includeStatement: textmate.Pattern = {
name: "meta.expr.include.typst", name: "meta.expr.include.typst",
begin: /(\binclude\b)\s*/, begin: /(\binclude\b)\s*/,
end: /(?=[\n\}\];])/, end: /(?=[\n;\}\]\)])/,
beginCaptures: { beginCaptures: {
"1": { "1": {
name: "keyword.control.import.typst", name: "keyword.control.import.typst",
@ -687,7 +691,7 @@ const importStatement = (): textmate.Grammar => {
const importStatement: textmate.Pattern = { const importStatement: textmate.Pattern = {
name: "meta.expr.import.typst", name: "meta.expr.import.typst",
begin: /(\bimport\b)\s*/, begin: /(\bimport\b)\s*/,
end: /(?=[\n\}\];])/, end: /(?=[\n;\}\]\)])/,
beginCaptures: { beginCaptures: {
"1": { "1": {
name: "keyword.control.import.typst", name: "keyword.control.import.typst",
@ -743,7 +747,7 @@ const importStatement = (): textmate.Grammar => {
/// as expression /// as expression
const importAsClause: textmate.Pattern = { const importAsClause: textmate.Pattern = {
begin: /(\bas\b)\s*/, begin: /(\bas\b)\s*/,
end: /(?=[\s\}\];])/, end: /(?=[\s;\}\]\)])/,
beginCaptures: { beginCaptures: {
"1": { "1": {
name: "keyword.control.import.typst", name: "keyword.control.import.typst",
@ -772,7 +776,7 @@ const letStatement = (): textmate.Grammar => {
const letStatement: textmate.Pattern = { const letStatement: textmate.Pattern = {
name: "meta.expr.let.typst", name: "meta.expr.let.typst",
begin: lookAhead(/(let\b)/), begin: lookAhead(/(let\b)/),
end: /(?!\()(?=[\s\}\]\);])/, end: /(?!\()(?=[\s;\}\]\)])/,
patterns: [ patterns: [
/// Matches any comments /// Matches any comments
{ {
@ -879,19 +883,14 @@ const letStatement = (): textmate.Grammar => {
}; };
}; };
// todo: #if [] == [] [] {}
/** /**
* Matches a (strict grammar) if in markup context. * Matches a (strict grammar) if in markup context.
*/ */
const ifStatement = (): textmate.Grammar => { const ifStatement = (): textmate.Grammar => {
const ifStatement: textmate.Pattern = { const ifStatement: textmate.Pattern = {
name: "meta.expr.if.typst", name: "meta.expr.if.typst",
begin: lookAhead( begin: lookAhead(/(else\b)?(if\b)/),
new RegExp(
/(else\b)?(if\b)\s+/.source +
`(?:${BRACE_AWARE_EXPR})` +
/\s*[\{\[]/.source
)
),
end: /(?<=\}|\])(?!\s*else)/, end: /(?<=\}|\])(?!\s*else)/,
patterns: [ patterns: [
/// Matches any comments /// Matches any comments
@ -926,7 +925,7 @@ const ifStatement = (): textmate.Grammar => {
const ifClause: textmate.Pattern = { const ifClause: textmate.Pattern = {
// name: "meta.if.clause.typst", // name: "meta.if.clause.typst",
begin: /(else\b)?(if)\s+/, begin: /(else\b)?(if)\s+/,
end: /(?=[;\[\]{}]|$)/, end: /(?<!(?:if|and|or|not|in|!=|==|<=|>=|<|>|\+|-|\*|\/|=|\+=|-=|\*=|\/=)\s+)(?=[\[\{])|(?=[;\]}]|$)/,
beginCaptures: { beginCaptures: {
"1": { "1": {
name: "keyword.control.conditional.typst", name: "keyword.control.conditional.typst",
@ -1007,14 +1006,8 @@ const forStatement = (): textmate.Grammar => {
// for v in expr { ... } // for v in expr { ... }
const forStatement: textmate.Pattern = { const forStatement: textmate.Pattern = {
name: "meta.expr.for.typst", name: "meta.expr.for.typst",
begin: lookAhead( begin: lookAhead(/(for\b)\s*/),
new RegExp( end: /(?<=[\}\]])(?=\s*[\n\S;\}\]\)])(?!\s*[\{\[])/,
/(for\b)\s*/.source +
`(?:${BRACE_FREE_EXPR})\\s*(in)\\s*(?:${BRACE_AWARE_EXPR})` +
/\s*[\{\[]/.source
)
),
end: /(?<=\}|\])/,
patterns: [ patterns: [
/// Matches any comments /// Matches any comments
{ {
@ -1038,8 +1031,10 @@ const forStatement = (): textmate.Grammar => {
const forClause: textmate.Pattern = { const forClause: textmate.Pattern = {
// name: "meta.for.clause.bind.typst", // name: "meta.for.clause.bind.typst",
// todo: consider comment in for /* {} */ in .. {} // todo: consider comment in for /* {} */ in .. {}
begin: new RegExp(/(for\b)\s*/.source + `(${BRACE_FREE_EXPR})\\s*(in)\\s*`), begin: new RegExp(
end: /(?=[;\[\]{}]|$)/, /(for\b)\s*/.source + `(${BRACE_FREE_EXPR}|${CODE_BLOCK})\\s*(in)\\s*`
),
end: /(?=[;{\[\}\]\)]|$)/,
beginCaptures: { beginCaptures: {
"1": { "1": {
name: "keyword.control.loop.typst", name: "keyword.control.loop.typst",
@ -1096,11 +1091,7 @@ const whileStatement = (): textmate.Grammar => {
// for v in expr { ... } // for v in expr { ... }
const whileStatement: textmate.Pattern = { const whileStatement: textmate.Pattern = {
name: "meta.expr.while.typst", name: "meta.expr.while.typst",
begin: lookAhead( begin: lookAhead(/(while\b)/),
new RegExp(
/(while\b)\s*/.source + `(?:${BRACE_AWARE_EXPR})` + /\s*[\{\[]/.source
)
),
end: /(?<=\}|\])/, end: /(?<=\}|\])/,
patterns: [ patterns: [
/// Matches any comments /// Matches any comments
@ -1125,7 +1116,7 @@ const whileStatement = (): textmate.Grammar => {
const whileClause: textmate.Pattern = { const whileClause: textmate.Pattern = {
// name: "meta.while.clause.bind.typst", // name: "meta.while.clause.bind.typst",
begin: /(while\b)\s*/, begin: /(while\b)\s*/,
end: /(?=[;\[\]{}]|$)/, end: /(?<!(?:if|and|or|not|in|!=|==|<=|>=|<|>|\+|-|\*|\/|=|\+=|-=|\*=|\/=)\s+)(?=[\[\{])|(?=[;\}\]\)]|$)/,
beginCaptures: { beginCaptures: {
"1": { "1": {
name: "keyword.control.loop.typst", name: "keyword.control.loop.typst",
@ -1149,11 +1140,30 @@ const whileStatement = (): textmate.Grammar => {
}; };
}; };
const contextStatement: textmate.Pattern = {
name: "meta.expr.context.typst",
begin: /(context\b)\s*/,
end: /(?=[\n;\}\]\)])/,
beginCaptures: {
"1": {
name: "keyword.control.other.typst",
},
},
patterns: [
{
include: "#comments",
},
{
include: "#expression",
},
],
};
const setStatement = (): textmate.Grammar => { const setStatement = (): textmate.Grammar => {
const setStatement: textmate.Pattern = { const setStatement: textmate.Pattern = {
name: "meta.expr.set.typst", name: "meta.expr.set.typst",
begin: lookAhead(new RegExp(/(set\b)\s*/.source + IDENTIFIER.source)), begin: lookAhead(new RegExp(/(set\b)\s*/.source + IDENTIFIER.source)),
end: /(?<=\))(?!if)|(?=[\s\{\}\[\];])/, end: /(?<=\))(?!if)|(?=[\s;\{\[\}\]\)])/,
patterns: [ patterns: [
/// Matches any comments /// Matches any comments
{ {
@ -1173,7 +1183,7 @@ const setStatement = (): textmate.Grammar => {
const setClause: textmate.Pattern = { const setClause: textmate.Pattern = {
// name: "meta.set.clause.bind.typst", // name: "meta.set.clause.bind.typst",
begin: /(set\b)\s*/, begin: /(set\b)\s*/,
end: /(?=if)|(?=[;\]}])/, end: /(?=if)|(?=[\n;\]}])/,
beginCaptures: { beginCaptures: {
"1": { "1": {
name: "keyword.control.other.typst", name: "keyword.control.other.typst",
@ -1185,7 +1195,7 @@ const setStatement = (): textmate.Grammar => {
}, },
/// Matches a func call after the set clause /// Matches a func call after the set clause
{ {
include: "#funcCall", include: "#strictFuncCallOrPropAccess",
}, },
{ {
include: "#identifier", include: "#identifier",
@ -1196,7 +1206,7 @@ const setStatement = (): textmate.Grammar => {
const setIfClause: textmate.Pattern = { const setIfClause: textmate.Pattern = {
// name: "meta.set.if.clause.cond.typst", // name: "meta.set.if.clause.cond.typst",
begin: /(if)\s*/, begin: /(if)\s*/,
end: /(?<=\S)(?<!not|and|or|\+|-|\*|\/|==|!=|<=|>=|\<|\>)(?!\s*(?:not|and|or|\+|-|\*|\/|==|!=|\<|\>|\.))|(?=[;\]}])/, end: /(?<=\S)(?<!and|or|not|in|!=|==|<=|>=|<|>|\+|-|\*|\/|=|\+=|-=|\*=|\/=)(?!\s*(?:and|or|not|in|!=|==|<=|>=|<|>|\+|-|\*|\/|=|\+=|-=|\*=|\/=|\.))|(?=[\n;\}\]\)])/,
beginCaptures: { beginCaptures: {
"1": { "1": {
name: "keyword.control.conditional.typst", name: "keyword.control.conditional.typst",
@ -1225,7 +1235,7 @@ const showStatement = (): textmate.Grammar => {
const showStatement: textmate.Pattern = { const showStatement: textmate.Pattern = {
name: "meta.expr.show.typst", name: "meta.expr.show.typst",
begin: lookAhead(/(show\b)/), begin: lookAhead(/(show\b)/),
end: /(?=[\s\{\}\[\];])/, end: /(?=[\s;\{\[\}\]\)])/,
patterns: [ patterns: [
/// Matches any comments /// Matches any comments
{ {
@ -1259,7 +1269,7 @@ const showStatement = (): textmate.Grammar => {
const showSelectClause: textmate.Pattern = { const showSelectClause: textmate.Pattern = {
// name: "meta.show.clause.select.typst", // name: "meta.show.clause.select.typst",
begin: /(show\b)\s*/, begin: /(show\b)\s*/,
end: /(?=[:;\]}])/, end: /(?=[:;\}\]])/,
beginCaptures: { beginCaptures: {
"1": { "1": {
name: "keyword.control.other.typst", name: "keyword.control.other.typst",
@ -1282,7 +1292,7 @@ const showStatement = (): textmate.Grammar => {
const showSubstClause: textmate.Pattern = { const showSubstClause: textmate.Pattern = {
// name: "meta.show.clause.subst.typst", // name: "meta.show.clause.subst.typst",
begin: /(\:)\s*/, begin: /(\:)\s*/,
end: /(?<!:)(?<=\S)(?!\S)|(?=[;\]}])/, end: /(?<!:)(?<=\S)(?!\S)|(?=[\n;\}\]\)])/,
beginCaptures: { beginCaptures: {
"1": { "1": {
name: "punctuation.separator.colon.typst", name: "punctuation.separator.colon.typst",
@ -1325,6 +1335,10 @@ const callArgs: textmate.Pattern = {
}, },
}, },
patterns: [ patterns: [
{
match: /\.\./,
name: "keyword.operator.spread.typst",
},
{ {
match: /:/, match: /:/,
name: "punctuation.separator.colon.typst", name: "punctuation.separator.colon.typst",
@ -1339,21 +1353,26 @@ const callArgs: textmate.Pattern = {
], ],
}; };
const patternBindingItems: textmate.Pattern = { const funcRestParam: textmate.Pattern = {
patterns: [
/// rest binding
{
match: /(\.\.)(\b[\p{XID_Start}_][\p{XID_Continue}_-]*)?/, match: /(\.\.)(\b[\p{XID_Start}_][\p{XID_Continue}_-]*)?/,
// debugging // debugging
// - name: meta.parameter.binding.typst // - name: meta.parameter.binding.typst
captures: { captures: {
"1": { "1": {
name: "keyword.operator.range.typst", name: "keyword.operator.spread.typst",
}, },
"2": { "2": {
name: "variable.other.readwrite.typst", name: "variable.other.readwrite.typst",
}, },
}, },
};
const patternBindingItems: textmate.Pattern = {
patterns: [
{ include: "#comments" },
/// rest binding
{
include: "#funcRestParam",
}, },
/// recursive binding /// recursive binding
{ {
@ -1409,7 +1428,7 @@ const funcParams: textmate.Pattern = {
], ],
}; };
const funcCall = (strict: boolean): textmate.Pattern => { const funcCallOrPropAccess = (strict: boolean): textmate.Pattern => {
return { return {
name: "meta.expr.call.typst", name: "meta.expr.call.typst",
begin: lookAhead( begin: lookAhead(
@ -1419,7 +1438,7 @@ const funcCall = (strict: boolean): textmate.Pattern => {
/(\.\s*)?/.source + IDENTIFIER.source + /\s*(?=\(|\[)/.source /(\.\s*)?/.source + IDENTIFIER.source + /\s*(?=\(|\[)/.source
) )
), ),
end: /(?:(?<=\)|\])(?![\[\(\.]))|(?=[\n\}\];]|$)/, end: /(?:(?<=\)|\])(?:(?![\[\(\.])|$))|(?=[\n;\}\]\)]|$)/,
patterns: [ patterns: [
// todo: comments? // todo: comments?
// { // {
@ -1430,7 +1449,10 @@ const funcCall = (strict: boolean): textmate.Pattern => {
name: "keyword.operator.accessor.typst", name: "keyword.operator.accessor.typst",
}, },
{ {
match: IDENTIFIER, match: new RegExp(
IDENTIFIER.source +
(strict ? /(?=\(|\[)/.source : /\s*(?=\(|\[)/.source)
),
name: "entity.name.function.typst", name: "entity.name.function.typst",
patterns: [ patterns: [
{ {
@ -1438,6 +1460,9 @@ const funcCall = (strict: boolean): textmate.Pattern => {
}, },
], ],
}, },
{
include: "#identifier",
},
// empty args // empty args
{ {
// name: "meta.call.args.typst", // name: "meta.call.args.typst",
@ -1461,6 +1486,7 @@ const funcCall = (strict: boolean): textmate.Pattern => {
}; };
}; };
// todo: #x => y should be parsed as |#x|=>|y
// https://github.com/microsoft/vscode-textmate/blob/main/test-cases/themes/syntaxes/TypeScript.tmLanguage.json // https://github.com/microsoft/vscode-textmate/blob/main/test-cases/themes/syntaxes/TypeScript.tmLanguage.json
const arrowFunc: textmate.Pattern = { const arrowFunc: textmate.Pattern = {
name: "meta.expr.arrow-function.typst", name: "meta.expr.arrow-function.typst",
@ -1503,7 +1529,7 @@ const arrowFunc: textmate.Pattern = {
}, },
{ {
begin: /=>/, begin: /=>/,
end: /(?<=\})|(?:(?!\{)(?=\S))/, end: /(?<=\}|\])|(?:(?!\{|\[)(?=[\n\S;]))/,
beginCaptures: { beginCaptures: {
"0": { "0": {
name: "storage.type.function.arrow.typst", name: "storage.type.function.arrow.typst",
@ -1535,6 +1561,7 @@ export const typst: textmate.Grammar = {
identifier, identifier,
markupLabel, markupLabel,
markupReference, markupReference,
markupEscape,
stringLiteral, stringLiteral,
comments, comments,
@ -1560,11 +1587,13 @@ export const typst: textmate.Grammar = {
...ifStatement().repository, ...ifStatement().repository,
...forStatement().repository, ...forStatement().repository,
...whileStatement().repository, ...whileStatement().repository,
contextStatement,
...setStatement().repository, ...setStatement().repository,
...showStatement().repository, ...showStatement().repository,
strictFuncCall: funcCall(true), strictFuncCallOrPropAccess: funcCallOrPropAccess(true),
funcCall: funcCall(false), // funcCallOrPropAccess: funcCallOrPropAccess(false),
callArgs, callArgs,
funcRestParam,
funcParams, funcParams,
patternBindingItems, patternBindingItems,
codeBlock, codeBlock,

View file

@ -34,3 +34,11 @@
#{ #{
("").join() ("").join()
} }
#test([#": "])
#{}
#assert(str(it.fields().label))
#{}
#table(..range(6))

View file

@ -4,7 +4,7 @@
# ^ source.typst meta.expr.let.typst # ^ source.typst meta.expr.let.typst
# ^ source.typst meta.expr.let.typst entity.name.function.typst # ^ source.typst meta.expr.let.typst entity.name.function.typst
# ^ source.typst meta.expr.let.typst meta.brace.round.typst # ^ source.typst meta.expr.let.typst meta.brace.round.typst
# ^^ source.typst meta.expr.let.typst keyword.operator.range.typst # ^^ source.typst meta.expr.let.typst keyword.operator.spread.typst
# ^^^^ source.typst meta.expr.let.typst variable.other.readwrite.typst # ^^^^ source.typst meta.expr.let.typst variable.other.readwrite.typst
# ^ source.typst meta.expr.let.typst meta.brace.round.typst # ^ source.typst meta.expr.let.typst meta.brace.round.typst
# ^ source.typst meta.expr.let.typst # ^ source.typst meta.expr.let.typst
@ -250,3 +250,51 @@
# ^ source.typst meta.expr.call.typst meta.brace.round.typst # ^ source.typst meta.expr.call.typst meta.brace.round.typst
>} >}
#^ source.typst meta.brace.curly.typst #^ source.typst meta.brace.curly.typst
>
>#test([#": "])
#^ source.typst punctuation.definition.hash.typst
# ^^^^ source.typst meta.expr.call.typst entity.name.function.typst
# ^ source.typst meta.expr.call.typst meta.brace.round.typst
# ^ source.typst meta.expr.call.typst meta.brace.square.typst
# ^ source.typst meta.expr.call.typst punctuation.definition.hash.typst
# ^ source.typst meta.expr.call.typst string.quoted.double.typst punctuation.definition.string.typst
# ^^ source.typst meta.expr.call.typst string.quoted.double.typst
# ^ source.typst meta.expr.call.typst string.quoted.double.typst punctuation.definition.string.typst
# ^ source.typst meta.expr.call.typst meta.brace.square.typst
# ^ source.typst meta.expr.call.typst meta.brace.round.typst
>#{}
#^ source.typst punctuation.definition.hash.typst
# ^ source.typst meta.brace.curly.typst
# ^ source.typst meta.brace.curly.typst
>
>#assert(str(it.fields().label))
#^ source.typst punctuation.definition.hash.typst
# ^^^^^^ source.typst meta.expr.call.typst entity.name.function.typst
# ^ source.typst meta.expr.call.typst meta.brace.round.typst
# ^^^ source.typst meta.expr.call.typst meta.expr.call.typst entity.name.function.typst
# ^ source.typst meta.expr.call.typst meta.expr.call.typst meta.brace.round.typst
# ^^ source.typst meta.expr.call.typst meta.expr.call.typst variable.other.readwrite.typst
# ^ source.typst meta.expr.call.typst meta.expr.call.typst meta.expr.call.typst keyword.operator.accessor.typst
# ^^^^^^ source.typst meta.expr.call.typst meta.expr.call.typst meta.expr.call.typst entity.name.function.typst
# ^ source.typst meta.expr.call.typst meta.expr.call.typst meta.expr.call.typst meta.brace.round.typst
# ^ source.typst meta.expr.call.typst meta.expr.call.typst meta.expr.call.typst meta.brace.round.typst
# ^ source.typst meta.expr.call.typst meta.expr.call.typst meta.expr.call.typst keyword.operator.accessor.typst
# ^^^^^ source.typst meta.expr.call.typst meta.expr.call.typst meta.expr.call.typst variable.other.readwrite.typst
# ^ source.typst meta.expr.call.typst meta.expr.call.typst meta.brace.round.typst
# ^ source.typst meta.expr.call.typst meta.brace.round.typst
>#{}
#^ source.typst punctuation.definition.hash.typst
# ^ source.typst meta.brace.curly.typst
# ^ source.typst meta.brace.curly.typst
>
>#table(..range(6))
#^ source.typst punctuation.definition.hash.typst
# ^^^^^ source.typst meta.expr.call.typst entity.name.function.typst
# ^ source.typst meta.expr.call.typst meta.brace.round.typst
# ^^ source.typst meta.expr.call.typst keyword.operator.spread.typst
# ^^^^^ source.typst meta.expr.call.typst meta.expr.call.typst entity.name.function.typst
# ^ source.typst meta.expr.call.typst meta.expr.call.typst meta.brace.round.typst
# ^ source.typst meta.expr.call.typst meta.expr.call.typst constant.numeric.integer.typst
# ^ source.typst meta.expr.call.typst meta.expr.call.typst meta.brace.round.typst
# ^ source.typst meta.expr.call.typst meta.brace.round.typst
>

View file

@ -0,0 +1,6 @@
// Test
// Test: http://www.google.com
/* Test */
/* /* Test */ */
/* // */
// /* */

View file

@ -0,0 +1,26 @@
>// Test
#^^ source.typst comment.line.double-slash.typst punctuation.definition.comment.typst
# ^^^^^ source.typst comment.line.double-slash.typst
>// Test: http://www.google.com
#^^ source.typst comment.line.double-slash.typst punctuation.definition.comment.typst
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.typst comment.line.double-slash.typst
>/* Test */
#^^ source.typst comment.block.typst punctuation.definition.comment.typst
# ^^^^^^ source.typst comment.block.typst
# ^^ source.typst comment.block.typst
>/* /* Test */ */
#^^ source.typst comment.block.typst punctuation.definition.comment.typst
# ^ source.typst comment.block.typst
# ^^ source.typst comment.block.typst comment.block.typst punctuation.definition.comment.typst
# ^^^^^^ source.typst comment.block.typst comment.block.typst
# ^^ source.typst comment.block.typst comment.block.typst
# ^ source.typst comment.block.typst
# ^^ source.typst comment.block.typst
>/* // */
#^^ source.typst comment.block.typst punctuation.definition.comment.typst
# ^^^^ source.typst comment.block.typst
# ^^ source.typst comment.block.typst
>// /* */
#^^ source.typst comment.line.double-slash.typst punctuation.definition.comment.typst
# ^^^^^^ source.typst comment.line.double-slash.typst
>

View file

@ -1,17 +1,27 @@
>#for i >#for i
#^ source.typst punctuation.definition.hash.typst #^ source.typst punctuation.definition.hash.typst
# ^^^ source.typst variable.other.readwrite.typst # ^^^^^^ source.typst meta.expr.for.typst
# ^^^ source.typst
>#for i in >#for i in
#^ source.typst punctuation.definition.hash.typst #^ source.typst meta.expr.for.typst
# ^^^ source.typst variable.other.readwrite.typst # ^^^ source.typst meta.expr.for.typst keyword.control.loop.typst
# ^^^^^^ source.typst # ^ source.typst meta.expr.for.typst
# ^ source.typst meta.expr.for.typst variable.other.readwrite.typst
# ^ source.typst meta.expr.for.typst
# ^^ source.typst meta.expr.for.typst keyword.operator.range.typst
>#for i in range(1) >#for i in range(1)
#^ source.typst punctuation.definition.hash.typst #^ source.typst meta.expr.for.typst
# ^^^ source.typst variable.other.readwrite.typst # ^^^ source.typst meta.expr.for.typst keyword.control.loop.typst
# ^^^^^^^^^^^^^^^ source.typst # ^ source.typst meta.expr.for.typst
# ^ source.typst meta.expr.for.typst variable.other.readwrite.typst
# ^ source.typst meta.expr.for.typst
# ^^ source.typst meta.expr.for.typst keyword.operator.range.typst
# ^ source.typst meta.expr.for.typst
# ^^^^^ source.typst meta.expr.for.typst meta.expr.call.typst entity.name.function.typst
# ^ source.typst meta.expr.for.typst meta.expr.call.typst meta.brace.round.typst
# ^ source.typst meta.expr.for.typst meta.expr.call.typst constant.numeric.integer.typst
# ^ source.typst meta.expr.for.typst meta.expr.call.typst meta.brace.round.typst
>#for i in range(1) [] >#for i in range(1) []
#^ source.typst punctuation.definition.hash.typst #^ source.typst meta.expr.for.typst
# ^^^ source.typst meta.expr.for.typst keyword.control.loop.typst # ^^^ source.typst meta.expr.for.typst keyword.control.loop.typst
# ^ source.typst meta.expr.for.typst # ^ source.typst meta.expr.for.typst
# ^ source.typst meta.expr.for.typst variable.other.readwrite.typst # ^ source.typst meta.expr.for.typst variable.other.readwrite.typst
@ -27,12 +37,26 @@
# ^ source.typst meta.expr.for.typst meta.brace.square.typst # ^ source.typst meta.expr.for.typst meta.brace.square.typst
>#for i in [] >#for i in []
#^ source.typst punctuation.definition.hash.typst #^ source.typst punctuation.definition.hash.typst
# ^^^ source.typst variable.other.readwrite.typst # ^^^ source.typst meta.expr.for.typst keyword.control.loop.typst
# ^^^^^^^^^ source.typst # ^ source.typst meta.expr.for.typst
# ^ source.typst meta.expr.for.typst variable.other.readwrite.typst
# ^ source.typst meta.expr.for.typst
# ^^ source.typst meta.expr.for.typst keyword.operator.range.typst
# ^ source.typst meta.expr.for.typst
# ^ source.typst meta.expr.for.typst meta.brace.square.typst
# ^ source.typst meta.expr.for.typst meta.brace.square.typst
>#for i in []; 1 >#for i in []; 1
#^ source.typst punctuation.definition.hash.typst #^ source.typst punctuation.definition.hash.typst
# ^^^ source.typst variable.other.readwrite.typst # ^^^ source.typst meta.expr.for.typst keyword.control.loop.typst
# ^^^^^^^^^^^^ source.typst # ^ source.typst meta.expr.for.typst
# ^ source.typst meta.expr.for.typst variable.other.readwrite.typst
# ^ source.typst meta.expr.for.typst
# ^^ source.typst meta.expr.for.typst keyword.operator.range.typst
# ^ source.typst meta.expr.for.typst
# ^ source.typst meta.expr.for.typst meta.brace.square.typst
# ^ source.typst meta.expr.for.typst meta.brace.square.typst
# ^ source.typst punctuation.terminator.statement.typst
# ^^^ source.typst
>#for i in range(1) []; 1 >#for i in range(1) []; 1
#^ source.typst punctuation.definition.hash.typst #^ source.typst punctuation.definition.hash.typst
# ^^^ source.typst meta.expr.for.typst keyword.control.loop.typst # ^^^ source.typst meta.expr.for.typst keyword.control.loop.typst
@ -161,6 +185,8 @@
# ^ source.typst meta.expr.for.typst # ^ source.typst meta.expr.for.typst
# ^ source.typst meta.expr.for.typst meta.brace.square.typst # ^ source.typst meta.expr.for.typst meta.brace.square.typst
# ^ source.typst meta.expr.for.typst meta.brace.square.typst # ^ source.typst meta.expr.for.typst meta.brace.square.typst
# ^^^^ source.typst # ^ source.typst meta.expr.for.typst
# ^ source.typst meta.expr.for.typst meta.brace.square.typst
# ^ source.typst meta.expr.for.typst meta.brace.square.typst
>1 >1
#^^ source.typst #^^ source.typst

View file

@ -1,17 +1,27 @@
>#for i >#for i
#^ source.typst punctuation.definition.hash.typst #^ source.typst punctuation.definition.hash.typst
# ^^^ source.typst variable.other.readwrite.typst # ^^^^^^ source.typst meta.expr.for.typst
# ^^^ source.typst
>#for i in >#for i in
#^ source.typst punctuation.definition.hash.typst #^ source.typst meta.expr.for.typst
# ^^^ source.typst variable.other.readwrite.typst # ^^^ source.typst meta.expr.for.typst keyword.control.loop.typst
# ^^^^^^ source.typst # ^ source.typst meta.expr.for.typst
# ^ source.typst meta.expr.for.typst variable.other.readwrite.typst
# ^ source.typst meta.expr.for.typst
# ^^ source.typst meta.expr.for.typst keyword.operator.range.typst
>#for i in range(1) >#for i in range(1)
#^ source.typst punctuation.definition.hash.typst #^ source.typst meta.expr.for.typst
# ^^^ source.typst variable.other.readwrite.typst # ^^^ source.typst meta.expr.for.typst keyword.control.loop.typst
# ^^^^^^^^^^^^^^^ source.typst # ^ source.typst meta.expr.for.typst
# ^ source.typst meta.expr.for.typst variable.other.readwrite.typst
# ^ source.typst meta.expr.for.typst
# ^^ source.typst meta.expr.for.typst keyword.operator.range.typst
# ^ source.typst meta.expr.for.typst
# ^^^^^ source.typst meta.expr.for.typst meta.expr.call.typst entity.name.function.typst
# ^ source.typst meta.expr.for.typst meta.expr.call.typst meta.brace.round.typst
# ^ source.typst meta.expr.for.typst meta.expr.call.typst constant.numeric.integer.typst
# ^ source.typst meta.expr.for.typst meta.expr.call.typst meta.brace.round.typst
>#for i in range(1) {} >#for i in range(1) {}
#^ source.typst punctuation.definition.hash.typst #^ source.typst meta.expr.for.typst
# ^^^ source.typst meta.expr.for.typst keyword.control.loop.typst # ^^^ source.typst meta.expr.for.typst keyword.control.loop.typst
# ^ source.typst meta.expr.for.typst # ^ source.typst meta.expr.for.typst
# ^ source.typst meta.expr.for.typst variable.other.readwrite.typst # ^ source.typst meta.expr.for.typst variable.other.readwrite.typst
@ -27,12 +37,26 @@
# ^ source.typst meta.expr.for.typst meta.brace.curly.typst # ^ source.typst meta.expr.for.typst meta.brace.curly.typst
>#for i in {} >#for i in {}
#^ source.typst punctuation.definition.hash.typst #^ source.typst punctuation.definition.hash.typst
# ^^^ source.typst variable.other.readwrite.typst # ^^^ source.typst meta.expr.for.typst keyword.control.loop.typst
# ^^^^^^^^^ source.typst # ^ source.typst meta.expr.for.typst
# ^ source.typst meta.expr.for.typst variable.other.readwrite.typst
# ^ source.typst meta.expr.for.typst
# ^^ source.typst meta.expr.for.typst keyword.operator.range.typst
# ^ source.typst meta.expr.for.typst
# ^ source.typst meta.expr.for.typst meta.brace.curly.typst
# ^ source.typst meta.expr.for.typst meta.brace.curly.typst
>#for i in {}; 1 >#for i in {}; 1
#^ source.typst punctuation.definition.hash.typst #^ source.typst punctuation.definition.hash.typst
# ^^^ source.typst variable.other.readwrite.typst # ^^^ source.typst meta.expr.for.typst keyword.control.loop.typst
# ^^^^^^^^^^^^ source.typst # ^ source.typst meta.expr.for.typst
# ^ source.typst meta.expr.for.typst variable.other.readwrite.typst
# ^ source.typst meta.expr.for.typst
# ^^ source.typst meta.expr.for.typst keyword.operator.range.typst
# ^ source.typst meta.expr.for.typst
# ^ source.typst meta.expr.for.typst meta.brace.curly.typst
# ^ source.typst meta.expr.for.typst meta.brace.curly.typst
# ^ source.typst punctuation.terminator.statement.typst
# ^^^ source.typst
>#for i in range(1) {}; 1 >#for i in range(1) {}; 1
#^ source.typst punctuation.definition.hash.typst #^ source.typst punctuation.definition.hash.typst
# ^^^ source.typst meta.expr.for.typst keyword.control.loop.typst # ^^^ source.typst meta.expr.for.typst keyword.control.loop.typst
@ -161,6 +185,8 @@
# ^ source.typst meta.expr.for.typst # ^ source.typst meta.expr.for.typst
# ^ source.typst meta.expr.for.typst meta.brace.curly.typst # ^ source.typst meta.expr.for.typst meta.brace.curly.typst
# ^ source.typst meta.expr.for.typst meta.brace.curly.typst # ^ source.typst meta.expr.for.typst meta.brace.curly.typst
# ^^^^ source.typst # ^ source.typst meta.expr.for.typst
# ^ source.typst meta.expr.for.typst meta.brace.curly.typst
# ^ source.typst meta.expr.for.typst meta.brace.curly.typst
>1 >1
#^^ source.typst #^^ source.typst

View file

@ -1,15 +1,28 @@
>#if 1 >#if 1
#^ source.typst punctuation.definition.hash.typst #^ source.typst punctuation.definition.hash.typst
# ^^ source.typst variable.other.readwrite.typst # ^^ source.typst meta.expr.if.typst keyword.control.conditional.typst
# ^^^ source.typst # ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst constant.numeric.integer.typst
>#if [] 1 >#if [] 1
#^ source.typst punctuation.definition.hash.typst #^ source.typst meta.expr.if.typst
# ^^ source.typst variable.other.readwrite.typst # ^^ source.typst meta.expr.if.typst keyword.control.conditional.typst
# ^^^^^^ source.typst # ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.square.typst
# ^ source.typst meta.expr.if.typst meta.brace.square.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst constant.numeric.integer.typst
>#if [] else [] 1 >#if [] else [] 1
#^ source.typst punctuation.definition.hash.typst #^ source.typst meta.expr.if.typst
# ^^ source.typst variable.other.readwrite.typst # ^^ source.typst meta.expr.if.typst keyword.control.conditional.typst
# ^^^^^^^^^^^^^^ source.typst # ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.square.typst
# ^ source.typst meta.expr.if.typst meta.brace.square.typst
# ^ source.typst meta.expr.if.typst
# ^^^^ source.typst meta.expr.if.typst variable.other.readwrite.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.square.typst
# ^ source.typst meta.expr.if.typst meta.brace.square.typst
# ^^^ source.typst
>#if 1 [] else [] 1 >#if 1 [] else [] 1
#^ source.typst punctuation.definition.hash.typst #^ source.typst punctuation.definition.hash.typst
# ^^ source.typst meta.expr.if.typst keyword.control.conditional.typst # ^^ source.typst meta.expr.if.typst keyword.control.conditional.typst
@ -26,14 +39,36 @@
# ^^^ source.typst # ^^^ source.typst
>#if {} [] else [] #1 >#if {} [] else [] #1
#^ source.typst punctuation.definition.hash.typst #^ source.typst punctuation.definition.hash.typst
# ^^ source.typst variable.other.readwrite.typst # ^^ source.typst meta.expr.if.typst keyword.control.conditional.typst
# ^^^^^^^^^^^^^^^ source.typst # ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.square.typst
# ^ source.typst meta.expr.if.typst meta.brace.square.typst
# ^ source.typst meta.expr.if.typst
# ^^^^ source.typst meta.expr.if.typst keyword.control.conditional.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.square.typst
# ^ source.typst meta.expr.if.typst meta.brace.square.typst
# ^ source.typst
# ^ source.typst punctuation.definition.hash.typst # ^ source.typst punctuation.definition.hash.typst
# ^ source.typst constant.numeric.integer.typst # ^ source.typst constant.numeric.integer.typst
>#if [] [] else [] [] >#if [] [] else [] []
#^ source.typst punctuation.definition.hash.typst #^ source.typst punctuation.definition.hash.typst
# ^^ source.typst variable.other.readwrite.typst # ^^ source.typst meta.expr.if.typst keyword.control.conditional.typst
# ^^^^^^^^^^^^^^^^^^ source.typst # ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.square.typst
# ^ source.typst meta.expr.if.typst meta.brace.square.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.square.typst
# ^ source.typst meta.expr.if.typst meta.brace.square.typst
# ^ source.typst meta.expr.if.typst
# ^^^^ source.typst meta.expr.if.typst keyword.control.conditional.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.square.typst
# ^ source.typst meta.expr.if.typst meta.brace.square.typst
# ^^^^ source.typst
>#if () [] else [] # a >#if () [] else [] # a
#^ source.typst punctuation.definition.hash.typst #^ source.typst punctuation.definition.hash.typst
# ^^ source.typst meta.expr.if.typst keyword.control.conditional.typst # ^^ source.typst meta.expr.if.typst keyword.control.conditional.typst

View file

@ -20,3 +20,80 @@
1 1
# if () {} else {} # if () {} else {}
1 1
#if 1 < 2 [
One.
]
#if true == false [
{Bad}, but we {dont-care}!
]
#if {true} [
One.
]
#if [] != none [
Two.
]
#if (
1 + 1
== 1
) [
Nope.
] else {
"Three."
}
#if false [
Bad.
] else {
let point = "."
"Four" + point
}
#{
if content == type[b] [Fi] else [Nope]
if content == type [Nope] else [ve.]
}
#if () () {}
#if () [] {}
#if () {} {}
#if [] () {}
#if [] [] {}
#if [] {} {}
#if {} () {}
#if {} [] {}
#if {} {} {}
#if () == () () {}
#if () == () [] {}
#if () == () {} {}
#if [] == [] () {}
#if [] == [] [] {}
#if [] == [] {} {}
#if {} == {} () {}
#if {} == {} [] {}
#if {} == {} {} {}
#if () and () () {}
#if () and () [] {}
#if () and () {} {}
#if [] and [] () {}
#if [] and [] [] {}
#if [] and [] {} {}
#if {} and {} () {}
#if {} and {} [] {}
#if {} and {} {} {}
#if not () () {}
#if not () [] {}
#if not () {} {}
#if not [] () {}
#if not [] [] {}
#if not [] {} {}
#if not {} () {}
#if not {} [] {}
#if not {} {} {}

View file

@ -1,15 +1,28 @@
>#if 1 >#if 1
#^ source.typst punctuation.definition.hash.typst #^ source.typst punctuation.definition.hash.typst
# ^^ source.typst variable.other.readwrite.typst # ^^ source.typst meta.expr.if.typst keyword.control.conditional.typst
# ^^^ source.typst # ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst constant.numeric.integer.typst
>#if {} 1 >#if {} 1
#^ source.typst punctuation.definition.hash.typst #^ source.typst meta.expr.if.typst
# ^^ source.typst variable.other.readwrite.typst # ^^ source.typst meta.expr.if.typst keyword.control.conditional.typst
# ^^^^^^ source.typst # ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst constant.numeric.integer.typst
>#if {} else {} 1 >#if {} else {} 1
#^ source.typst punctuation.definition.hash.typst #^ source.typst meta.expr.if.typst
# ^^ source.typst variable.other.readwrite.typst # ^^ source.typst meta.expr.if.typst keyword.control.conditional.typst
# ^^^^^^^^^^^^^^ source.typst # ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
# ^ source.typst meta.expr.if.typst
# ^^^^ source.typst meta.expr.if.typst variable.other.readwrite.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
# ^^^ source.typst
>#if 1 {} else {} 1 >#if 1 {} else {} 1
#^ source.typst punctuation.definition.hash.typst #^ source.typst punctuation.definition.hash.typst
# ^^ source.typst meta.expr.if.typst keyword.control.conditional.typst # ^^ source.typst meta.expr.if.typst keyword.control.conditional.typst
@ -26,14 +39,36 @@
# ^^^ source.typst # ^^^ source.typst
>#if [] {} else {} #1 >#if [] {} else {} #1
#^ source.typst punctuation.definition.hash.typst #^ source.typst punctuation.definition.hash.typst
# ^^ source.typst variable.other.readwrite.typst # ^^ source.typst meta.expr.if.typst keyword.control.conditional.typst
# ^^^^^^^^^^^^^^^ source.typst # ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.square.typst
# ^ source.typst meta.expr.if.typst meta.brace.square.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
# ^ source.typst meta.expr.if.typst
# ^^^^ source.typst meta.expr.if.typst keyword.control.conditional.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
# ^ source.typst
# ^ source.typst punctuation.definition.hash.typst # ^ source.typst punctuation.definition.hash.typst
# ^ source.typst constant.numeric.integer.typst # ^ source.typst constant.numeric.integer.typst
>#if {} {} else {} {} >#if {} {} else {} {}
#^ source.typst punctuation.definition.hash.typst #^ source.typst punctuation.definition.hash.typst
# ^^ source.typst variable.other.readwrite.typst # ^^ source.typst meta.expr.if.typst keyword.control.conditional.typst
# ^^^^^^^^^^^^^^^^^^ source.typst # ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
# ^ source.typst meta.expr.if.typst
# ^^^^ source.typst meta.expr.if.typst keyword.control.conditional.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
# ^^^^ source.typst
>#if () {} else {} # a >#if () {} else {} # a
#^ source.typst punctuation.definition.hash.typst #^ source.typst punctuation.definition.hash.typst
# ^^ source.typst meta.expr.if.typst keyword.control.conditional.typst # ^^ source.typst meta.expr.if.typst keyword.control.conditional.typst
@ -128,3 +163,684 @@
>1 >1
#^^ source.typst #^^ source.typst
> >
>#if 1 < 2 [
#^ source.typst punctuation.definition.hash.typst
# ^^ source.typst meta.expr.if.typst keyword.control.conditional.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst constant.numeric.integer.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst keyword.operator.relational.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst constant.numeric.integer.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.square.typst
> One.
#^^^^^^^ source.typst meta.expr.if.typst
>]
#^ source.typst meta.expr.if.typst meta.brace.square.typst
>
>#if true == false [
#^ source.typst punctuation.definition.hash.typst
# ^^ source.typst meta.expr.if.typst keyword.control.conditional.typst
# ^ source.typst meta.expr.if.typst
# ^^^^ source.typst meta.expr.if.typst entity.name.type.primitive.typst
# ^ source.typst meta.expr.if.typst
# ^^ source.typst meta.expr.if.typst keyword.operator.relational.typst
# ^ source.typst meta.expr.if.typst
# ^^^^^ source.typst meta.expr.if.typst entity.name.type.primitive.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.square.typst
> {Bad}, but we {dont-care}!
#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.typst meta.expr.if.typst
>]
#^ source.typst meta.expr.if.typst meta.brace.square.typst
>
>#if {true} [
#^ source.typst punctuation.definition.hash.typst
# ^^ source.typst meta.expr.if.typst keyword.control.conditional.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
# ^^^^ source.typst meta.expr.if.typst entity.name.type.primitive.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.square.typst
> One.
#^^^^^^^ source.typst meta.expr.if.typst
>]
#^ source.typst meta.expr.if.typst meta.brace.square.typst
>
>#if [] != none [
#^ source.typst punctuation.definition.hash.typst
# ^^ source.typst meta.expr.if.typst keyword.control.conditional.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.square.typst
# ^ source.typst meta.expr.if.typst meta.brace.square.typst
# ^ source.typst meta.expr.if.typst
# ^^ source.typst meta.expr.if.typst keyword.operator.relational.typst
# ^ source.typst meta.expr.if.typst
# ^^^^ source.typst meta.expr.if.typst entity.name.type.primitive.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.square.typst
> Two.
#^^^^^^^ source.typst meta.expr.if.typst
>]
#^ source.typst meta.expr.if.typst meta.brace.square.typst
>
>#if (
#^ source.typst punctuation.definition.hash.typst
# ^^ source.typst meta.expr.if.typst keyword.control.conditional.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.round.typst
> 1 + 1
#^^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst constant.numeric.integer.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst keyword.operator.arithmetic.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst constant.numeric.integer.typst
> == 1
#^^^^ source.typst meta.expr.if.typst
# ^^ source.typst meta.expr.if.typst keyword.operator.relational.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst constant.numeric.integer.typst
>) [
#^ source.typst meta.expr.if.typst meta.brace.round.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.square.typst
> Nope.
#^^^^^^^^ source.typst meta.expr.if.typst
>] else {
#^ source.typst meta.expr.if.typst meta.brace.square.typst
# ^ source.typst meta.expr.if.typst
# ^^^^ source.typst meta.expr.if.typst keyword.control.conditional.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
> "Three."
#^^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst string.quoted.double.typst punctuation.definition.string.typst
# ^^^^^^ source.typst meta.expr.if.typst string.quoted.double.typst
# ^ source.typst meta.expr.if.typst string.quoted.double.typst punctuation.definition.string.typst
>}
#^ source.typst meta.expr.if.typst meta.brace.curly.typst
>
>#if false [
#^ source.typst punctuation.definition.hash.typst
# ^^ source.typst meta.expr.if.typst keyword.control.conditional.typst
# ^ source.typst meta.expr.if.typst
# ^^^^^ source.typst meta.expr.if.typst entity.name.type.primitive.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.square.typst
> Bad.
#^^^^^^^ source.typst meta.expr.if.typst
>] else {
#^ source.typst meta.expr.if.typst meta.brace.square.typst
# ^ source.typst meta.expr.if.typst
# ^^^^ source.typst meta.expr.if.typst keyword.control.conditional.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
> let point = "."
#^^ source.typst meta.expr.if.typst
# ^^^ source.typst meta.expr.if.typst meta.expr.let.typst storage.type.typst
# ^ source.typst meta.expr.if.typst meta.expr.let.typst
# ^^^^^ source.typst meta.expr.if.typst meta.expr.let.typst variable.other.readwrite.typst
# ^ source.typst meta.expr.if.typst meta.expr.let.typst
# ^^ source.typst meta.expr.if.typst meta.expr.let.typst keyword.operator.assignment.typst
# ^ source.typst meta.expr.if.typst meta.expr.let.typst string.quoted.double.typst punctuation.definition.string.typst
# ^ source.typst meta.expr.if.typst meta.expr.let.typst string.quoted.double.typst
# ^ source.typst meta.expr.if.typst meta.expr.let.typst string.quoted.double.typst punctuation.definition.string.typst
> "Four" + point
#^^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst string.quoted.double.typst punctuation.definition.string.typst
# ^^^^ source.typst meta.expr.if.typst string.quoted.double.typst
# ^ source.typst meta.expr.if.typst string.quoted.double.typst punctuation.definition.string.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst keyword.operator.arithmetic.typst
# ^ source.typst meta.expr.if.typst
# ^^^^^ source.typst meta.expr.if.typst variable.other.readwrite.typst
>}
#^ source.typst meta.expr.if.typst meta.brace.curly.typst
>
>#{
#^ source.typst punctuation.definition.hash.typst
# ^ source.typst meta.brace.curly.typst
> if content == type[b] [Fi] else [Nope]
#^^ source.typst
# ^^ source.typst meta.expr.if.typst keyword.control.conditional.typst
# ^ source.typst meta.expr.if.typst
# ^^^^^^^ source.typst meta.expr.if.typst entity.name.type.primitive.typst
# ^ source.typst meta.expr.if.typst
# ^^ source.typst meta.expr.if.typst keyword.operator.relational.typst
# ^ source.typst meta.expr.if.typst
# ^^^^ source.typst meta.expr.if.typst meta.expr.call.typst entity.name.function.typst
# ^ source.typst meta.expr.if.typst meta.expr.call.typst meta.brace.square.typst
# ^ source.typst meta.expr.if.typst meta.expr.call.typst
# ^ source.typst meta.expr.if.typst meta.expr.call.typst meta.brace.square.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.square.typst
# ^^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.square.typst
# ^ source.typst meta.expr.if.typst
# ^^^^ source.typst meta.expr.if.typst keyword.control.conditional.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.square.typst
# ^^^^ source.typst meta.expr.if.typst variable.other.readwrite.typst
# ^ source.typst meta.expr.if.typst meta.brace.square.typst
> if content == type [Nope] else [ve.]
#^^ source.typst
# ^^ source.typst meta.expr.if.typst keyword.control.conditional.typst
# ^ source.typst meta.expr.if.typst
# ^^^^^^^ source.typst meta.expr.if.typst entity.name.type.primitive.typst
# ^ source.typst meta.expr.if.typst
# ^^ source.typst meta.expr.if.typst keyword.operator.relational.typst
# ^ source.typst meta.expr.if.typst
# ^^^^ source.typst meta.expr.if.typst variable.other.readwrite.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.square.typst
# ^^^^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.square.typst
# ^ source.typst meta.expr.if.typst
# ^^^^ source.typst meta.expr.if.typst keyword.control.conditional.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.square.typst
# ^^ source.typst meta.expr.if.typst variable.other.readwrite.typst
# ^ source.typst meta.expr.if.typst keyword.operator.accessor.typst
# ^ source.typst meta.expr.if.typst meta.brace.square.typst
>}
#^ source.typst meta.brace.curly.typst
>
>#if () () {}
#^ source.typst punctuation.definition.hash.typst
# ^^ source.typst meta.expr.if.typst keyword.control.conditional.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.round.typst
# ^ source.typst meta.expr.if.typst meta.brace.round.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.round.typst
# ^ source.typst meta.expr.if.typst meta.brace.round.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
>#if () [] {}
#^ source.typst punctuation.definition.hash.typst
# ^^ source.typst meta.expr.if.typst keyword.control.conditional.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.round.typst
# ^ source.typst meta.expr.if.typst meta.brace.round.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.square.typst
# ^ source.typst meta.expr.if.typst meta.brace.square.typst
# ^^^^ source.typst
>#if () {} {}
#^ source.typst punctuation.definition.hash.typst
# ^^ source.typst meta.expr.if.typst keyword.control.conditional.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.round.typst
# ^ source.typst meta.expr.if.typst meta.brace.round.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
# ^^^^ source.typst
>#if [] () {}
#^ source.typst punctuation.definition.hash.typst
# ^^ source.typst meta.expr.if.typst keyword.control.conditional.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.square.typst
# ^ source.typst meta.expr.if.typst meta.brace.square.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.round.typst
# ^ source.typst meta.expr.if.typst meta.brace.round.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
>#if [] [] {}
#^ source.typst punctuation.definition.hash.typst
# ^^ source.typst meta.expr.if.typst keyword.control.conditional.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.square.typst
# ^ source.typst meta.expr.if.typst meta.brace.square.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.square.typst
# ^ source.typst meta.expr.if.typst meta.brace.square.typst
# ^^^^ source.typst
>#if [] {} {}
#^ source.typst punctuation.definition.hash.typst
# ^^ source.typst meta.expr.if.typst keyword.control.conditional.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.square.typst
# ^ source.typst meta.expr.if.typst meta.brace.square.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
# ^^^^ source.typst
>#if {} () {}
#^ source.typst punctuation.definition.hash.typst
# ^^ source.typst meta.expr.if.typst keyword.control.conditional.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.round.typst
# ^ source.typst meta.expr.if.typst meta.brace.round.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
>#if {} [] {}
#^ source.typst punctuation.definition.hash.typst
# ^^ source.typst meta.expr.if.typst keyword.control.conditional.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.square.typst
# ^ source.typst meta.expr.if.typst meta.brace.square.typst
# ^^^^ source.typst
>#if {} {} {}
#^ source.typst punctuation.definition.hash.typst
# ^^ source.typst meta.expr.if.typst keyword.control.conditional.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
# ^^^^ source.typst
>
>#if () == () () {}
#^ source.typst punctuation.definition.hash.typst
# ^^ source.typst meta.expr.if.typst keyword.control.conditional.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.round.typst
# ^ source.typst meta.expr.if.typst meta.brace.round.typst
# ^ source.typst meta.expr.if.typst
# ^^ source.typst meta.expr.if.typst keyword.operator.relational.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.round.typst
# ^ source.typst meta.expr.if.typst meta.brace.round.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.round.typst
# ^ source.typst meta.expr.if.typst meta.brace.round.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
>#if () == () [] {}
#^ source.typst punctuation.definition.hash.typst
# ^^ source.typst meta.expr.if.typst keyword.control.conditional.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.round.typst
# ^ source.typst meta.expr.if.typst meta.brace.round.typst
# ^ source.typst meta.expr.if.typst
# ^^ source.typst meta.expr.if.typst keyword.operator.relational.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.round.typst
# ^ source.typst meta.expr.if.typst meta.brace.round.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.square.typst
# ^ source.typst meta.expr.if.typst meta.brace.square.typst
# ^^^^ source.typst
>#if () == () {} {}
#^ source.typst punctuation.definition.hash.typst
# ^^ source.typst meta.expr.if.typst keyword.control.conditional.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.round.typst
# ^ source.typst meta.expr.if.typst meta.brace.round.typst
# ^ source.typst meta.expr.if.typst
# ^^ source.typst meta.expr.if.typst keyword.operator.relational.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.round.typst
# ^ source.typst meta.expr.if.typst meta.brace.round.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
# ^^^^ source.typst
>#if [] == [] () {}
#^ source.typst punctuation.definition.hash.typst
# ^^ source.typst meta.expr.if.typst keyword.control.conditional.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.square.typst
# ^ source.typst meta.expr.if.typst meta.brace.square.typst
# ^ source.typst meta.expr.if.typst
# ^^ source.typst meta.expr.if.typst keyword.operator.relational.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.square.typst
# ^ source.typst meta.expr.if.typst meta.brace.square.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.round.typst
# ^ source.typst meta.expr.if.typst meta.brace.round.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
>#if [] == [] [] {}
#^ source.typst punctuation.definition.hash.typst
# ^^ source.typst meta.expr.if.typst keyword.control.conditional.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.square.typst
# ^ source.typst meta.expr.if.typst meta.brace.square.typst
# ^ source.typst meta.expr.if.typst
# ^^ source.typst meta.expr.if.typst keyword.operator.relational.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.square.typst
# ^ source.typst meta.expr.if.typst meta.brace.square.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.square.typst
# ^ source.typst meta.expr.if.typst meta.brace.square.typst
# ^^^^ source.typst
>#if [] == [] {} {}
#^ source.typst punctuation.definition.hash.typst
# ^^ source.typst meta.expr.if.typst keyword.control.conditional.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.square.typst
# ^ source.typst meta.expr.if.typst meta.brace.square.typst
# ^ source.typst meta.expr.if.typst
# ^^ source.typst meta.expr.if.typst keyword.operator.relational.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.square.typst
# ^ source.typst meta.expr.if.typst meta.brace.square.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
# ^^^^ source.typst
>#if {} == {} () {}
#^ source.typst punctuation.definition.hash.typst
# ^^ source.typst meta.expr.if.typst keyword.control.conditional.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
# ^ source.typst meta.expr.if.typst
# ^^ source.typst meta.expr.if.typst keyword.operator.relational.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.round.typst
# ^ source.typst meta.expr.if.typst meta.brace.round.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
>#if {} == {} [] {}
#^ source.typst punctuation.definition.hash.typst
# ^^ source.typst meta.expr.if.typst keyword.control.conditional.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
# ^ source.typst meta.expr.if.typst
# ^^ source.typst meta.expr.if.typst keyword.operator.relational.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.square.typst
# ^ source.typst meta.expr.if.typst meta.brace.square.typst
# ^^^^ source.typst
>#if {} == {} {} {}
#^ source.typst punctuation.definition.hash.typst
# ^^ source.typst meta.expr.if.typst keyword.control.conditional.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
# ^ source.typst meta.expr.if.typst
# ^^ source.typst meta.expr.if.typst keyword.operator.relational.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
# ^^^^ source.typst
>
>#if () and () () {}
#^ source.typst punctuation.definition.hash.typst
# ^^ source.typst meta.expr.if.typst keyword.control.conditional.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.round.typst
# ^ source.typst meta.expr.if.typst meta.brace.round.typst
# ^ source.typst meta.expr.if.typst
# ^^^ source.typst meta.expr.if.typst keyword.operator.word.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.round.typst
# ^ source.typst meta.expr.if.typst meta.brace.round.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.round.typst
# ^ source.typst meta.expr.if.typst meta.brace.round.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
>#if () and () [] {}
#^ source.typst punctuation.definition.hash.typst
# ^^ source.typst meta.expr.if.typst keyword.control.conditional.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.round.typst
# ^ source.typst meta.expr.if.typst meta.brace.round.typst
# ^ source.typst meta.expr.if.typst
# ^^^ source.typst meta.expr.if.typst keyword.operator.word.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.round.typst
# ^ source.typst meta.expr.if.typst meta.brace.round.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.square.typst
# ^ source.typst meta.expr.if.typst meta.brace.square.typst
# ^^^^ source.typst
>#if () and () {} {}
#^ source.typst punctuation.definition.hash.typst
# ^^ source.typst meta.expr.if.typst keyword.control.conditional.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.round.typst
# ^ source.typst meta.expr.if.typst meta.brace.round.typst
# ^ source.typst meta.expr.if.typst
# ^^^ source.typst meta.expr.if.typst keyword.operator.word.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.round.typst
# ^ source.typst meta.expr.if.typst meta.brace.round.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
# ^^^^ source.typst
>#if [] and [] () {}
#^ source.typst punctuation.definition.hash.typst
# ^^ source.typst meta.expr.if.typst keyword.control.conditional.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.square.typst
# ^ source.typst meta.expr.if.typst meta.brace.square.typst
# ^ source.typst meta.expr.if.typst
# ^^^ source.typst meta.expr.if.typst keyword.operator.word.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.square.typst
# ^ source.typst meta.expr.if.typst meta.brace.square.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.round.typst
# ^ source.typst meta.expr.if.typst meta.brace.round.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
>#if [] and [] [] {}
#^ source.typst punctuation.definition.hash.typst
# ^^ source.typst meta.expr.if.typst keyword.control.conditional.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.square.typst
# ^ source.typst meta.expr.if.typst meta.brace.square.typst
# ^ source.typst meta.expr.if.typst
# ^^^ source.typst meta.expr.if.typst keyword.operator.word.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.square.typst
# ^ source.typst meta.expr.if.typst meta.brace.square.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.square.typst
# ^ source.typst meta.expr.if.typst meta.brace.square.typst
# ^^^^ source.typst
>#if [] and [] {} {}
#^ source.typst punctuation.definition.hash.typst
# ^^ source.typst meta.expr.if.typst keyword.control.conditional.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.square.typst
# ^ source.typst meta.expr.if.typst meta.brace.square.typst
# ^ source.typst meta.expr.if.typst
# ^^^ source.typst meta.expr.if.typst keyword.operator.word.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.square.typst
# ^ source.typst meta.expr.if.typst meta.brace.square.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
# ^^^^ source.typst
>#if {} and {} () {}
#^ source.typst punctuation.definition.hash.typst
# ^^ source.typst meta.expr.if.typst keyword.control.conditional.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
# ^ source.typst meta.expr.if.typst
# ^^^ source.typst meta.expr.if.typst keyword.operator.word.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.round.typst
# ^ source.typst meta.expr.if.typst meta.brace.round.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
>#if {} and {} [] {}
#^ source.typst punctuation.definition.hash.typst
# ^^ source.typst meta.expr.if.typst keyword.control.conditional.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
# ^ source.typst meta.expr.if.typst
# ^^^ source.typst meta.expr.if.typst keyword.operator.word.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.square.typst
# ^ source.typst meta.expr.if.typst meta.brace.square.typst
# ^^^^ source.typst
>#if {} and {} {} {}
#^ source.typst punctuation.definition.hash.typst
# ^^ source.typst meta.expr.if.typst keyword.control.conditional.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
# ^ source.typst meta.expr.if.typst
# ^^^ source.typst meta.expr.if.typst keyword.operator.word.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
# ^^^^ source.typst
>
>#if not () () {}
#^ source.typst punctuation.definition.hash.typst
# ^^ source.typst meta.expr.if.typst keyword.control.conditional.typst
# ^ source.typst meta.expr.if.typst
# ^^^ source.typst meta.expr.if.typst keyword.operator.word.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.round.typst
# ^ source.typst meta.expr.if.typst meta.brace.round.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.round.typst
# ^ source.typst meta.expr.if.typst meta.brace.round.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
>#if not () [] {}
#^ source.typst punctuation.definition.hash.typst
# ^^ source.typst meta.expr.if.typst keyword.control.conditional.typst
# ^ source.typst meta.expr.if.typst
# ^^^ source.typst meta.expr.if.typst keyword.operator.word.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.round.typst
# ^ source.typst meta.expr.if.typst meta.brace.round.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.square.typst
# ^ source.typst meta.expr.if.typst meta.brace.square.typst
# ^^^^ source.typst
>#if not () {} {}
#^ source.typst punctuation.definition.hash.typst
# ^^ source.typst meta.expr.if.typst keyword.control.conditional.typst
# ^ source.typst meta.expr.if.typst
# ^^^ source.typst meta.expr.if.typst keyword.operator.word.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.round.typst
# ^ source.typst meta.expr.if.typst meta.brace.round.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
# ^^^^ source.typst
>#if not [] () {}
#^ source.typst punctuation.definition.hash.typst
# ^^ source.typst meta.expr.if.typst keyword.control.conditional.typst
# ^ source.typst meta.expr.if.typst
# ^^^ source.typst meta.expr.if.typst keyword.operator.word.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.square.typst
# ^ source.typst meta.expr.if.typst meta.brace.square.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.round.typst
# ^ source.typst meta.expr.if.typst meta.brace.round.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
>#if not [] [] {}
#^ source.typst punctuation.definition.hash.typst
# ^^ source.typst meta.expr.if.typst keyword.control.conditional.typst
# ^ source.typst meta.expr.if.typst
# ^^^ source.typst meta.expr.if.typst keyword.operator.word.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.square.typst
# ^ source.typst meta.expr.if.typst meta.brace.square.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.square.typst
# ^ source.typst meta.expr.if.typst meta.brace.square.typst
# ^^^^ source.typst
>#if not [] {} {}
#^ source.typst punctuation.definition.hash.typst
# ^^ source.typst meta.expr.if.typst keyword.control.conditional.typst
# ^ source.typst meta.expr.if.typst
# ^^^ source.typst meta.expr.if.typst keyword.operator.word.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.square.typst
# ^ source.typst meta.expr.if.typst meta.brace.square.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
# ^^^^ source.typst
>#if not {} () {}
#^ source.typst punctuation.definition.hash.typst
# ^^ source.typst meta.expr.if.typst keyword.control.conditional.typst
# ^ source.typst meta.expr.if.typst
# ^^^ source.typst meta.expr.if.typst keyword.operator.word.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.round.typst
# ^ source.typst meta.expr.if.typst meta.brace.round.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
>#if not {} [] {}
#^ source.typst punctuation.definition.hash.typst
# ^^ source.typst meta.expr.if.typst keyword.control.conditional.typst
# ^ source.typst meta.expr.if.typst
# ^^^ source.typst meta.expr.if.typst keyword.operator.word.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.square.typst
# ^ source.typst meta.expr.if.typst meta.brace.square.typst
# ^^^^ source.typst
>#if not {} {} {}
#^ source.typst punctuation.definition.hash.typst
# ^^ source.typst meta.expr.if.typst keyword.control.conditional.typst
# ^ source.typst meta.expr.if.typst
# ^^^ source.typst meta.expr.if.typst keyword.operator.word.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
# ^ source.typst meta.expr.if.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
# ^ source.typst meta.expr.if.typst meta.brace.curly.typst
# ^^^^ source.typst
>

View file

@ -1,12 +1,13 @@
>#while >#while
#^ source.typst punctuation.definition.hash.typst #^ source.typst punctuation.definition.hash.typst
# ^^^^^ source.typst variable.other.readwrite.typst # ^^^^^ source.typst meta.expr.while.typst keyword.control.loop.typst
>#while i >#while i
#^ source.typst punctuation.definition.hash.typst #^ source.typst meta.expr.while.typst
# ^^^^^ source.typst variable.other.readwrite.typst # ^^^^^ source.typst meta.expr.while.typst keyword.control.loop.typst
# ^^^ source.typst # ^ source.typst meta.expr.while.typst
# ^ source.typst meta.expr.while.typst variable.other.readwrite.typst
>#while i {} >#while i {}
#^ source.typst punctuation.definition.hash.typst #^ source.typst meta.expr.while.typst
# ^^^^^ source.typst meta.expr.while.typst keyword.control.loop.typst # ^^^^^ source.typst meta.expr.while.typst keyword.control.loop.typst
# ^ source.typst meta.expr.while.typst # ^ source.typst meta.expr.while.typst
# ^ source.typst meta.expr.while.typst variable.other.readwrite.typst # ^ source.typst meta.expr.while.typst variable.other.readwrite.typst

View file

@ -220,7 +220,7 @@
# ^ source.typst meta.expr.let.typst variable.other.readwrite.typst # ^ source.typst meta.expr.let.typst variable.other.readwrite.typst
# ^ source.typst meta.expr.let.typst punctuation.separator.comma.typst # ^ source.typst meta.expr.let.typst punctuation.separator.comma.typst
# ^ source.typst meta.expr.let.typst # ^ source.typst meta.expr.let.typst
# ^^ source.typst meta.expr.let.typst keyword.operator.range.typst # ^^ source.typst meta.expr.let.typst keyword.operator.spread.typst
# ^ source.typst meta.expr.let.typst meta.brace.round.typst # ^ source.typst meta.expr.let.typst meta.brace.round.typst
# ^ source.typst meta.expr.let.typst # ^ source.typst meta.expr.let.typst
# ^^ source.typst meta.expr.let.typst keyword.operator.assignment.typst # ^^ source.typst meta.expr.let.typst keyword.operator.assignment.typst
@ -236,7 +236,7 @@
# ^^^ source.typst meta.expr.let.typst storage.type.typst # ^^^ source.typst meta.expr.let.typst storage.type.typst
# ^ source.typst meta.expr.let.typst # ^ source.typst meta.expr.let.typst
# ^ source.typst meta.expr.let.typst meta.brace.round.typst # ^ source.typst meta.expr.let.typst meta.brace.round.typst
# ^^ source.typst meta.expr.let.typst keyword.operator.range.typst # ^^ source.typst meta.expr.let.typst keyword.operator.spread.typst
# ^ source.typst meta.expr.let.typst punctuation.separator.comma.typst # ^ source.typst meta.expr.let.typst punctuation.separator.comma.typst
# ^ source.typst meta.expr.let.typst # ^ source.typst meta.expr.let.typst
# ^ source.typst meta.expr.let.typst variable.other.readwrite.typst # ^ source.typst meta.expr.let.typst variable.other.readwrite.typst
@ -261,7 +261,7 @@
# ^ source.typst meta.expr.let.typst variable.other.readwrite.typst # ^ source.typst meta.expr.let.typst variable.other.readwrite.typst
# ^ source.typst meta.expr.let.typst punctuation.separator.comma.typst # ^ source.typst meta.expr.let.typst punctuation.separator.comma.typst
# ^ source.typst meta.expr.let.typst # ^ source.typst meta.expr.let.typst
# ^^ source.typst meta.expr.let.typst keyword.operator.range.typst # ^^ source.typst meta.expr.let.typst keyword.operator.spread.typst
# ^ source.typst meta.expr.let.typst meta.brace.round.typst # ^ source.typst meta.expr.let.typst meta.brace.round.typst
# ^ source.typst meta.expr.let.typst # ^ source.typst meta.expr.let.typst
# ^^ source.typst meta.expr.let.typst keyword.operator.assignment.typst # ^^ source.typst meta.expr.let.typst keyword.operator.assignment.typst
@ -277,7 +277,7 @@
# ^^^ source.typst meta.expr.let.typst storage.type.typst # ^^^ source.typst meta.expr.let.typst storage.type.typst
# ^ source.typst meta.expr.let.typst # ^ source.typst meta.expr.let.typst
# ^ source.typst meta.expr.let.typst meta.brace.round.typst # ^ source.typst meta.expr.let.typst meta.brace.round.typst
# ^^ source.typst meta.expr.let.typst keyword.operator.range.typst # ^^ source.typst meta.expr.let.typst keyword.operator.spread.typst
# ^ source.typst meta.expr.let.typst punctuation.separator.comma.typst # ^ source.typst meta.expr.let.typst punctuation.separator.comma.typst
# ^ source.typst meta.expr.let.typst # ^ source.typst meta.expr.let.typst
# ^ source.typst meta.expr.let.typst variable.other.readwrite.typst # ^ source.typst meta.expr.let.typst variable.other.readwrite.typst
@ -305,7 +305,7 @@
# ^ source.typst meta.expr.let.typst variable.other.readwrite.typst # ^ source.typst meta.expr.let.typst variable.other.readwrite.typst
# ^ source.typst meta.expr.let.typst punctuation.separator.comma.typst # ^ source.typst meta.expr.let.typst punctuation.separator.comma.typst
# ^ source.typst meta.expr.let.typst # ^ source.typst meta.expr.let.typst
# ^^ source.typst meta.expr.let.typst keyword.operator.range.typst # ^^ source.typst meta.expr.let.typst keyword.operator.spread.typst
# ^ source.typst meta.expr.let.typst punctuation.separator.comma.typst # ^ source.typst meta.expr.let.typst punctuation.separator.comma.typst
# ^ source.typst meta.expr.let.typst # ^ source.typst meta.expr.let.typst
# ^ source.typst meta.expr.let.typst variable.other.readwrite.typst # ^ source.typst meta.expr.let.typst variable.other.readwrite.typst

View file

@ -136,7 +136,7 @@
# ^ source.typst meta.expr.let.typst variable.other.readwrite.typst # ^ source.typst meta.expr.let.typst variable.other.readwrite.typst
# ^ source.typst meta.expr.let.typst punctuation.separator.comma.typst # ^ source.typst meta.expr.let.typst punctuation.separator.comma.typst
# ^ source.typst meta.expr.let.typst # ^ source.typst meta.expr.let.typst
# ^^ source.typst meta.expr.let.typst keyword.operator.range.typst # ^^ source.typst meta.expr.let.typst keyword.operator.spread.typst
# ^ source.typst meta.expr.let.typst meta.brace.round.typst # ^ source.typst meta.expr.let.typst meta.brace.round.typst
# ^ source.typst meta.expr.let.typst meta.brace.round.typst # ^ source.typst meta.expr.let.typst meta.brace.round.typst
# ^ source.typst meta.expr.let.typst # ^ source.typst meta.expr.let.typst
@ -150,7 +150,7 @@
# ^ source.typst meta.expr.let.typst entity.name.function.typst # ^ source.typst meta.expr.let.typst entity.name.function.typst
# ^ source.typst meta.expr.let.typst meta.brace.round.typst # ^ source.typst meta.expr.let.typst meta.brace.round.typst
# ^ source.typst meta.expr.let.typst meta.brace.round.typst # ^ source.typst meta.expr.let.typst meta.brace.round.typst
# ^^ source.typst meta.expr.let.typst keyword.operator.range.typst # ^^ source.typst meta.expr.let.typst keyword.operator.spread.typst
# ^ source.typst meta.expr.let.typst punctuation.separator.comma.typst # ^ source.typst meta.expr.let.typst punctuation.separator.comma.typst
# ^ source.typst meta.expr.let.typst # ^ source.typst meta.expr.let.typst
# ^ source.typst meta.expr.let.typst variable.other.readwrite.typst # ^ source.typst meta.expr.let.typst variable.other.readwrite.typst

View file

@ -22,8 +22,8 @@
# ^^^ source.typst meta.expr.set.typst meta.expr.call.typst support.type.builtin.typst # ^^^ source.typst meta.expr.set.typst meta.expr.call.typst support.type.builtin.typst
# ^ source.typst meta.expr.set.typst meta.expr.call.typst meta.brace.round.typst # ^ source.typst meta.expr.set.typst meta.expr.call.typst meta.brace.round.typst
>#set text("") >#set text("")
#^ source.typst meta.expr.set.typst #^ source.typst punctuation.definition.hash.typst
# ^^^ source.typst meta.expr.set.typst variable.other.readwrite.typst # ^^^ source.typst meta.expr.set.typst keyword.control.other.typst
# ^ source.typst meta.expr.set.typst # ^ source.typst meta.expr.set.typst
# ^^^^ source.typst meta.expr.set.typst meta.expr.call.typst entity.name.function.typst # ^^^^ source.typst meta.expr.set.typst meta.expr.call.typst entity.name.function.typst
# ^ source.typst meta.expr.set.typst meta.expr.call.typst meta.brace.round.typst # ^ source.typst meta.expr.set.typst meta.expr.call.typst meta.brace.round.typst
@ -31,16 +31,16 @@
# ^ source.typst meta.expr.set.typst meta.expr.call.typst string.quoted.double.typst punctuation.definition.string.typst # ^ source.typst meta.expr.set.typst meta.expr.call.typst string.quoted.double.typst punctuation.definition.string.typst
# ^ source.typst meta.expr.set.typst meta.expr.call.typst meta.brace.round.typst # ^ source.typst meta.expr.set.typst meta.expr.call.typst meta.brace.round.typst
>#set text(red) >#set text(red)
#^ source.typst meta.expr.set.typst #^ source.typst punctuation.definition.hash.typst
# ^^^ source.typst meta.expr.set.typst variable.other.readwrite.typst # ^^^ source.typst meta.expr.set.typst keyword.control.other.typst
# ^ source.typst meta.expr.set.typst # ^ source.typst meta.expr.set.typst
# ^^^^ source.typst meta.expr.set.typst meta.expr.call.typst entity.name.function.typst # ^^^^ source.typst meta.expr.set.typst meta.expr.call.typst entity.name.function.typst
# ^ source.typst meta.expr.set.typst meta.expr.call.typst meta.brace.round.typst # ^ source.typst meta.expr.set.typst meta.expr.call.typst meta.brace.round.typst
# ^^^ source.typst meta.expr.set.typst meta.expr.call.typst support.type.builtin.typst # ^^^ source.typst meta.expr.set.typst meta.expr.call.typst support.type.builtin.typst
# ^ source.typst meta.expr.set.typst meta.expr.call.typst meta.brace.round.typst # ^ source.typst meta.expr.set.typst meta.expr.call.typst meta.brace.round.typst
>#set list.item(red); >#set list.item(red);
#^ source.typst meta.expr.set.typst #^ source.typst punctuation.definition.hash.typst
# ^^^ source.typst meta.expr.set.typst variable.other.readwrite.typst # ^^^ source.typst meta.expr.set.typst keyword.control.other.typst
# ^ source.typst meta.expr.set.typst # ^ source.typst meta.expr.set.typst
# ^^^^ source.typst meta.expr.set.typst variable.other.readwrite.typst # ^^^^ source.typst meta.expr.set.typst variable.other.readwrite.typst
# ^ source.typst meta.expr.set.typst meta.expr.call.typst keyword.operator.accessor.typst # ^ source.typst meta.expr.set.typst meta.expr.call.typst keyword.operator.accessor.typst

View file

@ -0,0 +1 @@
#x => y

View file

@ -0,0 +1,7 @@
>#x => y
#^ source.typst punctuation.definition.hash.typst
# ^ source.typst variable.parameter.typst
# ^ source.typst
# ^^ source.typst storage.type.function.arrow.typst
# ^ source.typst
# ^ source.typst variable.other.readwrite.typst

View file

@ -0,0 +1 @@
#figure(caption: [test])[].caption

View file

@ -0,0 +1,15 @@
>#figure(caption: [test])[].caption
#^ source.typst punctuation.definition.hash.typst
# ^^^^^^ source.typst meta.expr.call.typst entity.name.function.typst
# ^ source.typst meta.expr.call.typst meta.brace.round.typst
# ^^^^^^^ source.typst meta.expr.call.typst variable.other.readwrite.typst
# ^ source.typst meta.expr.call.typst punctuation.separator.colon.typst
# ^ source.typst meta.expr.call.typst
# ^ source.typst meta.expr.call.typst meta.brace.square.typst
# ^^^^ source.typst meta.expr.call.typst
# ^ source.typst meta.expr.call.typst meta.brace.square.typst
# ^ source.typst meta.expr.call.typst meta.brace.round.typst
# ^ source.typst meta.expr.call.typst meta.brace.square.typst
# ^ source.typst meta.expr.call.typst meta.brace.square.typst
# ^ source.typst meta.expr.call.typst keyword.operator.accessor.typst
# ^^^^^^^ source.typst meta.expr.call.typst variable.other.readwrite.typst

View file

@ -0,0 +1 @@
#for x in [1, 2] {}

View file

@ -0,0 +1,14 @@
>#for x in [1, 2] {}
#^ source.typst punctuation.definition.hash.typst
# ^^^ source.typst meta.expr.for.typst keyword.control.loop.typst
# ^ source.typst meta.expr.for.typst
# ^ source.typst meta.expr.for.typst variable.other.readwrite.typst
# ^ source.typst meta.expr.for.typst
# ^^ source.typst meta.expr.for.typst keyword.operator.range.typst
# ^ source.typst meta.expr.for.typst
# ^ source.typst meta.expr.for.typst meta.brace.square.typst
# ^^^^ source.typst meta.expr.for.typst
# ^ source.typst meta.expr.for.typst meta.brace.square.typst
# ^ source.typst meta.expr.for.typst
# ^ source.typst meta.expr.for.typst meta.brace.curly.typst
# ^ source.typst meta.expr.for.typst meta.brace.curly.typst

View file

@ -0,0 +1,4 @@
#{func(}
#[func(]
#func("]
#{}

View file

@ -0,0 +1,20 @@
>#{func(}
#^ source.typst punctuation.definition.hash.typst
# ^ source.typst meta.brace.curly.typst
# ^^^^ source.typst meta.expr.call.typst entity.name.function.typst
# ^ source.typst meta.expr.call.typst meta.brace.round.typst
# ^^ source.typst meta.expr.call.typst
>#[func(]
#^ source.typst meta.expr.call.typst
# ^ source.typst meta.expr.call.typst meta.brace.square.typst
# ^^^^^ source.typst meta.expr.call.typst
# ^ source.typst meta.expr.call.typst meta.brace.square.typst
>#func("]
#^ source.typst meta.expr.call.typst
# ^^^^ source.typst meta.expr.call.typst meta.expr.call.typst entity.name.function.typst
# ^ source.typst meta.expr.call.typst meta.expr.call.typst meta.brace.round.typst
# ^ source.typst meta.expr.call.typst meta.expr.call.typst string.quoted.double.typst punctuation.definition.string.typst
# ^^ source.typst meta.expr.call.typst meta.expr.call.typst string.quoted.double.typst
>#{}
#^^^^ source.typst meta.expr.call.typst meta.expr.call.typst string.quoted.double.typst
>

View file

@ -0,0 +1,4 @@
#((show: body => 2) * body)
---

View file

@ -0,0 +1,20 @@
>
>#((show: body => 2) * body)
#^ source.typst punctuation.definition.hash.typst
# ^ source.typst meta.brace.round.typst
# ^ source.typst meta.brace.round.typst
# ^^^^ source.typst meta.expr.show.typst keyword.control.other.typst
# ^ source.typst meta.expr.show.typst punctuation.separator.colon.typst
# ^ source.typst meta.expr.show.typst
# ^^^^ source.typst meta.expr.show.typst variable.parameter.typst
# ^ source.typst meta.expr.show.typst
# ^^ source.typst meta.expr.show.typst storage.type.function.arrow.typst
# ^ source.typst meta.expr.show.typst
# ^ source.typst meta.expr.show.typst constant.numeric.integer.typst
# ^ source.typst meta.brace.round.typst
# ^^^ source.typst
# ^^^^ source.typst variable.other.readwrite.typst
# ^ source.typst meta.brace.round.typst
>
>---
#^^^ source.typst punctuation.definition.em-dash.typst

View file

@ -1,2 +1,7 @@
[\]] [\]]
\#1pt \#1pt
a \
a \ b \
#let x = 1; \
#x \
#x

View file

@ -5,3 +5,30 @@
>\#1pt >\#1pt
#^^ source.typst constant.character.escape.content.typst #^^ source.typst constant.character.escape.content.typst
# ^^^^ source.typst # ^^^^ source.typst
>a \
#^^ source.typst
# ^^ source.typst constant.character.escape.content.typst
>a \ b \
#^^ source.typst
# ^^ source.typst constant.character.escape.content.typst
# ^^ source.typst
# ^^ source.typst constant.character.escape.content.typst
>#let x = 1; \
#^ source.typst punctuation.definition.hash.typst
# ^^^ source.typst meta.expr.let.typst storage.type.typst
# ^ source.typst meta.expr.let.typst
# ^ source.typst meta.expr.let.typst variable.other.readwrite.typst
# ^ source.typst meta.expr.let.typst
# ^^ source.typst meta.expr.let.typst keyword.operator.assignment.typst
# ^ source.typst meta.expr.let.typst constant.numeric.integer.typst
# ^ source.typst punctuation.terminator.statement.typst
# ^ source.typst
# ^^ source.typst constant.character.escape.content.typst
>#x \
#^ source.typst punctuation.definition.hash.typst
# ^ source.typst variable.other.readwrite.typst
# ^ source.typst
# ^^ source.typst constant.character.escape.content.typst
>#x
#^ source.typst punctuation.definition.hash.typst
# ^ source.typst variable.other.readwrite.typst

View file

@ -0,0 +1,2 @@
$\$$
$ a #[$b$] $

View file

@ -0,0 +1,15 @@
>$\$$
#^ source.typst markup.math.typst punctuation.definition.string.math.typst
# ^^ source.typst markup.math.typst constant.character.escape.content.typst
# ^ source.typst markup.math.typst punctuation.definition.string.math.typst
>$ a #[$b$] $
#^ source.typst markup.math.typst punctuation.definition.string.math.typst
# ^^^ source.typst markup.math.typst
# ^ source.typst markup.math.typst punctuation.definition.hash.typst
# ^ source.typst markup.math.typst meta.brace.square.typst
# ^ source.typst markup.math.typst markup.math.typst punctuation.definition.string.math.typst
# ^ source.typst markup.math.typst markup.math.typst
# ^ source.typst markup.math.typst markup.math.typst punctuation.definition.string.math.typst
# ^ source.typst markup.math.typst meta.brace.square.typst
# ^ source.typst markup.math.typst
# ^ source.typst markup.math.typst punctuation.definition.string.math.typst