Refresh TextMate grammar

This commit is contained in:
Laurenz 2022-09-27 16:40:17 +02:00
parent abafb39041
commit 9db89b376d
2 changed files with 50 additions and 37 deletions

View File

@ -389,7 +389,7 @@ impl Category {
Self::Math => "string.other.math.typst", Self::Math => "string.other.math.typst",
Self::Heading => "markup.heading.typst", Self::Heading => "markup.heading.typst",
Self::List => "markup.list.typst", Self::List => "markup.list.typst",
Self::Term => "markup.bold.typst", Self::Term => "markup.list.term.typst",
Self::Label => "entity.name.label.typst", Self::Label => "entity.name.label.typst",
Self::Ref => "markup.other.reference.typst", Self::Ref => "markup.other.reference.typst",
Self::Keyword => "keyword.typst", Self::Keyword => "keyword.typst",

View File

@ -48,6 +48,30 @@
"name": "constant.character.escape.content.typst", "name": "constant.character.escape.content.typst",
"match": "\\\\([\\\\/\\[\\]{}#*_=~`$-.]|u\\{[0-9a-zA-Z]*\\}?)" "match": "\\\\([\\\\/\\[\\]{}#*_=~`$-.]|u\\{[0-9a-zA-Z]*\\}?)"
}, },
{
"name": "punctuation.definition.linebreak.typst",
"match": "\\\\"
},
{
"name": "punctuation.definition.nonbreaking-space.typst",
"match": "~"
},
{
"name": "punctuation.definition.shy.typst",
"match": "-\\?"
},
{
"name": "punctuation.definition.em-dash.typst",
"match": "---"
},
{
"name": "punctuation.definition.en-dash.typst",
"match": "--"
},
{
"name": "punctuation.definition.ellipsis.typst",
"match": "\\.\\.\\."
},
{ {
"name": "markup.bold.typst", "name": "markup.bold.typst",
"begin": "(^\\*|\\*$|((?<=\\W|_)\\*)|(\\*(?=\\W|_)))", "begin": "(^\\*|\\*$|((?<=\\W|_)\\*)|(\\*(?=\\W|_)))",
@ -63,20 +87,26 @@
"patterns": [{ "include": "#markup" }] "patterns": [{ "include": "#markup" }]
}, },
{ {
"name": "punctuation.definition.linebreak.typst", "name": "markup.underline.link.typst",
"match": "\\\\" "match": "https?://[0-9a-zA-Z~/%#&=',;\\.\\+\\?]*"
}, },
{ {
"name": "punctuation.definition.em-dash.typst", "name": "markup.raw.block.typst",
"match": "---" "begin": "`{3,}",
"end": "\\0",
"captures": { "0": { "name": "punctuation.definition.raw.typst" } }
}, },
{ {
"name": "punctuation.definition.en-dash.typst", "name": "markup.raw.inline.typst",
"match": "--" "begin": "`",
"end": "`",
"captures": { "0": { "name": "punctuation.definition.raw.typst" } }
}, },
{ {
"name": "punctuation.definition.nonbreaking-space.typst", "name": "string.other.math.typst",
"match": "~" "begin": "\\$",
"end": "\\$",
"captures": { "0": { "name": "punctuation.defintion.string.math.typst" } }
}, },
{ {
"name": "markup.heading.typst", "name": "markup.heading.typst",
@ -92,42 +122,25 @@
}, },
{ {
"name": "punctuation.definition.list.numbered.typst", "name": "punctuation.definition.list.numbered.typst",
"match": "^\\s*[0-9]*\\.\\s+" "match": "^\\s*([0-9]*\\.|\\+)\\s+"
}, },
{ {
"name": "markup.raw.block.typst", "match": "^\\s*(/)\\s+([^:]*:)",
"begin": "`{3,}", "captures": {
"end": "\\0", "1": { "name": "punctuation.definition.list.description.typst" },
"captures": { "0": { "name": "punctuation.definition.raw.typst" } } "2": { "name": "markup.list.term.typst" }
}, }
{
"name": "markup.raw.inline.typst",
"begin": "`",
"end": "`",
"captures": { "0": { "name": "punctuation.definition.raw.typst" } }
},
{
"name": "string.other.math.block.typst",
"begin": "\\$\\[",
"end": "\\]\\$",
"captures": { "0": { "name": "punctuation.defintion.string.math.typst" } }
},
{
"name": "string.other.math.typst",
"begin": "\\$",
"end": "\\$",
"captures": { "0": { "name": "punctuation.defintion.string.math.typst" } }
},
{
"name": "entity.other.reference.typst",
"match": "(@)[[:alpha:]_][[:alnum:]_-]*",
"captures": { "1": { "name": "punctuation.definition.reference.typst" } }
}, },
{ {
"name": "entity.other.label.typst", "name": "entity.other.label.typst",
"match": "<[[:alpha:]_][[:alnum:]_-]*>", "match": "<[[:alpha:]_][[:alnum:]_-]*>",
"captures": { "1": { "name": "punctuation.definition.label.typst" } } "captures": { "1": { "name": "punctuation.definition.label.typst" } }
}, },
{
"name": "entity.other.reference.typst",
"match": "(@)[[:alpha:]_][[:alnum:]_-]*",
"captures": { "1": { "name": "punctuation.definition.reference.typst" } }
},
{ {
"begin": "(#)(pub|let|set|show|wrap)\\b", "begin": "(#)(pub|let|set|show|wrap)\\b",
"end": "\n|(;)|(?=])", "end": "\n|(;)|(?=])",