diff --git a/grammar.js b/grammar.js index 83187543c..e0b0e7aa1 100644 --- a/grammar.js +++ b/grammar.js @@ -375,6 +375,7 @@ module.exports = grammar({ $.operator, $.word, $.placeholder, + $.delimiter, $.block_comment, $._command, $.superscript, @@ -384,10 +385,12 @@ module.exports = grammar({ ), ), - word: $ => /[^\s\\%\{\},\$\[\]\(\)=\#_\^\-\+\/\*]+/, + word: $ => /[^\s\\%\{\},\$\[\]\(\)=\#&_\^\-\+\/\*]+/, placeholder: $ => /#\d/, + delimiter: $ => /&/, + path: $ => /[^\*\"\[\]:;,\|\{\}<>]+/, uri: $ => /[^\[\]\{\}]+/, diff --git a/src/grammar.json b/src/grammar.json index 89a46bb75..4d8853427 100644 --- a/src/grammar.json +++ b/src/grammar.json @@ -1641,6 +1641,10 @@ "type": "SYMBOL", "name": "placeholder" }, + { + "type": "SYMBOL", + "name": "delimiter" + }, { "type": "SYMBOL", "name": "block_comment" @@ -1664,12 +1668,16 @@ }, "word": { "type": "PATTERN", - "value": "[^\\s\\\\%\\{\\},\\$\\[\\]\\(\\)=\\#_\\^\\-\\+\\/\\*]+" + "value": "[^\\s\\\\%\\{\\},\\$\\[\\]\\(\\)=\\#&_\\^\\-\\+\\/\\*]+" }, "placeholder": { "type": "PATTERN", "value": "#\\d" }, + "delimiter": { + "type": "PATTERN", + "value": "&" + }, "path": { "type": "PATTERN", "value": "[^\\*\\\"\\[\\]:;,\\|\\{\\}<>]+" diff --git a/src/node-types.json b/src/node-types.json index 6b66bbd00..af4bd6640 100644 --- a/src/node-types.json +++ b/src/node-types.json @@ -7513,6 +7513,10 @@ "type": "color_set_definition", "named": true }, + { + "type": "delimiter", + "named": true + }, { "type": "environment_definition", "named": true @@ -9262,6 +9266,10 @@ "type": "comment", "named": true }, + { + "type": "delimiter", + "named": true + }, { "type": "letter", "named": true diff --git a/test/corpus/issues.txt b/test/corpus/issues.txt index 28c846f34..65988c3e0 100644 --- a/test/corpus/issues.txt +++ b/test/corpus/issues.txt @@ -477,7 +477,7 @@ Let (word)))) (text (word) - (word)) + (delimiter)) (text (word) (superscript @@ -493,7 +493,7 @@ Let (word)))) (text (word) - (word)) + (delimiter)) (text (word) (superscript