From ee0e0a7846b48ac564d984a01d71900f883842ef Mon Sep 17 00:00:00 2001 From: Sabee Date: Wed, 12 Feb 2020 08:40:51 +0100 Subject: [PATCH 1/3] basic dart syntax support (#1827) --- src/dart/dart.contribution.ts | 15 ++ src/dart/dart.test.ts | 9 + src/dart/dart.ts | 339 ++++++++++++++++++++++++++++++++++ src/monaco.contribution.ts | 1 + 4 files changed, 364 insertions(+) create mode 100644 src/dart/dart.contribution.ts create mode 100644 src/dart/dart.test.ts create mode 100644 src/dart/dart.ts diff --git a/src/dart/dart.contribution.ts b/src/dart/dart.contribution.ts new file mode 100644 index 00000000..cdc287ce --- /dev/null +++ b/src/dart/dart.contribution.ts @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +'use strict'; + +import { registerLanguage } from '../_.contribution'; + +registerLanguage({ + id: 'dart', + extensions: ['.dart'], + aliases: ['Dart', 'dart'], + mimetypes: ['text/x-dart-source', 'text/x-dart'], + loader: () => import('./dart') +}); diff --git a/src/dart/dart.test.ts b/src/dart/dart.test.ts new file mode 100644 index 00000000..c58bd06e --- /dev/null +++ b/src/dart/dart.test.ts @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +"use strict"; + +import { testTokenization } from "../test/testRunner"; + +testTokenization("dart", []); diff --git a/src/dart/dart.ts b/src/dart/dart.ts new file mode 100644 index 00000000..cfa25050 --- /dev/null +++ b/src/dart/dart.ts @@ -0,0 +1,339 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +"use strict"; + +import LanguageConfiguration = monaco.languages.LanguageConfiguration; +import IMonarchLanguage = monaco.languages.IMonarchLanguage; + +export const conf: LanguageConfiguration = { + comments: { + lineComment: "//", + blockComment: ["/*", "*/"] + }, + brackets: [ + ["{", "}"], + ["[", "]"], + ["(", ")"] + ], + autoClosingPairs: [ + { open: "{", close: "}" }, + { open: "[", close: "]" }, + { open: "(", close: ")" }, + { open: "'", close: "'", notIn: ["string", "comment"] }, + { open: '"', close: '"', notIn: ["string"] }, + { open: "`", close: "`", notIn: ["string", "comment"] }, + { open: "/**", close: " */", notIn: ["string"] } + ], + surroundingPairs: [ + { open: "{", close: "}" }, + { open: "[", close: "]" }, + { open: "(", close: ")" }, + + { open: "<", close: ">" }, + { open: "'", close: "'" }, + { open: "(", close: ")" }, + { open: '"', close: '"' }, + { open: "`", close: "`" } + ], + folding: { + markers: { + start: /^\s*\s*#?region\b/, + end: /^\s*\s*#?endregion\b/ + } + } +}; + +export const language = { + defaultToken: "invalid", + tokenPostfix: ".dart", + + keywords: [ + "abstract", + "dynamic", + "implements", + "show", + "as", + "else", + "import", + "static", + "assert", + "enum", + "in", + "super", + "async", + "export", + "interface", + "switch", + "await", + "extends", + "is", + "sync", + "break", + "external", + "library", + "this", + "case", + "factory", + "mixin", + "throw", + "catch", + "false", + "new", + "true", + "class", + "final", + "null", + "try", + "const", + "finally", + "on", + "typedef", + "continue", + "for", + "operator", + "var", + "covariant", + "Function", + "part", + "void", + "default", + "get", + "rethrow", + "while", + "deferred", + "hide", + "return", + "with", + "do", + "if", + "set", + "yield" + ], + typeKeywords: ["int", "double", "String", "bool"], + + operators: [ + "+", + "-", + "*", + "/", + "~/", + "%", + "++", + "--", + "==", + "!=", + ">", + "<", + ">=", + "<=", + "=", + "-=", + "/=", + "%=", + ">>=", + "^=", + "+=", + "*=", + "~/=", + "<<=", + "&=", + "!=", + "||", + "&&", + "&", + "|", + "^", + "~", + "<<", + ">>", + "!", + ">>>", + "??", + "?", + ":", + "|=" + ], + + // we include these common regular expressions + symbols: /[=>](?!@symbols)/, "@brackets"], + [/!(?=([^=]|$))/, "delimiter"], + [ + /@symbols/, + { + cases: { + "@operators": "delimiter", + "@default": "" + } + } + ], + + // numbers + [/(@digits)[eE]([\-+]?(@digits))?/, "number.float"], + [/(@digits)\.(@digits)([eE][\-+]?(@digits))?/, "number.float"], + [/0[xX](@hexdigits)n?/, "number.hex"], + [/0[oO]?(@octaldigits)n?/, "number.octal"], + [/0[bB](@binarydigits)n?/, "number.binary"], + [/(@digits)n?/, "number"], + + // delimiter: after number because of .\d floats + [/[;,.]/, "delimiter"], + + // strings + [/"([^"\\]|\\.)*$/, "string.invalid"], // non-teminated string + [/'([^'\\]|\\.)*$/, "string.invalid"], // non-teminated string + [/"/, "string", "@string_double"], + [/'/, "string", "@string_single"], + [/`/, "string", "@string_backtick"] + + // [/[a-zA-Z]+/, "variable"] + ], + + whitespace: [ + [/[ \t\r\n]+/, ""], + [/\/\*\*(?!\/)/, "comment.doc", "@jsdoc"], + [/\/\*/, "comment", "@comment"], + [/\/\/.*$/, "comment"] + ], + + comment: [ + [/[^\/*]+/, "comment"], + [/\*\//, "comment", "@pop"], + [/[\/*]/, "comment"] + ], + + jsdoc: [ + [/[^\/*]+/, "comment.doc"], + [/\*\//, "comment.doc", "@pop"], + [/[\/*]/, "comment.doc"] + ], + + // We match regular expression quite precisely + regexp: [ + [ + /(\{)(\d+(?:,\d*)?)(\})/, + [ + "regexp.escape.control", + "regexp.escape.control", + "regexp.escape.control" + ] + ], + [ + /(\[)(\^?)(?=(?:[^\]\\\/]|\\.)+)/, + [ + "regexp.escape.control", + { token: "regexp.escape.control", next: "@regexrange" } + ] + ], + [ + /(\()(\?:|\?=|\?!)/, + ["regexp.escape.control", "regexp.escape.control"] + ], + [/[()]/, "regexp.escape.control"], + [/@regexpctl/, "regexp.escape.control"], + [/[^\\\/]/, "regexp"], + [/@regexpesc/, "regexp.escape"], + [/\\\./, "regexp.invalid"], + [ + /(\/)([gimsuy]*)/, + [ + { token: "regexp", bracket: "@close", next: "@pop" }, + "keyword.other" + ] + ] + ], + + regexrange: [ + [/-/, "regexp.escape.control"], + [/\^/, "regexp.invalid"], + [/@regexpesc/, "regexp.escape"], + [/[^\]]/, "regexp"], + [ + /\]/, + { + token: "regexp.escape.control", + next: "@pop", + bracket: "@close" + } + ] + ], + + string_double: [ + [/\$\{/, { token: "delimiter.bracket", next: "@bracketCounting" }], + [/[^\\"]+/, "string"], + [/@escapes/, "string.escape"], + [/\\./, "string.escape.invalid"], + [/"/, "string", "@pop"] + ], + + string_single: [ + [/[^\\']+/, "string"], + [/@escapes/, "string.escape"], + [/\\./, "string.escape.invalid"], + [/'/, "string", "@pop"] + ], + + 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" } + ] + } +}; diff --git a/src/monaco.contribution.ts b/src/monaco.contribution.ts index 95c20044..ffb91ce7 100644 --- a/src/monaco.contribution.ts +++ b/src/monaco.contribution.ts @@ -15,6 +15,7 @@ import './cpp/cpp.contribution'; import './csharp/csharp.contribution'; import './csp/csp.contribution'; import './css/css.contribution'; +import './dart/dart.contribution'; import './dockerfile/dockerfile.contribution'; import './fsharp/fsharp.contribution'; import './go/go.contribution'; From da4b0a613674d663c882f87402d9221b9c2747e4 Mon Sep 17 00:00:00 2001 From: nrayburn Date: Fri, 14 Feb 2020 15:01:42 -0600 Subject: [PATCH 2/3] Improvements to dart syntax highlighting --- src/dart/dart.ts | 33 ++++++++++----------------------- 1 file changed, 10 insertions(+), 23 deletions(-) diff --git a/src/dart/dart.ts b/src/dart/dart.ts index cfa25050..10b2166f 100644 --- a/src/dart/dart.ts +++ b/src/dart/dart.ts @@ -178,14 +178,14 @@ export const language = { /[a-z_$][\w$]*/, { cases: { - "@typeKeywords": "keyword", + "@typeKeywords": "type.identifier", "@keywords": "keyword", "@default": "identifier" } } ], [ - /(?{ [/"([^"\\]|\\.)*$/, "string.invalid"], // non-teminated string [/'([^'\\]|\\.)*$/, "string.invalid"], // non-teminated string [/"/, "string", "@string_double"], - [/'/, "string", "@string_single"], - [/`/, "string", "@string_backtick"] + [/'/, "string", "@string_single"] // [/[a-zA-Z]+/, "variable"] ], @@ -242,6 +241,7 @@ export const language = { [/[ \t\r\n]+/, ""], [/\/\*\*(?!\/)/, "comment.doc", "@jsdoc"], [/\/\*/, "comment", "@comment"], + [/\/\/\/.*$/, "comment.doc"], [/\/\/.*$/, "comment"] ], @@ -308,32 +308,19 @@ export const language = { ], string_double: [ - [/\$\{/, { token: "delimiter.bracket", next: "@bracketCounting" }], - [/[^\\"]+/, "string"], + [/[^\\"\$]+/, "string"], [/[^\\"]+/, "string"], [/@escapes/, "string.escape"], [/\\./, "string.escape.invalid"], - [/"/, "string", "@pop"] + [/"/, "string", "@pop"], + [/\$\w+/, 'identifier'] ], string_single: [ - [/[^\\']+/, "string"], + [/[^\\'\$]+/, "string"], [/@escapes/, "string.escape"], [/\\./, "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" } - ] } }; From 609014d4e6ae67ac1a69eac847d6b9df57e23688 Mon Sep 17 00:00:00 2001 From: Sabee Date: Mon, 24 Feb 2020 10:10:52 +0100 Subject: [PATCH 3/3] dart - test tokenization --- src/dart/dart.test.ts | 552 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 551 insertions(+), 1 deletion(-) diff --git a/src/dart/dart.test.ts b/src/dart/dart.test.ts index c58bd06e..dfe6a5f6 100644 --- a/src/dart/dart.test.ts +++ b/src/dart/dart.test.ts @@ -6,4 +6,554 @@ import { testTokenization } from "../test/testRunner"; -testTokenization("dart", []); +testTokenization("dart", [ + // Comments - single line + [ + { + line: "//", + tokens: [{ startIndex: 0, type: "comment.dart" }] + } + ], + + [ + { + line: " // a comment", + tokens: [ + { startIndex: 0, type: "" }, + { startIndex: 4, type: "comment.dart" } + ] + } + ], + + // Broken nested tokens due to invalid comment tokenization + [ + { + line: "/* //*/ a", + tokens: [ + { startIndex: 0, type: "comment.dart" }, + { startIndex: 7, type: "" }, + { startIndex: 8, type: "identifier.dart" } + ] + } + ], + + [ + { + line: "// a comment", + tokens: [{ startIndex: 0, type: "comment.dart" }] + } + ], + + [ + { + line: "//sticky comment", + tokens: [{ startIndex: 0, type: "comment.dart" }] + } + ], + + [ + { + line: "/almost a comment", + tokens: [ + { startIndex: 0, type: "delimiter.dart" }, + { startIndex: 1, type: "identifier.dart" }, + { startIndex: 7, type: "" }, + { startIndex: 8, type: "identifier.dart" }, + { startIndex: 9, type: "" }, + { startIndex: 10, type: "identifier.dart" } + ] + } + ], + + [ + { + line: "1 / 2; /* comment", + tokens: [ + { startIndex: 0, type: "number.dart" }, + { startIndex: 1, type: "" }, + { startIndex: 2, type: "delimiter.dart" }, + { startIndex: 3, type: "" }, + { startIndex: 4, type: "number.dart" }, + { startIndex: 5, type: "delimiter.dart" }, + { startIndex: 6, type: "" }, + { startIndex: 7, type: "comment.dart" } + ] + } + ], + + [ + { + line: "var x = 1; // my comment // is a nice one", + tokens: [ + { startIndex: 0, type: "keyword.dart" }, + { startIndex: 3, type: "" }, + { startIndex: 4, type: "identifier.dart" }, + { startIndex: 5, type: "" }, + { startIndex: 6, type: "delimiter.dart" }, + { startIndex: 7, type: "" }, + { startIndex: 8, type: "number.dart" }, + { startIndex: 9, type: "delimiter.dart" }, + { startIndex: 10, type: "" }, + { startIndex: 11, type: "comment.dart" } + ] + } + ], + + // Comments - range comment, single line + [ + { + line: "/* a simple comment */", + tokens: [{ startIndex: 0, type: "comment.dart" }] + } + ], + + [ + { + line: "var x = /* a simple comment */ 1;", + tokens: [ + { startIndex: 0, type: "keyword.dart" }, + { startIndex: 3, type: "" }, + { startIndex: 4, type: "identifier.dart" }, + { startIndex: 5, type: "" }, + { startIndex: 6, type: "delimiter.dart" }, + { startIndex: 7, type: "" }, + { startIndex: 8, type: "comment.dart" }, + { startIndex: 30, type: "" }, + { startIndex: 31, type: "number.dart" }, + { startIndex: 32, type: "delimiter.dart" } + ] + } + ], + + [ + { + line: "var x = /* comment */ 1; */", + tokens: [ + { startIndex: 0, type: "keyword.dart" }, + { startIndex: 3, type: "" }, + { startIndex: 4, type: "identifier.dart" }, + { startIndex: 5, type: "" }, + { startIndex: 6, type: "delimiter.dart" }, + { startIndex: 7, type: "" }, + { startIndex: 8, type: "comment.dart" }, + { startIndex: 21, type: "" }, + { startIndex: 22, type: "number.dart" }, + { startIndex: 23, type: "delimiter.dart" }, + { startIndex: 24, type: "" } + ] + } + ], + + [ + { + line: "x = /**/;", + tokens: [ + { startIndex: 0, type: "identifier.dart" }, + { startIndex: 1, type: "" }, + { startIndex: 2, type: "delimiter.dart" }, + { startIndex: 3, type: "" }, + { startIndex: 4, type: "comment.dart" }, + { startIndex: 8, type: "delimiter.dart" } + ] + } + ], + + [ + { + line: "x = /*/;", + tokens: [ + { startIndex: 0, type: "identifier.dart" }, + { startIndex: 1, type: "" }, + { startIndex: 2, type: "delimiter.dart" }, + { startIndex: 3, type: "" }, + { startIndex: 4, type: "comment.dart" } + ] + } + ], + + // Comments - range comment, multiple lines + [ + { + line: "/* start of multiline comment", + tokens: [{ startIndex: 0, type: "comment.dart" }] + }, + { + line: "a comment between without a star", + tokens: [{ startIndex: 0, type: "comment.dart" }] + }, + { + line: "end of multiline comment*/", + tokens: [{ startIndex: 0, type: "comment.dart" }] + } + ], + + [ + { + line: "var x = /* start a comment", + tokens: [ + { startIndex: 0, type: "keyword.dart" }, + { startIndex: 3, type: "" }, + { startIndex: 4, type: "identifier.dart" }, + { startIndex: 5, type: "" }, + { startIndex: 6, type: "delimiter.dart" }, + { startIndex: 7, type: "" }, + { startIndex: 8, type: "comment.dart" } + ] + }, + { + line: " a ", + tokens: [{ startIndex: 0, type: "comment.dart" }] + }, + { + line: "and end it */ 2;", + tokens: [ + { startIndex: 0, type: "comment.dart" }, + { startIndex: 13, type: "" }, + { startIndex: 14, type: "number.dart" }, + { startIndex: 15, type: "delimiter.dart" } + ] + } + ], + + // Keywords + [ + { + line: "var x = function() { };", + tokens: [ + { startIndex: 0, type: "keyword.dart" }, + { startIndex: 3, type: "" }, + { startIndex: 4, type: "identifier.dart" }, + { startIndex: 5, type: "" }, + { startIndex: 6, type: "delimiter.dart" }, + { startIndex: 7, type: "" }, + { startIndex: 8, type: "identifier.dart" }, + { startIndex: 16, type: "delimiter.parenthesis.dart" }, + { startIndex: 18, type: "" }, + { startIndex: 19, type: "delimiter.bracket.dart" }, + { startIndex: 20, type: "" }, + { startIndex: 21, type: "delimiter.bracket.dart" }, + { startIndex: 22, type: "delimiter.dart" } + ] + } + ], + + [ + { + line: " var ", + tokens: [ + { startIndex: 0, type: "" }, + { startIndex: 4, type: "keyword.dart" }, + { startIndex: 7, type: "" } + ] + } + ], + + // Numbers + [ + { + line: "0", + tokens: [{ startIndex: 0, type: "number.dart" }] + } + ], + + [ + { + line: "0.10", + tokens: [{ startIndex: 0, type: "number.float.dart" }] + } + ], + + [ + { + line: "0x", + tokens: [ + { startIndex: 0, type: "number.dart" }, + { startIndex: 1, type: "identifier.dart" } + ] + } + ], + + [ + { + line: "0x123", + tokens: [{ startIndex: 0, type: "number.hex.dart" }] + } + ], + + [ + { + line: "0x5_2", + tokens: [{ startIndex: 0, type: "number.hex.dart" }] + } + ], + [ + { + line: "0b1010_0101", + tokens: [{ startIndex: 0, type: "number.binary.dart" }] + } + ], + + [ + { + line: "0B001", + tokens: [{ startIndex: 0, type: "number.binary.dart" }] + } + ], + + [ + { + line: "10e3", + tokens: [{ startIndex: 0, type: "number.float.dart" }] + } + ], + [ + { + line: "23.5", + tokens: [{ startIndex: 0, type: "number.float.dart" }] + } + ], + + [ + { + line: "23.5e3", + tokens: [{ startIndex: 0, type: "number.float.dart" }] + } + ], + + [ + { + line: "23.5e-3", + tokens: [{ startIndex: 0, type: "number.float.dart" }] + } + ], + + [ + { + line: "23.5E3", + tokens: [{ startIndex: 0, type: "number.float.dart" }] + } + ], + + [ + { + line: "23.5E-3", + tokens: [{ startIndex: 0, type: "number.float.dart" }] + } + ], + + [ + { + line: "0_52", + tokens: [{ startIndex: 0, type: "number.dart" }] + } + ], + + [ + { + line: "5_2", + tokens: [{ startIndex: 0, type: "number.dart" }] + } + ], + + [ + { + line: "5_______2", + tokens: [{ startIndex: 0, type: "number.dart" }] + } + ], + [ + { + line: "3._1415F", + tokens: [ + { startIndex: 0, type: "number.dart" }, + { startIndex: 1, type: "delimiter.dart" }, + { startIndex: 2, type: "identifier.dart" } + ] + } + ], + + [ + { + line: "999_99_9999_L", + tokens: [ + { startIndex: 0, type: "number.dart" }, + { startIndex: 11, type: "identifier.dart" } + ] + } + ], + + [ + { + line: "52_", + tokens: [ + { startIndex: 0, type: "number.dart" }, + { startIndex: 2, type: "identifier.dart" } + ] + } + ], + + [ + { + line: "0_x52", + tokens: [ + { startIndex: 0, type: "number.dart" }, + { startIndex: 1, type: "identifier.dart" } + ] + } + ], + + [ + { + line: "0x_52", + tokens: [ + { startIndex: 0, type: "number.dart" }, + { startIndex: 1, type: "identifier.dart" } + ] + } + ], + + [ + { + line: "0x52_", + tokens: [ + { startIndex: 0, type: "number.hex.dart" }, + { startIndex: 4, type: "identifier.dart" } + ] + } + ], + + [ + { + line: "052_", + tokens: [ + { startIndex: 0, type: "number.octal.dart" }, + { startIndex: 3, type: "identifier.dart" } + ] + } + ], + + [ + { + line: "23.5L", + tokens: [ + { startIndex: 0, type: "number.float.dart" }, + { startIndex: 4, type: "type.identifier.dart" } + ] + } + ], + + [ + { + line: "0+0", + tokens: [ + { startIndex: 0, type: "number.dart" }, + { startIndex: 1, type: "delimiter.dart" }, + { startIndex: 2, type: "number.dart" } + ] + } + ], + + [ + { + line: "100+10", + tokens: [ + { startIndex: 0, type: "number.dart" }, + { startIndex: 3, type: "delimiter.dart" }, + { startIndex: 4, type: "number.dart" } + ] + } + ], + + [ + { + line: "0 + 0", + tokens: [ + { startIndex: 0, type: "number.dart" }, + { startIndex: 1, type: "" }, + { startIndex: 2, type: "delimiter.dart" }, + { startIndex: 3, type: "" }, + { startIndex: 4, type: "number.dart" } + ] + } + ], + + // Strings + [ + { + line: "var s = 's';", + tokens: [ + { startIndex: 0, type: "keyword.dart" }, + { startIndex: 3, type: "" }, + { startIndex: 4, type: "identifier.dart" }, + { startIndex: 5, type: "" }, + { startIndex: 6, type: "delimiter.dart" }, + { startIndex: 7, type: "" }, + { startIndex: 8, type: "string.dart" }, + { startIndex: 11, type: "delimiter.dart" } + ] + } + ], + + [ + { + line: 'String s = "concatenated" + " String" ;', + tokens: [ + { startIndex: 0, type: "type.identifier.dart" }, + { startIndex: 6, type: "" }, + { startIndex: 7, type: "identifier.dart" }, + { startIndex: 8, type: "" }, + { startIndex: 9, type: "delimiter.dart" }, + { startIndex: 10, type: "" }, + { startIndex: 11, type: "string.dart" }, + { startIndex: 25, type: "" }, + { startIndex: 26, type: "delimiter.dart" }, + { startIndex: 27, type: "" }, + { startIndex: 28, type: "string.dart" }, + { startIndex: 37, type: "" }, + { startIndex: 38, type: "delimiter.dart" } + ] + } + ], + + [ + { + line: '"quote in a string"', + tokens: [{ startIndex: 0, type: "string.dart" }] + } + ], + + [ + { + line: '"escaping \\"quotes\\" is cool"', + tokens: [ + { startIndex: 0, type: "string.dart" }, + { startIndex: 10, type: "string.escape.dart" }, + { startIndex: 12, type: "string.dart" }, + { startIndex: 18, type: "string.escape.dart" }, + { startIndex: 20, type: "string.dart" } + ] + } + ], + + [ + { + line: '"\\"', + tokens: [{ startIndex: 0, type: "string.invalid.dart" }] + } + ], + + // Annotations + [ + { + line: "@", + tokens: [{ startIndex: 0, type: "invalid.dart" }] + } + ], + + [ + { + line: "@Override", + tokens: [{ startIndex: 0, type: "annotation.dart" }] + } + ] +]);