123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744 |
- /*---------------------------------------------------------------------------------------------
- * 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 './testRunner';
- testTokenization('csharp', [
- // Generated from sample
- [{
- line: 'using System;',
- tokens: [
- { startIndex: 0, type: 'keyword.using.cs' },
- { startIndex: 5, type: '' },
- { startIndex: 6, type: 'namespace.cs' },
- { startIndex: 12, type: 'delimiter.cs' }
- ]}, {
- line: 'using System.Collections.Generic;',
- tokens: [
- { startIndex: 0, type: 'keyword.using.cs' },
- { startIndex: 5, type: '' },
- { startIndex: 6, type: 'namespace.cs' },
- { startIndex: 12, type: 'delimiter.cs' },
- { startIndex: 13, type: 'namespace.cs' },
- { startIndex: 24, type: 'delimiter.cs' },
- { startIndex: 25, type: 'namespace.cs' },
- { startIndex: 32, type: 'delimiter.cs' }
- ]}, {
- line: 'using System.Diagnostics;',
- tokens: [
- { startIndex: 0, type: 'keyword.using.cs' },
- { startIndex: 5, type: '' },
- { startIndex: 6, type: 'namespace.cs' },
- { startIndex: 12, type: 'delimiter.cs' },
- { startIndex: 13, type: 'namespace.cs' },
- { startIndex: 24, type: 'delimiter.cs' }
- ]}, {
- line: 'using System.Linq;',
- tokens: [
- { startIndex: 0, type: 'keyword.using.cs' },
- { startIndex: 5, type: '' },
- { startIndex: 6, type: 'namespace.cs' },
- { startIndex: 12, type: 'delimiter.cs' },
- { startIndex: 13, type: 'namespace.cs' },
- { startIndex: 17, type: 'delimiter.cs' }
- ]}, {
- line: 'using System.Text;',
- tokens: [
- { startIndex: 0, type: 'keyword.using.cs' },
- { startIndex: 5, type: '' },
- { startIndex: 6, type: 'namespace.cs' },
- { startIndex: 12, type: 'delimiter.cs' },
- { startIndex: 13, type: 'namespace.cs' },
- { startIndex: 17, type: 'delimiter.cs' }
- ]}, {
- line: 'using System.Threading.Tasks;',
- tokens: [
- { startIndex: 0, type: 'keyword.using.cs' },
- { startIndex: 5, type: '' },
- { startIndex: 6, type: 'namespace.cs' },
- { startIndex: 12, type: 'delimiter.cs' },
- { startIndex: 13, type: 'namespace.cs' },
- { startIndex: 22, type: 'delimiter.cs' },
- { startIndex: 23, type: 'namespace.cs' },
- { startIndex: 28, type: 'delimiter.cs' }
- ]}, {
- line: '',
- tokens: [
- ]}, {
- line: 'namespace VS',
- tokens: [
- { startIndex: 0, type: 'keyword.namespace.cs' },
- { startIndex: 9, type: '' },
- { startIndex: 10, type: 'namespace.cs' }
- ]}, {
- line: '{',
- tokens: [
- { startIndex: 0, type: 'delimiter.curly.cs' }
- ]}, {
- line: ' class Program',
- tokens: [
- { startIndex: 0, type: '' },
- { startIndex: 1, type: 'keyword.class.cs' },
- { startIndex: 6, type: '' },
- { startIndex: 7, type: 'identifier.cs' }
- ]}, {
- line: ' {',
- tokens: [
- { startIndex: 0, type: '' },
- { startIndex: 1, type: 'delimiter.curly.cs' }
- ]}, {
- line: ' static void Main(string[] args)',
- tokens: [
- { startIndex: 0, type: '' },
- { startIndex: 2, type: 'keyword.static.cs' },
- { startIndex: 8, type: '' },
- { startIndex: 9, type: 'keyword.void.cs' },
- { startIndex: 13, type: '' },
- { startIndex: 14, type: 'identifier.cs' },
- { startIndex: 18, type: 'delimiter.parenthesis.cs' },
- { startIndex: 19, type: 'keyword.string.cs' },
- { startIndex: 25, type: 'delimiter.square.cs' },
- { startIndex: 27, type: '' },
- { startIndex: 28, type: 'identifier.cs' },
- { startIndex: 32, type: 'delimiter.parenthesis.cs' }
- ]}, {
- line: ' {',
- tokens: [
- { startIndex: 0, type: '' },
- { startIndex: 2, type: 'delimiter.curly.cs' }
- ]}, {
- line: ' ProcessStartInfo si = new ProcessStartInfo();',
- tokens: [
- { startIndex: 0, type: '' },
- { startIndex: 3, type: 'identifier.cs' },
- { startIndex: 19, type: '' },
- { startIndex: 20, type: 'identifier.cs' },
- { startIndex: 22, type: '' },
- { startIndex: 23, type: 'delimiter.cs' },
- { startIndex: 24, type: '' },
- { startIndex: 25, type: 'keyword.new.cs' },
- { startIndex: 28, type: '' },
- { startIndex: 29, type: 'identifier.cs' },
- { startIndex: 45, type: 'delimiter.parenthesis.cs' },
- { startIndex: 47, type: 'delimiter.cs' }
- ]}, {
- line: ' float load= 3.2e02f;',
- tokens: [
- { startIndex: 0, type: '' },
- { startIndex: 3, type: 'keyword.float.cs' },
- { startIndex: 8, type: '' },
- { startIndex: 9, type: 'identifier.cs' },
- { startIndex: 13, type: 'delimiter.cs' },
- { startIndex: 14, type: '' },
- { startIndex: 15, type: 'number.float.cs' },
- { startIndex: 22, type: 'delimiter.cs' }
- ]}, {
- line: '',
- tokens: [
- ]}, {
- line: ' si.FileName = @"tools\\\\node.exe";',
- tokens: [
- { startIndex: 0, type: '' },
- { startIndex: 3, type: 'identifier.cs' },
- { startIndex: 5, type: 'delimiter.cs' },
- { startIndex: 6, type: 'identifier.cs' },
- { startIndex: 14, type: '' },
- { startIndex: 15, type: 'delimiter.cs' },
- { startIndex: 16, type: '' },
- { startIndex: 17, type: 'string.quote.cs' },
- { startIndex: 19, type: 'string.cs' },
- { startIndex: 34, type: 'string.quote.cs' },
- { startIndex: 35, type: 'delimiter.cs' }
- ]}, {
- line: ' si.Arguments = "tools\\\\simpl3server.js";',
- tokens: [
- { startIndex: 0, type: '' },
- { startIndex: 3, type: 'identifier.cs' },
- { startIndex: 5, type: 'delimiter.cs' },
- { startIndex: 6, type: 'identifier.cs' },
- { startIndex: 15, type: '' },
- { startIndex: 16, type: 'delimiter.cs' },
- { startIndex: 17, type: '' },
- { startIndex: 18, type: 'string.quote.cs' },
- { startIndex: 19, type: 'string.cs' },
- { startIndex: 24, type: 'string.escape.cs' },
- { startIndex: 26, type: 'string.cs' },
- { startIndex: 41, type: 'string.quote.cs' },
- { startIndex: 42, type: 'delimiter.cs' }
- ]}, {
- line: ' ',
- tokens: [
- { startIndex: 0, type: '' }
- ]}, {
- line: ' string someString = $"hello{outside+variable}the string again {{ escaped";',
- tokens: [
- { startIndex: 0, type: '' },
- { startIndex: 3, type: 'keyword.string.cs' },
- { startIndex: 9, type: '' },
- { startIndex: 10, type: 'identifier.cs' },
- { startIndex: 20, type: '' },
- { startIndex: 21, type: 'delimiter.cs' },
- { startIndex: 22, type: '' },
- { startIndex: 23, type: 'string.quote.cs' },
- { startIndex: 25, type: 'string.cs' },
- { startIndex: 30, type: 'string.quote.cs' },
- { startIndex: 31, type: 'identifier.cs' },
- { startIndex: 38, type: 'delimiter.cs' },
- { startIndex: 39, type: 'identifier.cs' },
- { startIndex: 47, type: 'string.quote.cs' },
- { startIndex: 48, type: 'string.cs' },
- { startIndex: 65, type: 'string.escape.cs' },
- { startIndex: 67, type: 'string.cs' },
- { startIndex: 75, type: 'string.quote.cs' },
- { startIndex: 76, type: 'delimiter.cs' }
- ]}, {
- line: ' var @string = 5;',
- tokens: [
- { startIndex: 0, type: '' },
- { startIndex: 3, type: 'keyword.var.cs' },
- { startIndex: 6, type: '' },
- { startIndex: 7, type: 'identifier.cs' },
- { startIndex: 14, type: '' },
- { startIndex: 15, type: 'delimiter.cs' },
- { startIndex: 16, type: '' },
- { startIndex: 17, type: 'number.cs' },
- { startIndex: 18, type: 'delimiter.cs' }
- ]}, {
- line: ' ',
- tokens: [
- { startIndex: 0, type: '' }
- ]}, {
- line: ' if (x == 4)',
- tokens: [
- { startIndex: 0, type: '' },
- { startIndex: 3, type: 'keyword.if.cs' },
- { startIndex: 5, type: '' },
- { startIndex: 6, type: 'delimiter.parenthesis.cs' },
- { startIndex: 7, type: 'identifier.cs' },
- { startIndex: 8, type: '' },
- { startIndex: 9, type: 'delimiter.cs' },
- { startIndex: 11, type: '' },
- { startIndex: 12, type: 'number.cs' },
- { startIndex: 13, type: 'delimiter.parenthesis.cs' }
- ]}, {
- line: ' {',
- tokens: [
- { startIndex: 0, type: '' },
- { startIndex: 3, type: 'delimiter.curly.cs' }
- ]}, {
- line: ' for (int i = 4; i<10; i++)',
- tokens: [
- { startIndex: 0, type: '' },
- { startIndex: 4, type: 'keyword.for.cs' },
- { startIndex: 7, type: '' },
- { startIndex: 8, type: 'delimiter.parenthesis.cs' },
- { startIndex: 9, type: 'keyword.int.cs' },
- { startIndex: 12, type: '' },
- { startIndex: 13, type: 'identifier.cs' },
- { startIndex: 14, type: '' },
- { startIndex: 15, type: 'delimiter.cs' },
- { startIndex: 16, type: '' },
- { startIndex: 17, type: 'number.cs' },
- { startIndex: 18, type: 'delimiter.cs' },
- { startIndex: 19, type: '' },
- { startIndex: 20, type: 'identifier.cs' },
- { startIndex: 21, type: 'delimiter.angle.cs' },
- { startIndex: 22, type: 'number.cs' },
- { startIndex: 24, type: 'delimiter.cs' },
- { startIndex: 25, type: '' },
- { startIndex: 26, type: 'identifier.cs' },
- { startIndex: 27, type: 'delimiter.cs' },
- { startIndex: 29, type: 'delimiter.parenthesis.cs' }
- ]}, {
- line: ' {',
- tokens: [
- { startIndex: 0, type: '' },
- { startIndex: 4, type: 'delimiter.curly.cs' }
- ]}, {
- line: ' var d = i;',
- tokens: [
- { startIndex: 0, type: '' },
- { startIndex: 5, type: 'keyword.var.cs' },
- { startIndex: 8, type: '' },
- { startIndex: 9, type: 'identifier.cs' },
- { startIndex: 10, type: '' },
- { startIndex: 11, type: 'delimiter.cs' },
- { startIndex: 12, type: '' },
- { startIndex: 13, type: 'identifier.cs' },
- { startIndex: 14, type: 'delimiter.cs' }
- ]}, {
- line: ' }',
- tokens: [
- { startIndex: 0, type: '' },
- { startIndex: 4, type: 'delimiter.curly.cs' }
- ]}, {
- line: ' }',
- tokens: [
- { startIndex: 0, type: '' },
- { startIndex: 3, type: 'delimiter.curly.cs' }
- ]}, {
- line: ' else',
- tokens: [
- { startIndex: 0, type: '' },
- { startIndex: 3, type: 'keyword.else.cs' }
- ]}, {
- line: ' {',
- tokens: [
- { startIndex: 0, type: '' },
- { startIndex: 3, type: 'delimiter.curly.cs' }
- ]}, {
- line: ' return;',
- tokens: [
- { startIndex: 0, type: '' },
- { startIndex: 4, type: 'keyword.return.cs' },
- { startIndex: 10, type: 'delimiter.cs' }
- ]}, {
- line: ' }',
- tokens: [
- { startIndex: 0, type: '' },
- { startIndex: 3, type: 'delimiter.curly.cs' }
- ]}, {
- line: ' ',
- tokens: [
- { startIndex: 0, type: '' }
- ]}, {
- line: '',
- tokens: [
- ]}, {
- line: ' Process.Start(si);',
- tokens: [
- { startIndex: 0, type: '' },
- { startIndex: 3, type: 'identifier.cs' },
- { startIndex: 10, type: 'delimiter.cs' },
- { startIndex: 11, type: 'identifier.cs' },
- { startIndex: 16, type: 'delimiter.parenthesis.cs' },
- { startIndex: 17, type: 'identifier.cs' },
- { startIndex: 19, type: 'delimiter.parenthesis.cs' },
- { startIndex: 20, type: 'delimiter.cs' }
- ]}, {
- line: ' }',
- tokens: [
- { startIndex: 0, type: '' },
- { startIndex: 2, type: 'delimiter.curly.cs' }
- ]}, {
- line: ' }',
- tokens: [
- { startIndex: 0, type: '' },
- { startIndex: 1, type: 'delimiter.curly.cs' }
- ]}, {
- line: '}',
- tokens: [
- { startIndex: 0, type: 'delimiter.curly.cs' }
- ]}, {
- line: '',
- tokens: [
- ]}, {
- line: '#pragma region /MapLayer/*Image* /// ',
- tokens: [
- { startIndex: 0, type: 'namespace.cpp.cs' }
- ]}, {
- line: 'namespace ShouldNotBeAComment {}',
- tokens: [
- { startIndex: 0, type: 'keyword.namespace.cs' },
- { startIndex: 9, type: '' },
- { startIndex: 10, type: 'namespace.cs' },
- { startIndex: 29, type: '' },
- { startIndex: 30, type: 'delimiter.curly.cs' }
- ]}, {
- line: '#pragma endregion Region_1',
- tokens: [
- { startIndex: 0, type: 'namespace.cpp.cs' }
- ]}],
- // Keywords
- [{
- line: 'namespace VS { class Program { static void Main(string[] args) {} } }',
- tokens: [
- { startIndex: 0, type: 'keyword.namespace.cs' },
- { startIndex: 9, type: '' },
- { startIndex: 10, type: 'namespace.cs' },
- { startIndex: 12, type: '' },
- { startIndex: 13, type: 'delimiter.curly.cs' },
- { startIndex: 14, type: '' },
- { startIndex: 15, type: 'keyword.class.cs' },
- { startIndex: 20, type: '' },
- { startIndex: 21, type: 'identifier.cs' },
- { startIndex: 28, type: '' },
- { startIndex: 29, type: 'delimiter.curly.cs' },
- { startIndex: 30, type: '' },
- { startIndex: 31, type: 'keyword.static.cs' },
- { startIndex: 37, type: '' },
- { startIndex: 38, type: 'keyword.void.cs' },
- { startIndex: 42, type: '' },
- { startIndex: 43, type: 'identifier.cs' },
- { startIndex: 47, type: 'delimiter.parenthesis.cs' },
- { startIndex: 48, type: 'keyword.string.cs' },
- { startIndex: 54, type: 'delimiter.square.cs' },
- { startIndex: 56, type: '' },
- { startIndex: 57, type: 'identifier.cs' },
- { startIndex: 61, type: 'delimiter.parenthesis.cs' },
- { startIndex: 62, type: '' },
- { startIndex: 63, type: 'delimiter.curly.cs' },
- { startIndex: 65, type: '' },
- { startIndex: 66, type: 'delimiter.curly.cs' },
- { startIndex: 67, type: '' },
- { startIndex: 68, type: 'delimiter.curly.cs' }
- ]}],
- // Comments - single line
- [{
- line: '//',
- tokens: [
- { startIndex: 0, type: 'comment.cs' }
- ]}],
- [{
- line: ' // a comment',
- tokens: [
- { startIndex: 0, type: '' },
- { startIndex: 4, type: 'comment.cs' }
- ]}],
- [{
- line: '// a comment',
- tokens: [
- { startIndex: 0, type: 'comment.cs' }
- ]}],
- [{
- line: '//sticky comment',
- tokens: [
- { startIndex: 0, type: 'comment.cs' }
- ]}],
- [{
- line: '/almost a comment',
- tokens: [
- { startIndex: 0, type: 'delimiter.cs' },
- { startIndex: 1, type: 'identifier.cs' },
- { startIndex: 7, type: '' },
- { startIndex: 8, type: 'identifier.cs' },
- { startIndex: 9, type: '' },
- { startIndex: 10, type: 'identifier.cs' }
- ]}],
- [{
- line: '1 / 2; /* comment',
- tokens: [
- { startIndex: 0, type: 'number.cs' },
- { startIndex: 1, type: '' },
- { startIndex: 2, type: 'delimiter.cs' },
- { startIndex: 3, type: '' },
- { startIndex: 4, type: 'number.cs' },
- { startIndex: 5, type: 'delimiter.cs' },
- { startIndex: 6, type: '' },
- { startIndex: 7, type: 'comment.cs' }
- ]}],
- [{
- line: 'var x = 1; // my comment // is a nice one',
- tokens: [
- { startIndex: 0, type: 'keyword.var.cs' },
- { startIndex: 3, type: '' },
- { startIndex: 4, type: 'identifier.cs' },
- { startIndex: 5, type: '' },
- { startIndex: 6, type: 'delimiter.cs' },
- { startIndex: 7, type: '' },
- { startIndex: 8, type: 'number.cs' },
- { startIndex: 9, type: 'delimiter.cs' },
- { startIndex: 10, type: '' },
- { startIndex: 11, type: 'comment.cs' }
- ]}],
- // Comments - range comment, single line
- [{
- line: '/* a simple comment */',
- tokens: [
- { startIndex: 0, type: 'comment.cs' }
- ]}],
- [{
- line: 'var x = /* a simple comment */ 1;',
- tokens: [
- { startIndex: 0, type: 'keyword.var.cs' },
- { startIndex: 3, type: '' },
- { startIndex: 4, type: 'identifier.cs' },
- { startIndex: 5, type: '' },
- { startIndex: 6, type: 'delimiter.cs' },
- { startIndex: 7, type: '' },
- { startIndex: 8, type: 'comment.cs' },
- { startIndex: 30, type: '' },
- { startIndex: 31, type: 'number.cs' },
- { startIndex: 32, type: 'delimiter.cs' }
- ]}],
- [{
- line: 'var x = /* comment */ 1; */',
- tokens: [
- { startIndex: 0, type: 'keyword.var.cs' },
- { startIndex: 3, type: '' },
- { startIndex: 4, type: 'identifier.cs' },
- { startIndex: 5, type: '' },
- { startIndex: 6, type: 'delimiter.cs' },
- { startIndex: 7, type: '' },
- { startIndex: 8, type: 'comment.cs' },
- { startIndex: 21, type: '' },
- { startIndex: 22, type: 'number.cs' },
- { startIndex: 23, type: 'delimiter.cs' },
- { startIndex: 24, type: '' }
- ]}],
- [{
- line: 'x = /**/;',
- tokens: [
- { startIndex: 0, type: 'identifier.cs' },
- { startIndex: 1, type: '' },
- { startIndex: 2, type: 'delimiter.cs' },
- { startIndex: 3, type: '' },
- { startIndex: 4, type: 'comment.cs' },
- { startIndex: 8, type: 'delimiter.cs' }
- ]}],
- [{
- line: 'x = /*/;',
- tokens: [
- { startIndex: 0, type: 'identifier.cs' },
- { startIndex: 1, type: '' },
- { startIndex: 2, type: 'delimiter.cs' },
- { startIndex: 3, type: '' },
- { startIndex: 4, type: 'comment.cs' }
- ]}],
- // Numbers
- [{
- line: '0',
- tokens: [
- { startIndex: 0, type: 'number.cs' }
- ]}],
- [{
- line: '0x',
- tokens: [
- { startIndex: 0, type: 'number.cs' },
- { startIndex: 1, type: 'identifier.cs' }
- ]}],
- [{
- line: '0x123',
- tokens: [
- { startIndex: 0, type: 'number.hex.cs' }
- ]}],
- [{
- line: '23.5',
- tokens: [
- { startIndex: 0, type: 'number.float.cs' }
- ]}],
- [{
- line: '23.5e3',
- tokens: [
- { startIndex: 0, type: 'number.float.cs' }
- ]}],
- [{
- line: '23.5E3',
- tokens: [
- { startIndex: 0, type: 'number.float.cs' }
- ]}],
- [{
- line: '23.5F',
- tokens: [
- { startIndex: 0, type: 'number.float.cs' }
- ]}],
- [{
- line: '23.5f',
- tokens: [
- { startIndex: 0, type: 'number.float.cs' }
- ]}],
- [{
- line: '1.72E3F',
- tokens: [
- { startIndex: 0, type: 'number.float.cs' }
- ]}],
- [{
- line: '1.72E3f',
- tokens: [
- { startIndex: 0, type: 'number.float.cs' }
- ]}],
- [{
- line: '1.72e3F',
- tokens: [
- { startIndex: 0, type: 'number.float.cs' }
- ]}],
- [{
- line: '1.72e3f',
- tokens: [
- { startIndex: 0, type: 'number.float.cs' }
- ]}],
- [{
- line: '23.5D',
- tokens: [
- { startIndex: 0, type: 'number.float.cs' }
- ]}],
- [{
- line: '23.5d',
- tokens: [
- { startIndex: 0, type: 'number.float.cs' }
- ]}],
- [{
- line: '1.72E3D',
- tokens: [
- { startIndex: 0, type: 'number.float.cs' }
- ]}],
- [{
- line: '1.72E3d',
- tokens: [
- { startIndex: 0, type: 'number.float.cs' }
- ]}],
- [{
- line: '1.72e3D',
- tokens: [
- { startIndex: 0, type: 'number.float.cs' }
- ]}],
- [{
- line: '1.72e3d',
- tokens: [
- { startIndex: 0, type: 'number.float.cs' }
- ]}],
- [{
- line: '0+0',
- tokens: [
- { startIndex: 0, type: 'number.cs' },
- { startIndex: 1, type: 'delimiter.cs' },
- { startIndex: 2, type: 'number.cs' }
- ]}],
- [{
- line: '100+10',
- tokens: [
- { startIndex: 0, type: 'number.cs' },
- { startIndex: 3, type: 'delimiter.cs' },
- { startIndex: 4, type: 'number.cs' }
- ]}],
- [{
- line: '0 + 0',
- tokens: [
- { startIndex: 0, type: 'number.cs' },
- { startIndex: 1, type: '' },
- { startIndex: 2, type: 'delimiter.cs' },
- { startIndex: 3, type: '' },
- { startIndex: 4, type: 'number.cs' }
- ]}],
- // Strings
- [{
- line: 'x = "string";',
- tokens: [
- { startIndex: 0, type: 'identifier.cs' },
- { startIndex: 1, type: '' },
- { startIndex: 2, type: 'delimiter.cs' },
- { startIndex: 3, type: '' },
- { startIndex: 4, type: 'string.quote.cs' },
- { startIndex: 5, type: 'string.cs' },
- { startIndex: 11, type: 'string.quote.cs' },
- { startIndex: 12, type: 'delimiter.cs' }
- ]}],
- [{
- line: 'x = "stri\\"ng";',
- tokens: [
- { startIndex: 0, type: 'identifier.cs' },
- { startIndex: 1, type: '' },
- { startIndex: 2, type: 'delimiter.cs' },
- { startIndex: 3, type: '' },
- { startIndex: 4, type: 'string.quote.cs' },
- { startIndex: 5, type: 'string.cs' },
- { startIndex: 9, type: 'string.escape.cs' },
- { startIndex: 11, type: 'string.cs' },
- { startIndex: 13, type: 'string.quote.cs' },
- { startIndex: 14, type: 'delimiter.cs' }
- ]}],
- // Verbatim Strings
- [{
- line: 'x = @"verbatimstring";',
- tokens: [
- { startIndex: 0, type: 'identifier.cs' },
- { startIndex: 1, type: '' },
- { startIndex: 2, type: 'delimiter.cs' },
- { startIndex: 3, type: '' },
- { startIndex: 4, type: 'string.quote.cs' },
- { startIndex: 6, type: 'string.cs' },
- { startIndex: 20, type: 'string.quote.cs' },
- { startIndex: 21, type: 'delimiter.cs' }
- ]}],
- [{
- line: 'x = @"verbatim""string";',
- tokens: [
- { startIndex: 0, type: 'identifier.cs' },
- { startIndex: 1, type: '' },
- { startIndex: 2, type: 'delimiter.cs' },
- { startIndex: 3, type: '' },
- { startIndex: 4, type: 'string.quote.cs' },
- { startIndex: 6, type: 'string.cs' },
- { startIndex: 14, type: 'string.escape.cs' },
- { startIndex: 16, type: 'string.cs' },
- { startIndex: 22, type: 'string.quote.cs' },
- { startIndex: 23, type: 'delimiter.cs' }
- ]}],
- [{
- line: 'x = @"verbatim\\string\\";',
- tokens: [
- { startIndex: 0, type: 'identifier.cs' },
- { startIndex: 1, type: '' },
- { startIndex: 2, type: 'delimiter.cs' },
- { startIndex: 3, type: '' },
- { startIndex: 4, type: 'string.quote.cs' },
- { startIndex: 6, type: 'string.cs' },
- { startIndex: 22, type: 'string.quote.cs' },
- { startIndex: 23, type: 'delimiter.cs' }
- ]}],
- [{
- line: 'x = @"verbatim',
- tokens: [
- { startIndex: 0, type: 'identifier.cs' },
- { startIndex: 1, type: '' },
- { startIndex: 2, type: 'delimiter.cs' },
- { startIndex: 3, type: '' },
- { startIndex: 4, type: 'string.quote.cs' },
- { startIndex: 6, type: 'string.cs' }
- ]},{
- line: 'string";',
- tokens: [
- { startIndex: 0, type: 'string.cs' },
- { startIndex: 6, type: 'string.quote.cs' },
- { startIndex: 7, type: 'delimiter.cs' }
- ]}]
- ]);
|