fix rust raw string highlighting #2552

pull/2748/head
nreed 2021-07-14 12:38:06 -04:00
parent 96183b6e44
commit 075be30f2c
1 changed files with 6 additions and 0 deletions

View File

@ -270,6 +270,8 @@ export const language = <languages.IMonarchLanguage>{
tokenizer: {
root: [
// Raw string literals
[/r(?=#*")/, { token: 'string.raw', bracket: '@open', next: '@stringraw' }],
[
/[a-zA-Z][a-zA-Z0-9_]*!?|_[a-zA-Z0-9_]+/,
{
@ -327,6 +329,10 @@ export const language = <languages.IMonarchLanguage>{
[/\\./, 'string.escape.invalid'],
[/"/, { token: 'string.quote', bracket: '@close', next: '@pop' }]
],
stringraw: [
[/[^#"]/, 'string.raw'],
[/(#*)".*?"\1/, { token: 'string.raw', bracket: '@close', next: '@pop' }]
],
numbers: [
//Octal
[/(0o[0-7_]+)(@intSuffixes)?/, { token: 'number' }],