Fixes microsoft/monaco-editor#2424: Escape consecutive @@

This commit is contained in:
Alex Dima 2021-05-12 17:47:22 +02:00
parent 90417ad4ff
commit d78c032a75
No known key found for this signature in database
GPG key ID: 6E58D7B045760DA0
4 changed files with 5 additions and 5 deletions

View file

@ -404,7 +404,7 @@ export const language = <languages.IMonarchLanguage>{
[/\$\w+/, 'key'],
[/\$\(/, 'key', '@paste'],
[/@@ident/, 'annotation'],
[/@@@ident/, 'annotation'],
// whitespace
{ include: '@whitespace' },

View file

@ -81,7 +81,7 @@ export const language = <languages.IMonarchLanguage>{
// The main tokenizer for our languages
tokenizer: {
root: [
[/@@/], // text
[/@@@@/], // text
[/@[^@]/, { token: '@rematch', switchTo: '@razorInSimpleState.root' }],
[/<!DOCTYPE/, 'metatag.html', '@doctype'],
[/<!--/, 'comment.html', '@comment'],

View file

@ -282,7 +282,7 @@ export const language = <languages.IMonarchLanguage>{
[/[A-Z][\w]*[!?=]?/, 'constructor.identifier'], // constant
[/\$[\w]*/, 'global.constant'], // global
[/@[\w]*/, 'namespace.instance.identifier'], // instance
[/@@[\w]*/, 'namespace.class.identifier'], // class
[/@@@[\w]*/, 'namespace.class.identifier'], // class
// here document
[/<<[-~](@heredelim).*/, { token: 'string.heredoc.delimiter', next: '@heredoc.$1' }],
@ -444,7 +444,7 @@ export const language = <languages.IMonarchLanguage>{
interpolated: [
[/\$\w*/, 'global.constant', '@pop'],
[/@\w*/, 'namespace.class.identifier', '@pop'],
[/@@\w*/, 'namespace.instance.identifier', '@pop'],
[/@@@\w*/, 'namespace.instance.identifier', '@pop'],
[
/[{]/,
{

View file

@ -200,7 +200,7 @@ export const language = <languages.IMonarchLanguage>{
attribute: [
[
/\@@identifier/,
/@@@identifier/,
{
cases: {
'@attributes': 'keyword.control',