summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2022-09-19 11:05:25 +0200
committerLaurenz <laurmaedje@gmail.com>2022-09-19 11:05:25 +0200
commite5f958b92161732ae46ccc66ce3d6eea213cf925 (patch)
tree9554daeeb4128eb25764066ee782ddabd7f66d18 /tools
parenta2e25d2dadc1e3ef4a990b3fa4734044a4400efd (diff)
Handle line comments nested in block comments
Fixes #76
Diffstat (limited to 'tools')
-rw-r--r--tools/support/typst.tmLanguage.json23
1 files changed, 12 insertions, 11 deletions
diff --git a/tools/support/typst.tmLanguage.json b/tools/support/typst.tmLanguage.json
index 36ffade7..f493cc5b 100644
--- a/tools/support/typst.tmLanguage.json
+++ b/tools/support/typst.tmLanguage.json
@@ -4,20 +4,27 @@
{ "include": "#markup" }
],
"repository": {
- "blockcomment": {
+ "comments": {
"patterns": [
{
"name": "comment.block.typst",
"begin": "/\\*",
"end": "\\*/",
"captures": { "0": { "name": "punctuation.definition.comment.typst" } },
- "patterns": [{ "include": "#blockcomment" }]
+ "patterns": [{ "include": "#comments" }]
+ },
+ {
+ "name": "comment.line.double-slash.typst",
+ "begin": "(?<!:)//",
+ "end": "\n",
+ "beginCaptures": { "0": { "name": "punctuation.definition.comment.typst" } },
+ "patterns": [{ "include": "#comments" }]
}
]
},
"common": {
"patterns": [
- { "include": "#blockcomment" },
+ { "include": "#comments" },
{
"name": "meta.block.code.typst",
"begin": "{",
@@ -38,12 +45,6 @@
"patterns": [
{ "include": "#common" },
{
- "name": "comment.line.double-slash.typst",
- "begin": "(?<!:)//",
- "end": "\n",
- "beginCaptures": { "0": { "name": "punctuation.definition.comment.typst" } }
- },
- {
"name": "constant.character.escape.content.typst",
"match": "\\\\([\\\\/\\[\\]{}#*_=~`$-.]|u\\{[0-9a-zA-Z]*\\}?)"
},
@@ -128,7 +129,7 @@
"captures": { "1": { "name": "punctuation.definition.label.typst" } }
},
{
- "begin": "(#)(pub|let|set|rule|select|show|wrap)\\b",
+ "begin": "(#)(pub|let|set|show|wrap)\\b",
"end": "\n|(;)|(?=])",
"beginCaptures": {
"0": { "name": "keyword.other.typst" },
@@ -239,7 +240,7 @@
},
{
"name": "keyword.other.typst",
- "match": "\\b(pub|let|set|rule|select|show|wrap|as|in|from)\\b"
+ "match": "\\b(pub|let|set|show|wrap|as|in|from)\\b"
},
{
"name": "keyword.control.conditional.typst",