Skip to content

Commit

Permalink
Fix bug with highlighting of C++ raw string literals (#4436)
Browse files Browse the repository at this point in the history
* Fix bug with highlighting of C++ raw string literals

* Update to today's monaco-editor-core

* Continue generating `string.raw.end` tokens

---------

Co-authored-by: Alex Dima <[email protected]>
  • Loading branch information
jeremy-rifkin and alexdima authored Mar 20, 2024
1 parent c92a363 commit 92f21bf
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 23 deletions.
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"jsdom": "^19.0.0",
"jsonc-parser": "^3.0.0",
"mocha": "^9.2.0",
"monaco-editor-core": "0.48.0-dev-20240319",
"monaco-editor-core": "0.48.0-dev-20240320",
"parcel": "^2.7.0",
"pin-github-action": "^1.8.0",
"playwright": "^1.32.2",
Expand Down
18 changes: 3 additions & 15 deletions src/basic-languages/cpp/cpp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -378,21 +378,9 @@ export const language = <languages.IMonarchLanguage>{
],

raw: [
[
/(.*)(\))(?:([^ ()\\\t"]*))(\")/,
{
cases: {
'$3==$S2': [
'string.raw',
'string.raw.end',
'string.raw.end',
{ token: 'string.raw.end', next: '@pop' }
],
'@default': ['string.raw', 'string.raw', 'string.raw', 'string.raw']
}
}
],
[/.*/, 'string.raw']
[/[^)]+/, 'string.raw'],
[/\)$S2\"/, { token: 'string.raw.end', next: '@pop' }],
[/\)/, 'string.raw']
],

annotation: [
Expand Down

0 comments on commit 92f21bf

Please sign in to comment.