Skip to content
This repository has been archived by the owner on Nov 5, 2021. It is now read-only.

Commit

Permalink
fix rust raw string highlighting #2552
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanrreed committed Jul 14, 2021
1 parent 96183b6 commit 075be30
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/rust/rust.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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_]+/,
{
Expand Down Expand Up @@ -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' }],
Expand Down

0 comments on commit 075be30

Please sign in to comment.