mirror of
https://github.com/Myriad-Dreamin/tinymist.git
synced 2025-08-02 09:22:17 +00:00
feat: init syntax library for function hover tip (#77)
* dev: introduce upstream tooltip * feat: basic function definition * feat: init syntax library * abandon * build: run syntax building * fix: let expression * fix: markup in code * fix: raw code
This commit is contained in:
parent
14fc4819f1
commit
a3948df5da
46 changed files with 3068 additions and 5 deletions
|
@ -61,8 +61,8 @@ fn def_tooltip(ctx: &mut AnalysisContext, source: &Source, cursor: usize) -> Opt
|
||||||
crate::syntax::LexicalKind::Var(LexicalVarKind::Function) => {
|
crate::syntax::LexicalKind::Var(LexicalVarKind::Function) => {
|
||||||
let f = lnk.value.as_ref();
|
let f = lnk.value.as_ref();
|
||||||
Some(Tooltip::Text(eco_format!(
|
Some(Tooltip::Text(eco_format!(
|
||||||
r#"```typc
|
r#"```typst-grammar
|
||||||
let {}({});
|
#let {}({});
|
||||||
```{}"#,
|
```{}"#,
|
||||||
lnk.name,
|
lnk.name,
|
||||||
ParamTooltip(f),
|
ParamTooltip(f),
|
||||||
|
@ -80,8 +80,8 @@ let {}({});
|
||||||
|
|
||||||
Some(Tooltip::Text(eco_format!(
|
Some(Tooltip::Text(eco_format!(
|
||||||
r#"
|
r#"
|
||||||
```typc
|
```typst-grammar
|
||||||
let {};
|
#let {};
|
||||||
```{v}"#,
|
```{v}"#,
|
||||||
lnk.name
|
lnk.name
|
||||||
)))
|
)))
|
||||||
|
|
|
@ -157,6 +157,24 @@
|
||||||
"light": "./icons/typst-small.png",
|
"light": "./icons/typst-small.png",
|
||||||
"dark": "./icons/typst-small.png"
|
"dark": "./icons/typst-small.png"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "typst-grammar",
|
||||||
|
"aliases": [
|
||||||
|
"Typst with Syntax Support"
|
||||||
|
],
|
||||||
|
"configuration": "./language-configuration.json",
|
||||||
|
"icon": {
|
||||||
|
"light": "./icons/typst-small.png",
|
||||||
|
"dark": "./icons/typst-small.png"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"grammars": [
|
||||||
|
{
|
||||||
|
"language": "typst-grammar",
|
||||||
|
"scopeName": "source.typst-grammar",
|
||||||
|
"path": "./out/typst.tmLanguage.json"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"semanticTokenTypes": [
|
"semanticTokenTypes": [
|
||||||
|
@ -369,10 +387,11 @@
|
||||||
],
|
],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build:frontend": "cd ../../tools/editor-tools/ && yarn run build",
|
"build:frontend": "cd ../../tools/editor-tools/ && yarn run build",
|
||||||
|
"build:syntax": "cd ../../syntaxes/textmate && yarn run compile && yarn run bundle",
|
||||||
"build-base": "esbuild ./src/extension.ts --bundle --outfile=out/extension.js --external:vscode --format=cjs --platform=node --target=node16",
|
"build-base": "esbuild ./src/extension.ts --bundle --outfile=out/extension.js --external:vscode --format=cjs --platform=node --target=node16",
|
||||||
"vscode:prepublish": "yarn run build-base -- --minify && yarn run build:frontend && node scripts/postinstall.cjs",
|
"vscode:prepublish": "yarn run build-base -- --minify && yarn run build:frontend && node scripts/postinstall.cjs",
|
||||||
"package": "vsce package --yarn",
|
"package": "vsce package --yarn",
|
||||||
"compile": "yarn run build-base -- --sourcemap && yarn run build:frontend && node scripts/postinstall.cjs",
|
"compile": "yarn run build-base -- --sourcemap && yarn run build:syntax && yarn run build:frontend && node scripts/postinstall.cjs",
|
||||||
"watch": "yarn run build-base -- --sourcemap --watch",
|
"watch": "yarn run build-base -- --sourcemap --watch",
|
||||||
"check": "tsc --noEmit",
|
"check": "tsc --noEmit",
|
||||||
"lint": "eslint ./src --ext .ts",
|
"lint": "eslint ./src --ext .ts",
|
||||||
|
|
1
syntaxes/textmate/.gitignore
vendored
Normal file
1
syntaxes/textmate/.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
*.tmLanguage.json
|
32
syntaxes/textmate/package.json
Normal file
32
syntaxes/textmate/package.json
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
{
|
||||||
|
"name": "typst-textmate",
|
||||||
|
"version": "0.11.0",
|
||||||
|
"private": true,
|
||||||
|
"scripts": {
|
||||||
|
"compile": "js-yaml typst.tmLanguage.yaml > typst.tmLanguage.json",
|
||||||
|
"bundle": "node scripts/install.cjs",
|
||||||
|
"test": "yarn compile && npx vscode-tmgrammar-snap --updateSnapshot tests/unit/**/*.typ"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"js-yaml": "^4.1.0",
|
||||||
|
"vscode-tmgrammar-test": "^0.1.3"
|
||||||
|
},
|
||||||
|
"contributes": {
|
||||||
|
"languages": [
|
||||||
|
{
|
||||||
|
"id": "typst",
|
||||||
|
"extensions": [
|
||||||
|
".typ",
|
||||||
|
".typc"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"grammars": [
|
||||||
|
{
|
||||||
|
"language": "typst",
|
||||||
|
"scopeName": "source.typst",
|
||||||
|
"path": "./typst.tmLanguage.json"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
25
syntaxes/textmate/scripts/install.cjs
Normal file
25
syntaxes/textmate/scripts/install.cjs
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
// read typst.tmLanguage.json
|
||||||
|
|
||||||
|
const fs = require("fs");
|
||||||
|
const path = require("path");
|
||||||
|
|
||||||
|
const filePath = path.join(__dirname, "../typst.tmLanguage.json");
|
||||||
|
|
||||||
|
const data = fs.readFileSync(filePath, "utf8");
|
||||||
|
|
||||||
|
const json = JSON.parse(data);
|
||||||
|
|
||||||
|
json.scopeName = "source.typst-grammar";
|
||||||
|
json.name = "typst-grammar";
|
||||||
|
// todo: make it back when we finished
|
||||||
|
// json.repository.fenced_code_block_typst.patterns = [
|
||||||
|
// { include: "source.typst-grammar" }
|
||||||
|
// ];
|
||||||
|
delete json.repository.fenced_code_block_typst.patterns;
|
||||||
|
|
||||||
|
const outPath = path.join(
|
||||||
|
__dirname,
|
||||||
|
"../../../editors/vscode/out/typst.tmLanguage.json"
|
||||||
|
);
|
||||||
|
|
||||||
|
fs.writeFileSync(outPath, JSON.stringify(json, null, 4), "utf8");
|
6
syntaxes/textmate/tests/unit/basic/array.typ
Normal file
6
syntaxes/textmate/tests/unit/basic/array.typ
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
#(0)
|
||||||
|
#let f(name) = (
|
||||||
|
(
|
||||||
|
pad(align(center + horizon, name)),
|
||||||
|
),
|
||||||
|
)
|
44
syntaxes/textmate/tests/unit/basic/array.typ.snap
Normal file
44
syntaxes/textmate/tests/unit/basic/array.typ.snap
Normal file
|
@ -0,0 +1,44 @@
|
||||||
|
>#(0)
|
||||||
|
#^ source.typst punctuation.definition.hash.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^ source.typst constant.numeric.integer.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
>#let f(name) = (
|
||||||
|
#^ 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 entity.name.function.typst
|
||||||
|
# ^ source.typst meta.expr.let.typst meta.brace.round.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
|
||||||
|
# ^ source.typst keyword.operator.assignment.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
> (
|
||||||
|
#^^ source.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
> pad(align(center + horizon, name)),
|
||||||
|
#^^^^ source.typst
|
||||||
|
# ^^^ source.typst entity.name.function.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^^^^^ source.typst entity.name.function.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^^^^^^ source.typst variable.other.readwrite.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst keyword.operator.arithmetic.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^^^^^^^ source.typst variable.other.readwrite.typst
|
||||||
|
# ^ source.typst punctuation.separator.comma.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^^^^ source.typst variable.other.readwrite.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^ source.typst punctuation.separator.comma.typst
|
||||||
|
# ^^ source.typst
|
||||||
|
> ),
|
||||||
|
#^^ source.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^ source.typst punctuation.separator.comma.typst
|
||||||
|
>)
|
||||||
|
#^ source.typst meta.brace.round.typst
|
3
syntaxes/textmate/tests/unit/basic/block.typ
Normal file
3
syntaxes/textmate/tests/unit/basic/block.typ
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
#{
|
||||||
|
|
||||||
|
}
|
6
syntaxes/textmate/tests/unit/basic/block.typ.snap
Normal file
6
syntaxes/textmate/tests/unit/basic/block.typ.snap
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
>#{
|
||||||
|
#^ source.typst punctuation.definition.hash.typst
|
||||||
|
# ^ source.typst meta.brace.curly.typst
|
||||||
|
>
|
||||||
|
>}
|
||||||
|
#^ source.typst meta.brace.curly.typst
|
4
syntaxes/textmate/tests/unit/basic/call.typ
Normal file
4
syntaxes/textmate/tests/unit/basic/call.typ
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
#text
|
||||||
|
#我们
|
||||||
|
#text("//")
|
||||||
|
#calc.rem(1, 1)
|
26
syntaxes/textmate/tests/unit/basic/call.typ.snap
Normal file
26
syntaxes/textmate/tests/unit/basic/call.typ.snap
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
>#text
|
||||||
|
#^ source.typst punctuation.definition.hash.typst
|
||||||
|
# ^^^^ source.typst variable.other.readwrite.typst
|
||||||
|
>#我们
|
||||||
|
#^ source.typst punctuation.definition.hash.typst
|
||||||
|
# ^^ source.typst variable.other.readwrite.typst
|
||||||
|
>#text("//")
|
||||||
|
#^ source.typst punctuation.definition.hash.typst
|
||||||
|
# ^^^^ source.typst entity.name.function.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^ source.typst string.quoted.double.typst punctuation.definition.string.typst
|
||||||
|
# ^^ source.typst string.quoted.double.typst
|
||||||
|
# ^ source.typst string.quoted.double.typst punctuation.definition.string.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
>#calc.rem(1, 1)
|
||||||
|
#^ source.typst punctuation.definition.hash.typst
|
||||||
|
# ^^^^ source.typst variable.other.readwrite.typst
|
||||||
|
# ^ source.typst keyword.operator.accessor.typst
|
||||||
|
# ^^^ source.typst entity.name.function.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^ source.typst constant.numeric.integer.typst
|
||||||
|
# ^ source.typst punctuation.separator.comma.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst constant.numeric.integer.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
>
|
15
syntaxes/textmate/tests/unit/basic/control-flow-for.typ
Normal file
15
syntaxes/textmate/tests/unit/basic/control-flow-for.typ
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
#for i
|
||||||
|
#for i in
|
||||||
|
#for i in range(1)
|
||||||
|
#for i in range(1) {}
|
||||||
|
#for i in {}
|
||||||
|
#for i in {}; 1
|
||||||
|
#for i in range(1) {}; 1
|
||||||
|
#for i in range(1) {}1
|
||||||
|
#for i in range(1) {}a
|
||||||
|
#for i in range(1) {} 1
|
||||||
|
#for i in range(1) {} a
|
||||||
|
#for i in range(1) {}
|
||||||
|
#for i in range(1) {}; {}
|
||||||
|
#for i in range(1) {} {}
|
||||||
|
1
|
193
syntaxes/textmate/tests/unit/basic/control-flow-for.typ.snap
Normal file
193
syntaxes/textmate/tests/unit/basic/control-flow-for.typ.snap
Normal file
|
@ -0,0 +1,193 @@
|
||||||
|
>#for i
|
||||||
|
#^ source.typst punctuation.definition.hash.typst
|
||||||
|
# ^^^ source.typst keyword.control.loop.typst
|
||||||
|
# ^^ source.typst
|
||||||
|
>#for i in
|
||||||
|
#^ source.typst punctuation.definition.hash.typst
|
||||||
|
# ^^^ source.typst keyword.control.loop.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst variable.other.readwrite.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^^ source.typst keyword.other.typst
|
||||||
|
>#for i in range(1)
|
||||||
|
#^ source.typst
|
||||||
|
# ^^^ source.typst keyword.control.loop.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst variable.other.readwrite.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^^ source.typst keyword.other.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^^^^^ source.typst entity.name.function.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^ source.typst constant.numeric.integer.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
>#for i in range(1) {}
|
||||||
|
#^ source.typst
|
||||||
|
# ^^^ source.typst keyword.control.loop.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst variable.other.readwrite.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^^ source.typst keyword.other.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^^^^^ source.typst entity.name.function.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^ source.typst constant.numeric.integer.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst meta.brace.curly.typst
|
||||||
|
# ^ source.typst meta.brace.curly.typst
|
||||||
|
>#for i in {}
|
||||||
|
#^ source.typst
|
||||||
|
# ^^^ source.typst keyword.control.loop.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst variable.other.readwrite.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^^ source.typst keyword.other.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst meta.brace.curly.typst
|
||||||
|
# ^ source.typst meta.brace.curly.typst
|
||||||
|
>#for i in {}; 1
|
||||||
|
#^ source.typst
|
||||||
|
# ^^^ source.typst keyword.control.loop.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst variable.other.readwrite.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^^ source.typst keyword.other.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst meta.brace.curly.typst
|
||||||
|
# ^ source.typst meta.brace.curly.typst
|
||||||
|
# ^ source.typst punctuation.terminator.statement.typst
|
||||||
|
# ^^^ source.typst
|
||||||
|
>#for i in range(1) {}; 1
|
||||||
|
#^ source.typst punctuation.definition.hash.typst
|
||||||
|
# ^^^ source.typst keyword.control.loop.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst variable.other.readwrite.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^^ source.typst keyword.other.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^^^^^ source.typst entity.name.function.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^ source.typst constant.numeric.integer.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst meta.brace.curly.typst
|
||||||
|
# ^ source.typst meta.brace.curly.typst
|
||||||
|
# ^ source.typst punctuation.terminator.statement.typst
|
||||||
|
# ^^^ source.typst
|
||||||
|
>#for i in range(1) {}1
|
||||||
|
#^ source.typst punctuation.definition.hash.typst
|
||||||
|
# ^^^ source.typst keyword.control.loop.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst variable.other.readwrite.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^^ source.typst keyword.other.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^^^^^ source.typst entity.name.function.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^ source.typst constant.numeric.integer.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst meta.brace.curly.typst
|
||||||
|
# ^ source.typst meta.brace.curly.typst
|
||||||
|
# ^ source.typst
|
||||||
|
>#for i in range(1) {}a
|
||||||
|
#^ source.typst punctuation.definition.hash.typst
|
||||||
|
# ^^^ source.typst keyword.control.loop.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst variable.other.readwrite.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^^ source.typst keyword.other.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^^^^^ source.typst entity.name.function.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^ source.typst constant.numeric.integer.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst meta.brace.curly.typst
|
||||||
|
# ^ source.typst meta.brace.curly.typst
|
||||||
|
# ^ source.typst
|
||||||
|
>#for i in range(1) {} 1
|
||||||
|
#^ source.typst punctuation.definition.hash.typst
|
||||||
|
# ^^^ source.typst keyword.control.loop.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst variable.other.readwrite.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^^ source.typst keyword.other.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^^^^^ source.typst entity.name.function.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^ source.typst constant.numeric.integer.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst meta.brace.curly.typst
|
||||||
|
# ^ source.typst meta.brace.curly.typst
|
||||||
|
# ^^ source.typst
|
||||||
|
>#for i in range(1) {} a
|
||||||
|
#^ source.typst punctuation.definition.hash.typst
|
||||||
|
# ^^^ source.typst keyword.control.loop.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst variable.other.readwrite.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^^ source.typst keyword.other.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^^^^^ source.typst entity.name.function.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^ source.typst constant.numeric.integer.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst meta.brace.curly.typst
|
||||||
|
# ^ source.typst meta.brace.curly.typst
|
||||||
|
# ^^ source.typst
|
||||||
|
>#for i in range(1) {}
|
||||||
|
#^ source.typst punctuation.definition.hash.typst
|
||||||
|
# ^^^ source.typst keyword.control.loop.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst variable.other.readwrite.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^^ source.typst keyword.other.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^^^^^ source.typst entity.name.function.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^ source.typst constant.numeric.integer.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst meta.brace.curly.typst
|
||||||
|
# ^ source.typst meta.brace.curly.typst
|
||||||
|
>#for i in range(1) {}; {}
|
||||||
|
#^ source.typst punctuation.definition.hash.typst
|
||||||
|
# ^^^ source.typst keyword.control.loop.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst variable.other.readwrite.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^^ source.typst keyword.other.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^^^^^ source.typst entity.name.function.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^ source.typst constant.numeric.integer.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst meta.brace.curly.typst
|
||||||
|
# ^ source.typst meta.brace.curly.typst
|
||||||
|
# ^ source.typst punctuation.terminator.statement.typst
|
||||||
|
# ^^^^ source.typst
|
||||||
|
>#for i in range(1) {} {}
|
||||||
|
#^ source.typst punctuation.definition.hash.typst
|
||||||
|
# ^^^ source.typst keyword.control.loop.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst variable.other.readwrite.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^^ source.typst keyword.other.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^^^^^ source.typst entity.name.function.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^ source.typst constant.numeric.integer.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst meta.brace.curly.typst
|
||||||
|
# ^ source.typst meta.brace.curly.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst meta.brace.curly.typst
|
||||||
|
# ^ source.typst meta.brace.curly.typst
|
||||||
|
>1
|
||||||
|
#^^ source.typst
|
22
syntaxes/textmate/tests/unit/basic/control-flow-if.typ
Normal file
22
syntaxes/textmate/tests/unit/basic/control-flow-if.typ
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
#if 1
|
||||||
|
#if {} 1
|
||||||
|
#if {} else {} 1
|
||||||
|
#if 1 {} else {} 1
|
||||||
|
#if [] {} else {} #1
|
||||||
|
#if {} {} else {} {}
|
||||||
|
#if () {} else {} # a
|
||||||
|
|
||||||
|
#if () {} else {}
|
||||||
|
1
|
||||||
|
|
||||||
|
#if () {} else {}
|
||||||
|
{}
|
||||||
|
|
||||||
|
#if () {} else {}
|
||||||
|
{
|
||||||
|
#if () {} else {}
|
||||||
|
|
||||||
|
|
||||||
|
1
|
||||||
|
# if () {} else {}
|
||||||
|
1
|
161
syntaxes/textmate/tests/unit/basic/control-flow-if.typ.snap
Normal file
161
syntaxes/textmate/tests/unit/basic/control-flow-if.typ.snap
Normal file
|
@ -0,0 +1,161 @@
|
||||||
|
>#if 1
|
||||||
|
#^ source.typst punctuation.definition.hash.typst
|
||||||
|
# ^^ source.typst keyword.control.conditional.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst constant.numeric.integer.typst
|
||||||
|
>#if {} 1
|
||||||
|
#^ source.typst punctuation.definition.hash.typst
|
||||||
|
# ^^ source.typst keyword.control.conditional.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst meta.brace.curly.typst
|
||||||
|
# ^ source.typst meta.brace.curly.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst constant.numeric.integer.typst
|
||||||
|
>#if {} else {} 1
|
||||||
|
#^ source.typst punctuation.definition.hash.typst
|
||||||
|
# ^^ source.typst keyword.control.conditional.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst meta.brace.curly.typst
|
||||||
|
# ^ source.typst meta.brace.curly.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^^^^ source.typst variable.other.readwrite.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst meta.brace.curly.typst
|
||||||
|
# ^ source.typst meta.brace.curly.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst constant.numeric.integer.typst
|
||||||
|
>#if 1 {} else {} 1
|
||||||
|
#^ source.typst punctuation.definition.hash.typst
|
||||||
|
# ^^ source.typst keyword.control.conditional.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst constant.numeric.integer.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst meta.brace.curly.typst
|
||||||
|
# ^ source.typst meta.brace.curly.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^^^^ source.typst variable.other.readwrite.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst meta.brace.curly.typst
|
||||||
|
# ^ source.typst meta.brace.curly.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst constant.numeric.integer.typst
|
||||||
|
>#if [] {} else {} #1
|
||||||
|
#^ source.typst punctuation.definition.hash.typst
|
||||||
|
# ^^ source.typst keyword.control.conditional.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst meta.brace.square.typ
|
||||||
|
# ^ source.typst meta.brace.square.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst meta.brace.curly.typst
|
||||||
|
# ^ source.typst meta.brace.curly.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^^^^ source.typst variable.other.readwrite.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst meta.brace.curly.typst
|
||||||
|
# ^ source.typst meta.brace.curly.typst
|
||||||
|
# ^^ source.typst
|
||||||
|
# ^ source.typst constant.numeric.integer.typst
|
||||||
|
>#if {} {} else {} {}
|
||||||
|
#^ source.typst punctuation.definition.hash.typst
|
||||||
|
# ^^ source.typst keyword.control.conditional.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst meta.brace.curly.typst
|
||||||
|
# ^ source.typst meta.brace.curly.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst meta.brace.curly.typst
|
||||||
|
# ^ source.typst meta.brace.curly.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^^^^ source.typst variable.other.readwrite.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst meta.brace.curly.typst
|
||||||
|
# ^ source.typst meta.brace.curly.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst meta.brace.curly.typst
|
||||||
|
# ^ source.typst meta.brace.curly.typst
|
||||||
|
>#if () {} else {} # a
|
||||||
|
#^ source.typst punctuation.definition.hash.typst
|
||||||
|
# ^^ source.typst keyword.control.conditional.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^^ source.typst meta.array.empty.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst meta.brace.curly.typst
|
||||||
|
# ^ source.typst meta.brace.curly.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^^^^ source.typst variable.other.readwrite.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst meta.brace.curly.typst
|
||||||
|
# ^ source.typst meta.brace.curly.typst
|
||||||
|
# ^^^ source.typst
|
||||||
|
# ^ source.typst variable.other.readwrite.typst
|
||||||
|
>
|
||||||
|
>#if () {} else {}
|
||||||
|
#^ source.typst punctuation.definition.hash.typst
|
||||||
|
# ^^ source.typst keyword.control.conditional.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^^ source.typst meta.array.empty.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst meta.brace.curly.typst
|
||||||
|
# ^ source.typst meta.brace.curly.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^^^^ source.typst variable.other.readwrite.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst meta.brace.curly.typst
|
||||||
|
# ^ source.typst meta.brace.curly.typst
|
||||||
|
>1
|
||||||
|
#^^ source.typst
|
||||||
|
>
|
||||||
|
>#if () {} else {}
|
||||||
|
#^ source.typst punctuation.definition.hash.typst
|
||||||
|
# ^^ source.typst keyword.control.conditional.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^^ source.typst meta.array.empty.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst meta.brace.curly.typst
|
||||||
|
# ^ source.typst meta.brace.curly.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^^^^ source.typst variable.other.readwrite.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst meta.brace.curly.typst
|
||||||
|
# ^ source.typst meta.brace.curly.typst
|
||||||
|
>{}
|
||||||
|
#^^^ source.typst
|
||||||
|
>
|
||||||
|
>#if () {} else {}
|
||||||
|
#^ source.typst punctuation.definition.hash.typst
|
||||||
|
# ^^ source.typst keyword.control.conditional.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^^ source.typst meta.array.empty.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst meta.brace.curly.typst
|
||||||
|
# ^ source.typst meta.brace.curly.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^^^^ source.typst variable.other.readwrite.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst meta.brace.curly.typst
|
||||||
|
# ^ source.typst meta.brace.curly.typst
|
||||||
|
>{
|
||||||
|
#^^ source.typst
|
||||||
|
>#if () {} else {}
|
||||||
|
#^ source.typst punctuation.definition.hash.typst
|
||||||
|
# ^^ source.typst keyword.control.conditional.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^^ source.typst meta.array.empty.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst meta.brace.curly.typst
|
||||||
|
# ^ source.typst meta.brace.curly.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^^^^ source.typst variable.other.readwrite.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst meta.brace.curly.typst
|
||||||
|
# ^ source.typst meta.brace.curly.typst
|
||||||
|
>
|
||||||
|
>
|
||||||
|
>1
|
||||||
|
#^^ source.typst
|
||||||
|
># if () {} else {}
|
||||||
|
#^ source.typst punctuation.definition.hash.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^^^^^^^^^^^^^^^^^ source.typst
|
||||||
|
>1
|
||||||
|
#^^ source.typst
|
||||||
|
>
|
4
syntaxes/textmate/tests/unit/basic/expr_lit.typ
Normal file
4
syntaxes/textmate/tests/unit/basic/expr_lit.typ
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
#()
|
||||||
|
#( )
|
||||||
|
#(:)
|
||||||
|
#( : )
|
12
syntaxes/textmate/tests/unit/basic/expr_lit.typ.snap
Normal file
12
syntaxes/textmate/tests/unit/basic/expr_lit.typ.snap
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
>#()
|
||||||
|
#^ source.typst punctuation.definition.hash.typst
|
||||||
|
# ^^ source.typst meta.array.empty.typst
|
||||||
|
>#( )
|
||||||
|
#^ source.typst punctuation.definition.hash.typst
|
||||||
|
# ^^^ source.typst meta.array.empty.typst
|
||||||
|
>#(:)
|
||||||
|
#^ source.typst punctuation.definition.hash.typst
|
||||||
|
# ^^^ source.typst meta.dictionary.empty.typst
|
||||||
|
>#( : )
|
||||||
|
#^ source.typst punctuation.definition.hash.typst
|
||||||
|
# ^^^^^ source.typst meta.dictionary.empty.typst
|
1
syntaxes/textmate/tests/unit/basic/http.typ
Normal file
1
syntaxes/textmate/tests/unit/basic/http.typ
Normal file
|
@ -0,0 +1 @@
|
||||||
|
https://zh.wikipedia.org
|
2
syntaxes/textmate/tests/unit/basic/http.typ.snap
Normal file
2
syntaxes/textmate/tests/unit/basic/http.typ.snap
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
>https://zh.wikipedia.org
|
||||||
|
#^^^^^^^^^^^^^^^^^^^^^^^^ source.typst markup.underline.link.typst
|
13
syntaxes/textmate/tests/unit/basic/let.typ
Normal file
13
syntaxes/textmate/tests/unit/basic/let.typ
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
#let x = 1;
|
||||||
|
#let (x) = 1;
|
||||||
|
#let (x, y) = (1, 1);
|
||||||
|
#let (x, (y, z)) = (1, (1, 1));
|
||||||
|
#let (a: a) = (a: 1);
|
||||||
|
#let (a, (b: b)) = (1, (b: 1));
|
||||||
|
#let (a, (b: (c, (b: b)))) = (a, (b: (1, (b: b))));
|
||||||
|
#let ((b: (c, (b: b))), a) = ((b: (1, (b: b))), a);
|
||||||
|
#let (a, ..) = (1, 1);
|
||||||
|
#let (.., a) = (1, 1);
|
||||||
|
#let (a: a, ..) = (a: a);
|
||||||
|
#let (.., a: a) = (a: a);
|
||||||
|
#let (a: a, .., b: b) = (a: a, b: b);
|
343
syntaxes/textmate/tests/unit/basic/let.typ.snap
Normal file
343
syntaxes/textmate/tests/unit/basic/let.typ.snap
Normal file
|
@ -0,0 +1,343 @@
|
||||||
|
>#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 keyword.operator.assignment.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst constant.numeric.integer.typst
|
||||||
|
# ^ source.typst punctuation.terminator.statement.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 meta.brace.round.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
|
||||||
|
# ^ source.typst keyword.operator.assignment.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst constant.numeric.integer.typst
|
||||||
|
# ^ source.typst punctuation.terminator.statement.typst
|
||||||
|
>#let (x, y) = (1, 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 meta.brace.round.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
|
||||||
|
# ^ 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
|
||||||
|
# ^ source.typst keyword.operator.assignment.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^ source.typst constant.numeric.integer.typst
|
||||||
|
# ^ source.typst punctuation.separator.comma.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst constant.numeric.integer.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^ source.typst punctuation.terminator.statement.typst
|
||||||
|
>#let (x, (y, z)) = (1, (1, 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 meta.brace.round.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
|
||||||
|
# ^ source.typst meta.expr.let.typst meta.brace.round.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
|
||||||
|
# ^ 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 keyword.operator.assignment.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^ source.typst constant.numeric.integer.typst
|
||||||
|
# ^ source.typst punctuation.separator.comma.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^ source.typst constant.numeric.integer.typst
|
||||||
|
# ^ source.typst punctuation.separator.comma.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst constant.numeric.integer.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^ source.typst punctuation.terminator.statement.typst
|
||||||
|
>#let (a: a) = (a: 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 meta.brace.round.typst
|
||||||
|
# ^ source.typst meta.expr.let.typst variable.other.readwrite.typst
|
||||||
|
# ^ source.typst meta.expr.let.typst punctuation.separator.colon.typst
|
||||||
|
# ^ source.typst meta.expr.let.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
|
||||||
|
# ^ source.typst keyword.operator.assignment.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^ source.typst variable.other.readwrite.typst
|
||||||
|
# ^ source.typst punctuation.separator.colon.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst constant.numeric.integer.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^ source.typst punctuation.terminator.statement.typst
|
||||||
|
>#let (a, (b: b)) = (1, (b: 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 meta.brace.round.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
|
||||||
|
# ^ source.typst meta.expr.let.typst meta.brace.round.typst
|
||||||
|
# ^ source.typst meta.expr.let.typst variable.other.readwrite.typst
|
||||||
|
# ^ source.typst meta.expr.let.typst punctuation.separator.colon.typst
|
||||||
|
# ^ source.typst meta.expr.let.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 keyword.operator.assignment.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^ source.typst constant.numeric.integer.typst
|
||||||
|
# ^ source.typst punctuation.separator.comma.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^ source.typst variable.other.readwrite.typst
|
||||||
|
# ^ source.typst punctuation.separator.colon.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst constant.numeric.integer.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^ source.typst punctuation.terminator.statement.typst
|
||||||
|
>#let (a, (b: (c, (b: b)))) = (a, (b: (1, (b: b))));
|
||||||
|
#^ 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 meta.brace.round.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
|
||||||
|
# ^ source.typst meta.expr.let.typst meta.brace.round.typst
|
||||||
|
# ^ source.typst meta.expr.let.typst variable.other.readwrite.typst
|
||||||
|
# ^ source.typst meta.expr.let.typst punctuation.separator.colon.typst
|
||||||
|
# ^ source.typst meta.expr.let.typst
|
||||||
|
# ^ source.typst meta.expr.let.typst meta.brace.round.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
|
||||||
|
# ^ source.typst meta.expr.let.typst meta.brace.round.typst
|
||||||
|
# ^ source.typst meta.expr.let.typst variable.other.readwrite.typst
|
||||||
|
# ^ source.typst meta.expr.let.typst punctuation.separator.colon.typst
|
||||||
|
# ^ source.typst meta.expr.let.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 meta.brace.round.typst
|
||||||
|
# ^ source.typst meta.expr.let.typst meta.brace.round.typst
|
||||||
|
# ^ source.typst meta.expr.let.typst
|
||||||
|
# ^ source.typst keyword.operator.assignment.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^ source.typst variable.other.readwrite.typst
|
||||||
|
# ^ source.typst punctuation.separator.comma.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^ source.typst variable.other.readwrite.typst
|
||||||
|
# ^ source.typst punctuation.separator.colon.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^ source.typst constant.numeric.integer.typst
|
||||||
|
# ^ source.typst punctuation.separator.comma.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^ source.typst variable.other.readwrite.typst
|
||||||
|
# ^ source.typst punctuation.separator.colon.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst variable.other.readwrite.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^ source.typst punctuation.terminator.statement.typst
|
||||||
|
>#let ((b: (c, (b: b))), a) = ((b: (1, (b: b))), a);
|
||||||
|
#^ 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 meta.brace.round.typst
|
||||||
|
# ^ source.typst meta.expr.let.typst meta.brace.round.typst
|
||||||
|
# ^ source.typst meta.expr.let.typst variable.other.readwrite.typst
|
||||||
|
# ^ source.typst meta.expr.let.typst punctuation.separator.colon.typst
|
||||||
|
# ^ source.typst meta.expr.let.typst
|
||||||
|
# ^ source.typst meta.expr.let.typst meta.brace.round.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
|
||||||
|
# ^ source.typst meta.expr.let.typst meta.brace.round.typst
|
||||||
|
# ^ source.typst meta.expr.let.typst variable.other.readwrite.typst
|
||||||
|
# ^ source.typst meta.expr.let.typst punctuation.separator.colon.typst
|
||||||
|
# ^ source.typst meta.expr.let.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 meta.brace.round.typst
|
||||||
|
# ^ source.typst meta.expr.let.typst punctuation.separator.comma.typst
|
||||||
|
# ^ source.typst meta.expr.let.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
|
||||||
|
# ^ source.typst keyword.operator.assignment.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^ source.typst variable.other.readwrite.typst
|
||||||
|
# ^ source.typst punctuation.separator.colon.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^ source.typst constant.numeric.integer.typst
|
||||||
|
# ^ source.typst punctuation.separator.comma.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^ source.typst variable.other.readwrite.typst
|
||||||
|
# ^ source.typst punctuation.separator.colon.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst variable.other.readwrite.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^ source.typst punctuation.separator.comma.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst variable.other.readwrite.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^ source.typst punctuation.terminator.statement.typst
|
||||||
|
>#let (a, ..) = (1, 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 meta.brace.round.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
|
||||||
|
# ^^ source.typst meta.expr.let.typst keyword.operator.range.typst
|
||||||
|
# ^ source.typst meta.expr.let.typst meta.brace.round.typst
|
||||||
|
# ^ source.typst meta.expr.let.typst
|
||||||
|
# ^ source.typst keyword.operator.assignment.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^ source.typst constant.numeric.integer.typst
|
||||||
|
# ^ source.typst punctuation.separator.comma.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst constant.numeric.integer.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^ source.typst punctuation.terminator.statement.typst
|
||||||
|
>#let (.., a) = (1, 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 meta.brace.round.typst
|
||||||
|
# ^^ source.typst meta.expr.let.typst keyword.operator.range.typst
|
||||||
|
# ^ source.typst meta.expr.let.typst punctuation.separator.comma.typst
|
||||||
|
# ^ source.typst meta.expr.let.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
|
||||||
|
# ^ source.typst keyword.operator.assignment.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^ source.typst constant.numeric.integer.typst
|
||||||
|
# ^ source.typst punctuation.separator.comma.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst constant.numeric.integer.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^ source.typst punctuation.terminator.statement.typst
|
||||||
|
>#let (a: a, ..) = (a: a);
|
||||||
|
#^ 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 meta.brace.round.typst
|
||||||
|
# ^ source.typst meta.expr.let.typst variable.other.readwrite.typst
|
||||||
|
# ^ source.typst meta.expr.let.typst punctuation.separator.colon.typst
|
||||||
|
# ^ source.typst meta.expr.let.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
|
||||||
|
# ^^ source.typst meta.expr.let.typst keyword.operator.range.typst
|
||||||
|
# ^ source.typst meta.expr.let.typst meta.brace.round.typst
|
||||||
|
# ^ source.typst meta.expr.let.typst
|
||||||
|
# ^ source.typst keyword.operator.assignment.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^ source.typst variable.other.readwrite.typst
|
||||||
|
# ^ source.typst punctuation.separator.colon.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst variable.other.readwrite.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^ source.typst punctuation.terminator.statement.typst
|
||||||
|
>#let (.., a: a) = (a: a);
|
||||||
|
#^ 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 meta.brace.round.typst
|
||||||
|
# ^^ source.typst meta.expr.let.typst keyword.operator.range.typst
|
||||||
|
# ^ source.typst meta.expr.let.typst punctuation.separator.comma.typst
|
||||||
|
# ^ source.typst meta.expr.let.typst
|
||||||
|
# ^ source.typst meta.expr.let.typst variable.other.readwrite.typst
|
||||||
|
# ^ source.typst meta.expr.let.typst punctuation.separator.colon.typst
|
||||||
|
# ^ source.typst meta.expr.let.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
|
||||||
|
# ^ source.typst keyword.operator.assignment.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^ source.typst variable.other.readwrite.typst
|
||||||
|
# ^ source.typst punctuation.separator.colon.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst variable.other.readwrite.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^ source.typst punctuation.terminator.statement.typst
|
||||||
|
>#let (a: a, .., b: b) = (a: a, b: b);
|
||||||
|
#^ 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 meta.brace.round.typst
|
||||||
|
# ^ source.typst meta.expr.let.typst variable.other.readwrite.typst
|
||||||
|
# ^ source.typst meta.expr.let.typst punctuation.separator.colon.typst
|
||||||
|
# ^ source.typst meta.expr.let.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
|
||||||
|
# ^^ source.typst meta.expr.let.typst keyword.operator.range.typst
|
||||||
|
# ^ source.typst meta.expr.let.typst punctuation.separator.comma.typst
|
||||||
|
# ^ source.typst meta.expr.let.typst
|
||||||
|
# ^ source.typst meta.expr.let.typst variable.other.readwrite.typst
|
||||||
|
# ^ source.typst meta.expr.let.typst punctuation.separator.colon.typst
|
||||||
|
# ^ source.typst meta.expr.let.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
|
||||||
|
# ^ source.typst keyword.operator.assignment.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^ source.typst variable.other.readwrite.typst
|
||||||
|
# ^ source.typst punctuation.separator.colon.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst variable.other.readwrite.typst
|
||||||
|
# ^ source.typst punctuation.separator.comma.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst variable.other.readwrite.typst
|
||||||
|
# ^ source.typst punctuation.separator.colon.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst variable.other.readwrite.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^ source.typst punctuation.terminator.statement.typst
|
4
syntaxes/textmate/tests/unit/basic/let2.typ
Normal file
4
syntaxes/textmate/tests/unit/basic/let2.typ
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
#(let x = 1)
|
||||||
|
#(let x = 1);
|
||||||
|
#(((let x = 1)));
|
||||||
|
#(((let x = 1)))
|
54
syntaxes/textmate/tests/unit/basic/let2.typ.snap
Normal file
54
syntaxes/textmate/tests/unit/basic/let2.typ.snap
Normal file
|
@ -0,0 +1,54 @@
|
||||||
|
>#(let x = 1)
|
||||||
|
#^ source.typst punctuation.definition.hash.typst
|
||||||
|
# ^ source.typst meta.brace.round.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 keyword.operator.assignment.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst constant.numeric.integer.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
>#(let x = 1);
|
||||||
|
#^ source.typst punctuation.definition.hash.typst
|
||||||
|
# ^ source.typst meta.brace.round.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 keyword.operator.assignment.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst constant.numeric.integer.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^ source.typst punctuation.terminator.statement.typst
|
||||||
|
>#(((let x = 1)));
|
||||||
|
#^ source.typst punctuation.definition.hash.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^ source.typst meta.brace.round.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 keyword.operator.assignment.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst constant.numeric.integer.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^ source.typst punctuation.terminator.statement.typst
|
||||||
|
>#(((let x = 1)))
|
||||||
|
#^ source.typst punctuation.definition.hash.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^ source.typst meta.brace.round.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 keyword.operator.assignment.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst constant.numeric.integer.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
9
syntaxes/textmate/tests/unit/basic/let_fn.typ
Normal file
9
syntaxes/textmate/tests/unit/basic/let_fn.typ
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
#let f() = 1;
|
||||||
|
#let f(a) = 1;
|
||||||
|
#let f(a, b: none) = 1;
|
||||||
|
#let f(a, (b, c)) = 1;
|
||||||
|
#let f(a, (b, c: d)) = 1;
|
||||||
|
#let f((a, b)) = 1;
|
||||||
|
#let f((a, (c: (b: e)))) = 1;
|
||||||
|
#let f((a, ..)) = 1;
|
||||||
|
#let f((.., a)) = 1;
|
171
syntaxes/textmate/tests/unit/basic/let_fn.typ.snap
Normal file
171
syntaxes/textmate/tests/unit/basic/let_fn.typ.snap
Normal file
|
@ -0,0 +1,171 @@
|
||||||
|
>#let f() = 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 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
|
||||||
|
# ^ source.typst keyword.operator.assignment.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst constant.numeric.integer.typst
|
||||||
|
# ^ source.typst punctuation.terminator.statement.typst
|
||||||
|
>#let f(a) = 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 entity.name.function.typst
|
||||||
|
# ^ source.typst meta.expr.let.typst meta.brace.round.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
|
||||||
|
# ^ source.typst keyword.operator.assignment.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst constant.numeric.integer.typst
|
||||||
|
# ^ source.typst punctuation.terminator.statement.typst
|
||||||
|
>#let f(a, b: none) = 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 entity.name.function.typst
|
||||||
|
# ^ source.typst meta.expr.let.typst meta.brace.round.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
|
||||||
|
# ^ source.typst meta.expr.let.typst variable.other.readwrite.typst
|
||||||
|
# ^ source.typst meta.expr.let.typst punctuation.separator.colon.typst
|
||||||
|
# ^ source.typst meta.expr.let.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
|
||||||
|
# ^ source.typst keyword.operator.assignment.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst constant.numeric.integer.typst
|
||||||
|
# ^ source.typst punctuation.terminator.statement.typst
|
||||||
|
>#let f(a, (b, c)) = 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 entity.name.function.typst
|
||||||
|
# ^ source.typst meta.expr.let.typst meta.brace.round.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
|
||||||
|
# ^ source.typst meta.expr.let.typst meta.brace.round.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
|
||||||
|
# ^ 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 keyword.operator.assignment.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst constant.numeric.integer.typst
|
||||||
|
# ^ source.typst punctuation.terminator.statement.typst
|
||||||
|
>#let f(a, (b, c: d)) = 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 entity.name.function.typst
|
||||||
|
# ^ source.typst meta.expr.let.typst meta.brace.round.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
|
||||||
|
# ^ source.typst meta.expr.let.typst meta.brace.round.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
|
||||||
|
# ^ source.typst meta.expr.let.typst variable.other.readwrite.typst
|
||||||
|
# ^ source.typst meta.expr.let.typst punctuation.separator.colon.typst
|
||||||
|
# ^ source.typst meta.expr.let.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 keyword.operator.assignment.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst constant.numeric.integer.typst
|
||||||
|
# ^ source.typst punctuation.terminator.statement.typst
|
||||||
|
>#let f((a, b)) = 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 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 variable.other.readwrite.typst
|
||||||
|
# ^ source.typst meta.expr.let.typst punctuation.separator.comma.typst
|
||||||
|
# ^ source.typst meta.expr.let.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 keyword.operator.assignment.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst constant.numeric.integer.typst
|
||||||
|
# ^ source.typst punctuation.terminator.statement.typst
|
||||||
|
>#let f((a, (c: (b: e)))) = 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 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 variable.other.readwrite.typst
|
||||||
|
# ^ source.typst meta.expr.let.typst punctuation.separator.comma.typst
|
||||||
|
# ^ source.typst meta.expr.let.typst
|
||||||
|
# ^ source.typst meta.expr.let.typst meta.brace.round.typst
|
||||||
|
# ^ source.typst meta.expr.let.typst variable.other.readwrite.typst
|
||||||
|
# ^ source.typst meta.expr.let.typst punctuation.separator.colon.typst
|
||||||
|
# ^ source.typst meta.expr.let.typst
|
||||||
|
# ^ source.typst meta.expr.let.typst meta.brace.round.typst
|
||||||
|
# ^ source.typst meta.expr.let.typst variable.other.readwrite.typst
|
||||||
|
# ^ source.typst meta.expr.let.typst punctuation.separator.colon.typst
|
||||||
|
# ^ source.typst meta.expr.let.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 meta.brace.round.typst
|
||||||
|
# ^ source.typst meta.expr.let.typst meta.brace.round.typst
|
||||||
|
# ^ source.typst meta.expr.let.typst
|
||||||
|
# ^ source.typst keyword.operator.assignment.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst constant.numeric.integer.typst
|
||||||
|
# ^ source.typst punctuation.terminator.statement.typst
|
||||||
|
>#let f((a, ..)) = 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 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 variable.other.readwrite.typst
|
||||||
|
# ^ source.typst meta.expr.let.typst punctuation.separator.comma.typst
|
||||||
|
# ^ source.typst meta.expr.let.typst
|
||||||
|
# ^^ source.typst meta.expr.let.typst keyword.operator.range.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 keyword.operator.assignment.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst constant.numeric.integer.typst
|
||||||
|
# ^ source.typst punctuation.terminator.statement.typst
|
||||||
|
>#let f((.., a)) = 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 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 punctuation.separator.comma.typst
|
||||||
|
# ^ source.typst meta.expr.let.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 keyword.operator.assignment.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst constant.numeric.integer.typst
|
||||||
|
# ^ source.typst punctuation.terminator.statement.typst
|
3
syntaxes/textmate/tests/unit/basic/markup_constant.typ
Normal file
3
syntaxes/textmate/tests/unit/basic/markup_constant.typ
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
1
|
||||||
|
#
|
||||||
|
#1pt #1pt
|
10
syntaxes/textmate/tests/unit/basic/markup_constant.typ.snap
Normal file
10
syntaxes/textmate/tests/unit/basic/markup_constant.typ.snap
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
>1
|
||||||
|
#^^ source.typst
|
||||||
|
>#
|
||||||
|
#^ source.typst punctuation.definition.hash.typst
|
||||||
|
>#1pt #1pt
|
||||||
|
#^ source.typst punctuation.definition.hash.typst
|
||||||
|
# ^^^ source.typst constant.numeric.length.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst punctuation.definition.hash.typst
|
||||||
|
# ^^^ source.typst constant.numeric.length.typst
|
24
syntaxes/textmate/tests/unit/basic/raw.typ
Normal file
24
syntaxes/textmate/tests/unit/basic/raw.typ
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
```typ
|
||||||
|
abc
|
||||||
|
```
|
||||||
|
|
||||||
|
```typ abc ```
|
||||||
|
|
||||||
|
#```typ abc```
|
||||||
|
|
||||||
|
#(```typ abc```)
|
||||||
|
|
||||||
|
#text(```typ https://zh.wikipedia.org```)
|
||||||
|
|
||||||
|
````typ
|
||||||
|
https://zh.wikipedia.org
|
||||||
|
````
|
||||||
|
|
||||||
|
#(
|
||||||
|
```typ
|
||||||
|
writing-markup
|
||||||
|
```,
|
||||||
|
```typ
|
||||||
|
writing-markup
|
||||||
|
```
|
||||||
|
)
|
74
syntaxes/textmate/tests/unit/basic/raw.typ.snap
Normal file
74
syntaxes/textmate/tests/unit/basic/raw.typ.snap
Normal file
|
@ -0,0 +1,74 @@
|
||||||
|
>```typ
|
||||||
|
#^^^ source.typst markup.raw.block.typst punctuation.definition.raw.begin.typst
|
||||||
|
# ^^^ source.typst markup.raw.block.typst fenced_code.block.language.typst
|
||||||
|
>abc
|
||||||
|
#^^^^ source.typst markup.raw.block.typst meta.embedded.block.typst
|
||||||
|
>```
|
||||||
|
#^^^ source.typst markup.raw.block.typst punctuation.definition.raw.end.typst
|
||||||
|
>
|
||||||
|
>```typ abc ```
|
||||||
|
#^^^ source.typst markup.raw.block.typst punctuation.definition.raw.begin.typst
|
||||||
|
# ^^^ source.typst markup.raw.block.typst fenced_code.block.language.typst
|
||||||
|
# ^^^^^ source.typst markup.raw.block.typst meta.embedded.block.typst
|
||||||
|
# ^^^ source.typst markup.raw.block.typst punctuation.definition.raw.end.typst
|
||||||
|
>
|
||||||
|
>#```typ abc```
|
||||||
|
#^ source.typst punctuation.definition.hash.typst
|
||||||
|
# ^^^ source.typst markup.raw.block.typst punctuation.definition.raw.begin.typst
|
||||||
|
# ^^^ source.typst markup.raw.block.typst fenced_code.block.language.typst
|
||||||
|
# ^^^^ source.typst markup.raw.block.typst meta.embedded.block.typst
|
||||||
|
# ^^^ source.typst markup.raw.block.typst punctuation.definition.raw.end.typst
|
||||||
|
>
|
||||||
|
>#(```typ abc```)
|
||||||
|
#^ source.typst punctuation.definition.hash.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^^^ source.typst markup.raw.block.typst punctuation.definition.raw.begin.typst
|
||||||
|
# ^^^ source.typst markup.raw.block.typst fenced_code.block.language.typst
|
||||||
|
# ^^^^ source.typst markup.raw.block.typst meta.embedded.block.typst
|
||||||
|
# ^^^ source.typst markup.raw.block.typst punctuation.definition.raw.end.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
>
|
||||||
|
>#text(```typ https://zh.wikipedia.org```)
|
||||||
|
#^ source.typst punctuation.definition.hash.typst
|
||||||
|
# ^^^^ source.typst entity.name.function.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^^^ source.typst markup.raw.block.typst punctuation.definition.raw.begin.typst
|
||||||
|
# ^^^ source.typst markup.raw.block.typst fenced_code.block.language.typst
|
||||||
|
# ^ source.typst markup.raw.block.typst meta.embedded.block.typst
|
||||||
|
# ^^^^^^^^^^^^^^^^^^^^^^^^ source.typst markup.raw.block.typst meta.embedded.block.typst markup.underline.link.typst
|
||||||
|
# ^^^ source.typst markup.raw.block.typst punctuation.definition.raw.end.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
>
|
||||||
|
>````typ
|
||||||
|
#^^^^ source.typst markup.raw.block.typst punctuation.definition.raw.begin.typst
|
||||||
|
# ^^^ source.typst markup.raw.block.typst fenced_code.block.language.typst
|
||||||
|
>https://zh.wikipedia.org
|
||||||
|
#^^^^^^^^^^^^^^^^^^^^^^^^ source.typst markup.raw.block.typst meta.embedded.block.typst markup.underline.link.typst
|
||||||
|
>````
|
||||||
|
#^^^^ source.typst markup.raw.block.typst punctuation.definition.raw.end.typst
|
||||||
|
>
|
||||||
|
>#(
|
||||||
|
#^ source.typst punctuation.definition.hash.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
> ```typ
|
||||||
|
#^^ source.typst
|
||||||
|
# ^^^ source.typst markup.raw.block.typst punctuation.definition.raw.begin.typst
|
||||||
|
# ^^^ source.typst markup.raw.block.typst fenced_code.block.language.typst
|
||||||
|
> writing-markup
|
||||||
|
#^^^^^^^^^^^^^^^^^ source.typst markup.raw.block.typst meta.embedded.block.typst
|
||||||
|
> ```,
|
||||||
|
#^^ source.typst markup.raw.block.typst meta.embedded.block.typst
|
||||||
|
# ^^^ source.typst markup.raw.block.typst punctuation.definition.raw.end.typst
|
||||||
|
# ^ source.typst punctuation.separator.comma.typst
|
||||||
|
> ```typ
|
||||||
|
#^^ source.typst
|
||||||
|
# ^^^ source.typst markup.raw.block.typst punctuation.definition.raw.begin.typst
|
||||||
|
# ^^^ source.typst markup.raw.block.typst fenced_code.block.language.typst
|
||||||
|
> writing-markup
|
||||||
|
#^^^^^^^^^^^^^^^^^ source.typst markup.raw.block.typst meta.embedded.block.typst
|
||||||
|
> ```
|
||||||
|
#^^ source.typst markup.raw.block.typst meta.embedded.block.typst
|
||||||
|
# ^^^ source.typst markup.raw.block.typst punctuation.definition.raw.end.typst
|
||||||
|
>)
|
||||||
|
#^ source.typst meta.brace.round.typst
|
||||||
|
>
|
13
syntaxes/textmate/tests/unit/basic/raw_nest.typ
Normal file
13
syntaxes/textmate/tests/unit/basic/raw_nest.typ
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
````typ
|
||||||
|
```typ
|
||||||
|
abc
|
||||||
|
```
|
||||||
|
````
|
||||||
|
|
||||||
|
`````typ
|
||||||
|
````md
|
||||||
|
```typ
|
||||||
|
abc
|
||||||
|
```
|
||||||
|
````
|
||||||
|
`````
|
30
syntaxes/textmate/tests/unit/basic/raw_nest.typ.snap
Normal file
30
syntaxes/textmate/tests/unit/basic/raw_nest.typ.snap
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
>````typ
|
||||||
|
#^^^^ source.typst markup.raw.block.typst punctuation.definition.raw.begin.typst
|
||||||
|
# ^^^ source.typst markup.raw.block.typst fenced_code.block.language.typst
|
||||||
|
>```typ
|
||||||
|
#^^^ source.typst markup.raw.block.typst meta.embedded.block.typst markup.raw.block.typst punctuation.definition.raw.begin.typst
|
||||||
|
# ^^^ source.typst markup.raw.block.typst meta.embedded.block.typst markup.raw.block.typst fenced_code.block.language.typst
|
||||||
|
>abc
|
||||||
|
#^^^^ source.typst markup.raw.block.typst meta.embedded.block.typst markup.raw.block.typst meta.embedded.block.typst
|
||||||
|
>```
|
||||||
|
#^^^ source.typst markup.raw.block.typst meta.embedded.block.typst markup.raw.block.typst punctuation.definition.raw.end.typst
|
||||||
|
>````
|
||||||
|
#^^^^ source.typst markup.raw.block.typst punctuation.definition.raw.end.typst
|
||||||
|
>
|
||||||
|
>`````typ
|
||||||
|
#^^^^^ source.typst markup.raw.block.typst punctuation.definition.raw.begin.typst
|
||||||
|
# ^^^ source.typst markup.raw.block.typst fenced_code.block.language.typst
|
||||||
|
>````md
|
||||||
|
#^^^^ source.typst markup.raw.block.typst meta.embedded.block.typst markup.raw.block.typst punctuation.definition.raw.begin.typst
|
||||||
|
# ^^^ source.typst markup.raw.block.typst meta.embedded.block.typst markup.raw.block.typst fenced_code.block.language
|
||||||
|
>```typ
|
||||||
|
#^^^^^^^ source.typst markup.raw.block.typst meta.embedded.block.typst markup.raw.block.typst
|
||||||
|
>abc
|
||||||
|
#^^^^ source.typst markup.raw.block.typst meta.embedded.block.typst markup.raw.block.typst
|
||||||
|
>```
|
||||||
|
#^^^^ source.typst markup.raw.block.typst meta.embedded.block.typst markup.raw.block.typst
|
||||||
|
>````
|
||||||
|
#^^^^ source.typst markup.raw.block.typst meta.embedded.block.typst markup.raw.block.typst punctuation.definition.raw.end.typst
|
||||||
|
>`````
|
||||||
|
#^^^^^ source.typst markup.raw.block.typst punctuation.definition.raw.end.typst
|
||||||
|
>
|
8
syntaxes/textmate/tests/unit/basic/set.typ
Normal file
8
syntaxes/textmate/tests/unit/basic/set.typ
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
#set text(fill: red);
|
||||||
|
#set text(fill: red)
|
||||||
|
#set text("")
|
||||||
|
#set text(red)
|
||||||
|
#set list.item(red);
|
||||||
|
#set list.item(fill: red);
|
||||||
|
#set (text(fill: red));
|
||||||
|
#set ((text(fill: red)));
|
95
syntaxes/textmate/tests/unit/basic/set.typ.snap
Normal file
95
syntaxes/textmate/tests/unit/basic/set.typ.snap
Normal file
|
@ -0,0 +1,95 @@
|
||||||
|
>#set text(fill: red);
|
||||||
|
#^ source.typst punctuation.definition.hash.typst
|
||||||
|
# ^^^ source.typst keyword.control.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^^^^ source.typst entity.name.function.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^^^^ source.typst variable.other.readwrite.typst
|
||||||
|
# ^ source.typst punctuation.separator.colon.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^^^ source.typst variable.other.readwrite.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^ source.typst punctuation.terminator.statement.typst
|
||||||
|
>#set text(fill: red)
|
||||||
|
#^ source.typst punctuation.definition.hash.typst
|
||||||
|
# ^^^ source.typst keyword.control.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^^^^ source.typst entity.name.function.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^^^^ source.typst variable.other.readwrite.typst
|
||||||
|
# ^ source.typst punctuation.separator.colon.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^^^ source.typst variable.other.readwrite.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
>#set text("")
|
||||||
|
#^ source.typst punctuation.definition.hash.typst
|
||||||
|
# ^^^ source.typst keyword.control.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^^^^ source.typst entity.name.function.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^ source.typst string.quoted.double.typst punctuation.definition.string.typst
|
||||||
|
# ^ source.typst string.quoted.double.typst punctuation.definition.string.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
>#set text(red)
|
||||||
|
#^ source.typst punctuation.definition.hash.typst
|
||||||
|
# ^^^ source.typst keyword.control.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^^^^ source.typst entity.name.function.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^^^ source.typst variable.other.readwrite.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
>#set list.item(red);
|
||||||
|
#^ source.typst punctuation.definition.hash.typst
|
||||||
|
# ^^^ source.typst keyword.control.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^^^^ source.typst variable.other.readwrite.typst
|
||||||
|
# ^ source.typst keyword.operator.accessor.typst
|
||||||
|
# ^^^^ source.typst entity.name.function.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^^^ source.typst variable.other.readwrite.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^ source.typst punctuation.terminator.statement.typst
|
||||||
|
>#set list.item(fill: red);
|
||||||
|
#^ source.typst punctuation.definition.hash.typst
|
||||||
|
# ^^^ source.typst keyword.control.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^^^^ source.typst variable.other.readwrite.typst
|
||||||
|
# ^ source.typst keyword.operator.accessor.typst
|
||||||
|
# ^^^^ source.typst entity.name.function.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^^^^ source.typst variable.other.readwrite.typst
|
||||||
|
# ^ source.typst punctuation.separator.colon.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^^^ source.typst variable.other.readwrite.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^ source.typst punctuation.terminator.statement.typst
|
||||||
|
>#set (text(fill: red));
|
||||||
|
#^ source.typst punctuation.definition.hash.typst
|
||||||
|
# ^^^ source.typst keyword.control.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^^^^ source.typst entity.name.function.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^^^^ source.typst variable.other.readwrite.typst
|
||||||
|
# ^ source.typst punctuation.separator.colon.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^^^ source.typst variable.other.readwrite.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^ source.typst punctuation.terminator.statement.typst
|
||||||
|
>#set ((text(fill: red)));
|
||||||
|
#^ source.typst punctuation.definition.hash.typst
|
||||||
|
# ^^^ source.typst keyword.control.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^^^^ source.typst entity.name.function.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^^^^ source.typst variable.other.readwrite.typst
|
||||||
|
# ^ source.typst punctuation.separator.colon.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^^^ source.typst variable.other.readwrite.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^ source.typst punctuation.terminator.statement.typst
|
5
syntaxes/textmate/tests/unit/basic/show.typ
Normal file
5
syntaxes/textmate/tests/unit/basic/show.typ
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
#show: it => it
|
||||||
|
#show text: it => it
|
||||||
|
#show: rect
|
||||||
|
#show: list.item.with()
|
||||||
|
#show: rect.with(width: 1pt)
|
55
syntaxes/textmate/tests/unit/basic/show.typ.snap
Normal file
55
syntaxes/textmate/tests/unit/basic/show.typ.snap
Normal file
|
@ -0,0 +1,55 @@
|
||||||
|
>#show: it => it
|
||||||
|
#^ source.typst punctuation.definition.hash.typst
|
||||||
|
# ^^^^ source.typst keyword.control.typst
|
||||||
|
# ^ source.typst punctuation.separator.colon.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^^ source.typst variable.other.readwrite.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^^ source.typst keyword.operator.arrow.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^^ source.typst variable.other.readwrite.typst
|
||||||
|
>#show text: it => it
|
||||||
|
#^ source.typst punctuation.definition.hash.typst
|
||||||
|
# ^^^^ source.typst keyword.control.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^^^^ source.typst variable.other.readwrite.typst
|
||||||
|
# ^ source.typst punctuation.separator.colon.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^^ source.typst variable.other.readwrite.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^^ source.typst keyword.operator.arrow.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^^ source.typst variable.other.readwrite.typst
|
||||||
|
>#show: rect
|
||||||
|
#^ source.typst punctuation.definition.hash.typst
|
||||||
|
# ^^^^ source.typst keyword.control.typst
|
||||||
|
# ^ source.typst punctuation.separator.colon.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^^^^ source.typst variable.other.readwrite.typst
|
||||||
|
>#show: list.item.with()
|
||||||
|
#^ source.typst punctuation.definition.hash.typst
|
||||||
|
# ^^^^ source.typst keyword.control.typst
|
||||||
|
# ^ source.typst punctuation.separator.colon.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^^^^ source.typst variable.other.readwrite.typst
|
||||||
|
# ^ source.typst keyword.operator.accessor.typst
|
||||||
|
# ^^^^ source.typst variable.other.readwrite.typst
|
||||||
|
# ^ source.typst keyword.operator.accessor.typst
|
||||||
|
# ^^^^ source.typst entity.name.function.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
>#show: rect.with(width: 1pt)
|
||||||
|
#^ source.typst punctuation.definition.hash.typst
|
||||||
|
# ^^^^ source.typst keyword.control.typst
|
||||||
|
# ^ source.typst punctuation.separator.colon.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^^^^ source.typst variable.other.readwrite.typst
|
||||||
|
# ^ source.typst keyword.operator.accessor.typst
|
||||||
|
# ^^^^ source.typst entity.name.function.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^^^^^ source.typst variable.other.readwrite.typst
|
||||||
|
# ^ source.typst punctuation.separator.colon.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^^^ source.typst constant.numeric.length.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
>
|
10
syntaxes/textmate/tests/unit/basic/string.typ
Normal file
10
syntaxes/textmate/tests/unit/basic/string.typ
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
#"abc" + 1
|
||||||
|
#"@myriaddreamin" + 1
|
||||||
|
#"[a]" + 1
|
||||||
|
#"{a}" + 1
|
||||||
|
#"\\a" + 1
|
||||||
|
#"\\" + 1
|
||||||
|
#"\\\a" + 1
|
||||||
|
#"\v" + 1
|
||||||
|
#"\我" + 1
|
||||||
|
#"//"
|
61
syntaxes/textmate/tests/unit/basic/string.typ.snap
Normal file
61
syntaxes/textmate/tests/unit/basic/string.typ.snap
Normal file
|
@ -0,0 +1,61 @@
|
||||||
|
>#"abc" + 1
|
||||||
|
#^ source.typst punctuation.definition.hash.typst
|
||||||
|
# ^ source.typst string.quoted.double.typst punctuation.definition.string.typst
|
||||||
|
# ^^^ source.typst string.quoted.double.typst
|
||||||
|
# ^ source.typst string.quoted.double.typst punctuation.definition.string.typst
|
||||||
|
# ^^^^^ source.typst
|
||||||
|
>#"@myriaddreamin" + 1
|
||||||
|
#^ source.typst punctuation.definition.hash.typst
|
||||||
|
# ^ source.typst string.quoted.double.typst punctuation.definition.string.typst
|
||||||
|
# ^^^^^^^^^^^^^^ source.typst string.quoted.double.typst
|
||||||
|
# ^ source.typst string.quoted.double.typst punctuation.definition.string.typst
|
||||||
|
# ^^^^^ source.typst
|
||||||
|
>#"[a]" + 1
|
||||||
|
#^ source.typst punctuation.definition.hash.typst
|
||||||
|
# ^ source.typst string.quoted.double.typst punctuation.definition.string.typst
|
||||||
|
# ^^^ source.typst string.quoted.double.typst
|
||||||
|
# ^ source.typst string.quoted.double.typst punctuation.definition.string.typst
|
||||||
|
# ^^^^^ source.typst
|
||||||
|
>#"{a}" + 1
|
||||||
|
#^ source.typst punctuation.definition.hash.typst
|
||||||
|
# ^ source.typst string.quoted.double.typst punctuation.definition.string.typst
|
||||||
|
# ^^^ source.typst string.quoted.double.typst
|
||||||
|
# ^ source.typst string.quoted.double.typst punctuation.definition.string.typst
|
||||||
|
# ^^^^^ source.typst
|
||||||
|
>#"\\a" + 1
|
||||||
|
#^ source.typst punctuation.definition.hash.typst
|
||||||
|
# ^ source.typst string.quoted.double.typst punctuation.definition.string.typst
|
||||||
|
# ^^ source.typst string.quoted.double.typst constant.character.escape.string.typst
|
||||||
|
# ^ source.typst string.quoted.double.typst
|
||||||
|
# ^ source.typst string.quoted.double.typst punctuation.definition.string.typst
|
||||||
|
# ^^^^^ source.typst
|
||||||
|
>#"\\" + 1
|
||||||
|
#^ source.typst punctuation.definition.hash.typst
|
||||||
|
# ^ source.typst string.quoted.double.typst punctuation.definition.string.typst
|
||||||
|
# ^^ source.typst string.quoted.double.typst constant.character.escape.string.typst
|
||||||
|
# ^ source.typst string.quoted.double.typst punctuation.definition.string.typst
|
||||||
|
# ^^^^^ source.typst
|
||||||
|
>#"\\\a" + 1
|
||||||
|
#^ source.typst punctuation.definition.hash.typst
|
||||||
|
# ^ source.typst string.quoted.double.typst punctuation.definition.string.typst
|
||||||
|
# ^^ source.typst string.quoted.double.typst constant.character.escape.string.typst
|
||||||
|
# ^^ source.typst string.quoted.double.typst
|
||||||
|
# ^ source.typst string.quoted.double.typst punctuation.definition.string.typst
|
||||||
|
# ^^^^^ source.typst
|
||||||
|
>#"\v" + 1
|
||||||
|
#^ source.typst punctuation.definition.hash.typst
|
||||||
|
# ^ source.typst string.quoted.double.typst punctuation.definition.string.typst
|
||||||
|
# ^^ source.typst string.quoted.double.typst
|
||||||
|
# ^ source.typst string.quoted.double.typst punctuation.definition.string.typst
|
||||||
|
# ^^^^^ source.typst
|
||||||
|
>#"\我" + 1
|
||||||
|
#^ source.typst punctuation.definition.hash.typst
|
||||||
|
# ^ source.typst string.quoted.double.typst punctuation.definition.string.typst
|
||||||
|
# ^^ source.typst string.quoted.double.typst
|
||||||
|
# ^ source.typst string.quoted.double.typst punctuation.definition.string.typst
|
||||||
|
# ^^^^^ source.typst
|
||||||
|
>#"//"
|
||||||
|
#^ source.typst punctuation.definition.hash.typst
|
||||||
|
# ^ source.typst string.quoted.double.typst punctuation.definition.string.typst
|
||||||
|
# ^^ source.typst string.quoted.double.typst
|
||||||
|
# ^ source.typst string.quoted.double.typst punctuation.definition.string.typst
|
1
syntaxes/textmate/tests/unit/bugs/comment-in-string.typ
Normal file
1
syntaxes/textmate/tests/unit/bugs/comment-in-string.typ
Normal file
|
@ -0,0 +1 @@
|
||||||
|
#link("https://myriad-dreamin.github.io/typst.ts/cookery/guide/compiler/ts-cli.html")[Form1]: Render to SVG and then embed it as a high-quality vectored image directly.
|
13
syntaxes/textmate/tests/unit/bugs/comment-in-string.typ.snap
Normal file
13
syntaxes/textmate/tests/unit/bugs/comment-in-string.typ.snap
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
>#link("https://myriad-dreamin.github.io/typst.ts/cookery/guide/compiler/ts-cli.html")[Form1]: Render to SVG and then embed it as a high-quality vectored image directly.
|
||||||
|
#^ source.typst punctuation.definition.hash.typst
|
||||||
|
# ^^^^ source.typst entity.name.function.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^ source.typst string.quoted.double.typst punctuation.definition.string.typst
|
||||||
|
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.typst string.quoted.double.typst
|
||||||
|
# ^ source.typst string.quoted.double.typst punctuation.definition.string.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^ source.typst meta.brace.square.typ
|
||||||
|
# ^^^^^ source.typst
|
||||||
|
# ^ source.typst meta.brace.square.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.typst
|
1
syntaxes/textmate/tests/unit/bugs/hover.typ
Normal file
1
syntaxes/textmate/tests/unit/bugs/hover.typ
Normal file
|
@ -0,0 +1 @@
|
||||||
|
#let code(it, args: any, res: none, scope: (:));
|
29
syntaxes/textmate/tests/unit/bugs/hover.typ.snap
Normal file
29
syntaxes/textmate/tests/unit/bugs/hover.typ.snap
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
>#let code(it, args: any, res: none, scope: (:));
|
||||||
|
#^ 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 entity.name.function.typst
|
||||||
|
# ^ source.typst meta.expr.let.typst meta.brace.round.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
|
||||||
|
# ^^^^ source.typst meta.expr.let.typst variable.other.readwrite.typst
|
||||||
|
# ^ source.typst meta.expr.let.typst punctuation.separator.colon.typst
|
||||||
|
# ^ source.typst meta.expr.let.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
|
||||||
|
# ^^^ source.typst meta.expr.let.typst variable.other.readwrite.typst
|
||||||
|
# ^ source.typst meta.expr.let.typst punctuation.separator.colon.typst
|
||||||
|
# ^ source.typst meta.expr.let.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
|
||||||
|
# ^^^^^ source.typst meta.expr.let.typst variable.other.readwrite.typst
|
||||||
|
# ^ source.typst meta.expr.let.typst punctuation.separator.colon.typst
|
||||||
|
# ^ source.typst meta.expr.let.typst
|
||||||
|
# ^ source.typst meta.expr.let.typst meta.brace.round.typst
|
||||||
|
# ^ source.typst meta.expr.let.typst punctuation.separator.colon.typst
|
||||||
|
# ^ source.typst meta.expr.let.typst meta.brace.round.typst
|
||||||
|
# ^ source.typst meta.expr.let.typst meta.brace.round.typst
|
||||||
|
# ^ source.typst punctuation.terminator.statement.typst
|
1
syntaxes/textmate/tests/unit/bugs/ref-in-string.typ
Normal file
1
syntaxes/textmate/tests/unit/bugs/ref-in-string.typ
Normal file
|
@ -0,0 +1 @@
|
||||||
|
#"@myriaddreamin"
|
5
syntaxes/textmate/tests/unit/bugs/ref-in-string.typ.snap
Normal file
5
syntaxes/textmate/tests/unit/bugs/ref-in-string.typ.snap
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
>#"@myriaddreamin"
|
||||||
|
#^ source.typst punctuation.definition.hash.typst
|
||||||
|
# ^ source.typst string.quoted.double.typst punctuation.definition.string.typst
|
||||||
|
# ^^^^^^^^^^^^^^ source.typst string.quoted.double.typst
|
||||||
|
# ^ source.typst string.quoted.double.typst punctuation.definition.string.typst
|
1
syntaxes/textmate/tests/unit/bugs/ts-intro.typ
Normal file
1
syntaxes/textmate/tests/unit/bugs/ts-intro.typ
Normal file
|
@ -0,0 +1 @@
|
||||||
|
by #text(fill: rgb("#3c9123"), "server") and #text(fill: blue, "browser"), there would be a data flow like this:
|
36
syntaxes/textmate/tests/unit/bugs/ts-intro.typ.snap
Normal file
36
syntaxes/textmate/tests/unit/bugs/ts-intro.typ.snap
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
> by #text(fill: rgb("#3c9123"), "server") and #text(fill: blue, "browser"), there would be a data flow like this:
|
||||||
|
#^^^^ source.typst
|
||||||
|
# ^ source.typst punctuation.definition.hash.typst
|
||||||
|
# ^^^^ source.typst entity.name.function.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^^^^ source.typst variable.other.readwrite.typst
|
||||||
|
# ^ source.typst punctuation.separator.colon.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^^^ source.typst entity.name.function.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^ source.typst string.quoted.double.typst punctuation.definition.string.typst
|
||||||
|
# ^^^^^^^ source.typst string.quoted.double.typst
|
||||||
|
# ^ source.typst string.quoted.double.typst punctuation.definition.string.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^ source.typst punctuation.separator.comma.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst string.quoted.double.typst punctuation.definition.string.typst
|
||||||
|
# ^^^^^^ source.typst string.quoted.double.typst
|
||||||
|
# ^ source.typst string.quoted.double.typst punctuation.definition.string.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^^^^^ source.typst
|
||||||
|
# ^ source.typst punctuation.definition.hash.typst
|
||||||
|
# ^^^^ source.typst entity.name.function.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^^^^ source.typst variable.other.readwrite.typst
|
||||||
|
# ^ source.typst punctuation.separator.colon.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^^^^ source.typst variable.other.readwrite.typst
|
||||||
|
# ^ source.typst punctuation.separator.comma.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^ source.typst string.quoted.double.typst punctuation.definition.string.typst
|
||||||
|
# ^^^^^^^ source.typst string.quoted.double.typst
|
||||||
|
# ^ source.typst string.quoted.double.typst punctuation.definition.string.typst
|
||||||
|
# ^ source.typst meta.brace.round.typst
|
||||||
|
# ^ source.typst
|
||||||
|
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.typst
|
1418
syntaxes/textmate/typst.tmLanguage.yaml
Normal file
1418
syntaxes/textmate/typst.tmLanguage.yaml
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue