From c2335d0cb2aee42ae70e94c005cdb5d2ae418cd1 Mon Sep 17 00:00:00 2001 From: Dusty Pomerleau Date: Fri, 16 Oct 2020 11:08:59 +1100 Subject: fix: prevent early termination of raw strings with hash --- editors/code/rust.tmGrammar.json | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/editors/code/rust.tmGrammar.json b/editors/code/rust.tmGrammar.json index 3ddd14f9c..66c8843f4 100644 --- a/editors/code/rust.tmGrammar.json +++ b/editors/code/rust.tmGrammar.json @@ -966,9 +966,28 @@ ] }, { - "comment": "double-quoted raw strings and raw byte strings", + "comment": "double-quoted raw strings and raw byte strings (no hash)", "name": "string.quoted.double.rust", - "begin": "(b?r)(#*)(\")", + "begin": "(b?r)(\")", + "beginCaptures": { + "1": { + "name": "string.quoted.byte.raw.rust" + }, + "2": { + "name": "punctuation.definition.string.rust" + } + }, + "end": "\"", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.rust" + } + } + }, + { + "comment": "double-quoted raw strings and raw byte strings (with hash)", + "name": "string.quoted.double.rust", + "begin": "(b?r)(#+)(\")", "beginCaptures": { "1": { "name": "string.quoted.byte.raw.rust" @@ -980,7 +999,7 @@ "name": "punctuation.definition.string.rust" } }, - "end": "(\")(#*)", + "end": "(\")(#+)", "endCaptures": { "1": { "name": "punctuation.definition.string.rust" -- cgit v1.2.3