Improvements to dart syntax highlighting

pull/2748/head
nrayburn 5 years ago
parent 5c9694ce6d
commit da4b0a6136

@ -178,14 +178,14 @@ export const language = <IMonarchLanguage>{
/[a-z_$][\w$]*/, /[a-z_$][\w$]*/,
{ {
cases: { cases: {
"@typeKeywords": "keyword", "@typeKeywords": "type.identifier",
"@keywords": "keyword", "@keywords": "keyword",
"@default": "identifier" "@default": "identifier"
} }
} }
], ],
[ [
/(?<![a-zA-Z0-9_$])([_$]*[A-Z][a-zA-Z0-9_$]*|bool\\b|num\\b|int\\b|double\\b|dynamic\\b)/, /(?<![a-zA-Z0-9_$])([_$]*[A-Z][a-zA-Z0-9_$]*)/,
"type.identifier" "type.identifier"
], // to show class names nicely ], // to show class names nicely
// [/[A-Z][\w\$]*/, 'identifier'], // [/[A-Z][\w\$]*/, 'identifier'],
@ -232,8 +232,7 @@ export const language = <IMonarchLanguage>{
[/"([^"\\]|\\.)*$/, "string.invalid"], // non-teminated string [/"([^"\\]|\\.)*$/, "string.invalid"], // non-teminated string
[/'([^'\\]|\\.)*$/, "string.invalid"], // non-teminated string [/'([^'\\]|\\.)*$/, "string.invalid"], // non-teminated string
[/"/, "string", "@string_double"], [/"/, "string", "@string_double"],
[/'/, "string", "@string_single"], [/'/, "string", "@string_single"]
[/`/, "string", "@string_backtick"]
// [/[a-zA-Z]+/, "variable"] // [/[a-zA-Z]+/, "variable"]
], ],
@ -242,6 +241,7 @@ export const language = <IMonarchLanguage>{
[/[ \t\r\n]+/, ""], [/[ \t\r\n]+/, ""],
[/\/\*\*(?!\/)/, "comment.doc", "@jsdoc"], [/\/\*\*(?!\/)/, "comment.doc", "@jsdoc"],
[/\/\*/, "comment", "@comment"], [/\/\*/, "comment", "@comment"],
[/\/\/\/.*$/, "comment.doc"],
[/\/\/.*$/, "comment"] [/\/\/.*$/, "comment"]
], ],
@ -308,32 +308,19 @@ export const language = <IMonarchLanguage>{
], ],
string_double: [ string_double: [
[/\$\{/, { token: "delimiter.bracket", next: "@bracketCounting" }], [/[^\\"\$]+/, "string"], [/[^\\"]+/, "string"],
[/[^\\"]+/, "string"],
[/@escapes/, "string.escape"], [/@escapes/, "string.escape"],
[/\\./, "string.escape.invalid"], [/\\./, "string.escape.invalid"],
[/"/, "string", "@pop"] [/"/, "string", "@pop"],
[/\$\w+/, 'identifier']
], ],
string_single: [ string_single: [
[/[^\\']+/, "string"], [/[^\\'\$]+/, "string"],
[/@escapes/, "string.escape"], [/@escapes/, "string.escape"],
[/\\./, "string.escape.invalid"], [/\\./, "string.escape.invalid"],
[/'/, "string", "@pop"] [/'/, "string", "@pop"],
[/\$\w+/, 'identifier']
], ],
string_backtick: [
[/\$\{/, { token: "delimiter.bracket", next: "@bracketCounting" }],
[/[^\\`$]+/, "string"],
[/@escapes/, "string.escape"],
[/\\./, "string.escape.invalid"],
[/`/, "string", "@pop"]
],
bracketCounting: [
[/\{/, "delimiter.bracket", "@bracketCounting"],
[/\}/, "delimiter.bracket", "@pop"],
{ include: "common" }
]
} }
}; };

Loading…
Cancel
Save