Skip to content

Commit c2335d0

Browse files
fix: prevent early termination of raw strings with hash
1 parent 0d45802 commit c2335d0

File tree

1 file changed

+22
-3
lines changed

1 file changed

+22
-3
lines changed

editors/code/rust.tmGrammar.json

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -966,9 +966,28 @@
966966
]
967967
},
968968
{
969-
"comment": "double-quoted raw strings and raw byte strings",
969+
"comment": "double-quoted raw strings and raw byte strings (no hash)",
970970
"name": "string.quoted.double.rust",
971-
"begin": "(b?r)(#*)(\")",
971+
"begin": "(b?r)(\")",
972+
"beginCaptures": {
973+
"1": {
974+
"name": "string.quoted.byte.raw.rust"
975+
},
976+
"2": {
977+
"name": "punctuation.definition.string.rust"
978+
}
979+
},
980+
"end": "\"",
981+
"endCaptures": {
982+
"0": {
983+
"name": "punctuation.definition.string.rust"
984+
}
985+
}
986+
},
987+
{
988+
"comment": "double-quoted raw strings and raw byte strings (with hash)",
989+
"name": "string.quoted.double.rust",
990+
"begin": "(b?r)(#+)(\")",
972991
"beginCaptures": {
973992
"1": {
974993
"name": "string.quoted.byte.raw.rust"
@@ -980,7 +999,7 @@
980999
"name": "punctuation.definition.string.rust"
9811000
}
9821001
},
983-
"end": "(\")(#*)",
1002+
"end": "(\")(#+)",
9841003
"endCaptures": {
9851004
"1": {
9861005
"name": "punctuation.definition.string.rust"

0 commit comments

Comments
 (0)