csharp.test.ts 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744
  1. /*---------------------------------------------------------------------------------------------
  2. * Copyright (c) Microsoft Corporation. All rights reserved.
  3. * Licensed under the MIT License. See License.txt in the project root for license information.
  4. *--------------------------------------------------------------------------------------------*/
  5. 'use strict';
  6. import {testTokenization} from './testRunner';
  7. testTokenization('csharp', [
  8. // Generated from sample
  9. [{
  10. line: 'using System;',
  11. tokens: [
  12. { startIndex: 0, type: 'keyword.using.cs' },
  13. { startIndex: 5, type: '' },
  14. { startIndex: 6, type: 'namespace.cs' },
  15. { startIndex: 12, type: 'delimiter.cs' }
  16. ]}, {
  17. line: 'using System.Collections.Generic;',
  18. tokens: [
  19. { startIndex: 0, type: 'keyword.using.cs' },
  20. { startIndex: 5, type: '' },
  21. { startIndex: 6, type: 'namespace.cs' },
  22. { startIndex: 12, type: 'delimiter.cs' },
  23. { startIndex: 13, type: 'namespace.cs' },
  24. { startIndex: 24, type: 'delimiter.cs' },
  25. { startIndex: 25, type: 'namespace.cs' },
  26. { startIndex: 32, type: 'delimiter.cs' }
  27. ]}, {
  28. line: 'using System.Diagnostics;',
  29. tokens: [
  30. { startIndex: 0, type: 'keyword.using.cs' },
  31. { startIndex: 5, type: '' },
  32. { startIndex: 6, type: 'namespace.cs' },
  33. { startIndex: 12, type: 'delimiter.cs' },
  34. { startIndex: 13, type: 'namespace.cs' },
  35. { startIndex: 24, type: 'delimiter.cs' }
  36. ]}, {
  37. line: 'using System.Linq;',
  38. tokens: [
  39. { startIndex: 0, type: 'keyword.using.cs' },
  40. { startIndex: 5, type: '' },
  41. { startIndex: 6, type: 'namespace.cs' },
  42. { startIndex: 12, type: 'delimiter.cs' },
  43. { startIndex: 13, type: 'namespace.cs' },
  44. { startIndex: 17, type: 'delimiter.cs' }
  45. ]}, {
  46. line: 'using System.Text;',
  47. tokens: [
  48. { startIndex: 0, type: 'keyword.using.cs' },
  49. { startIndex: 5, type: '' },
  50. { startIndex: 6, type: 'namespace.cs' },
  51. { startIndex: 12, type: 'delimiter.cs' },
  52. { startIndex: 13, type: 'namespace.cs' },
  53. { startIndex: 17, type: 'delimiter.cs' }
  54. ]}, {
  55. line: 'using System.Threading.Tasks;',
  56. tokens: [
  57. { startIndex: 0, type: 'keyword.using.cs' },
  58. { startIndex: 5, type: '' },
  59. { startIndex: 6, type: 'namespace.cs' },
  60. { startIndex: 12, type: 'delimiter.cs' },
  61. { startIndex: 13, type: 'namespace.cs' },
  62. { startIndex: 22, type: 'delimiter.cs' },
  63. { startIndex: 23, type: 'namespace.cs' },
  64. { startIndex: 28, type: 'delimiter.cs' }
  65. ]}, {
  66. line: '',
  67. tokens: [
  68. ]}, {
  69. line: 'namespace VS',
  70. tokens: [
  71. { startIndex: 0, type: 'keyword.namespace.cs' },
  72. { startIndex: 9, type: '' },
  73. { startIndex: 10, type: 'namespace.cs' }
  74. ]}, {
  75. line: '{',
  76. tokens: [
  77. { startIndex: 0, type: 'delimiter.curly.cs' }
  78. ]}, {
  79. line: ' class Program',
  80. tokens: [
  81. { startIndex: 0, type: '' },
  82. { startIndex: 1, type: 'keyword.class.cs' },
  83. { startIndex: 6, type: '' },
  84. { startIndex: 7, type: 'identifier.cs' }
  85. ]}, {
  86. line: ' {',
  87. tokens: [
  88. { startIndex: 0, type: '' },
  89. { startIndex: 1, type: 'delimiter.curly.cs' }
  90. ]}, {
  91. line: ' static void Main(string[] args)',
  92. tokens: [
  93. { startIndex: 0, type: '' },
  94. { startIndex: 2, type: 'keyword.static.cs' },
  95. { startIndex: 8, type: '' },
  96. { startIndex: 9, type: 'keyword.void.cs' },
  97. { startIndex: 13, type: '' },
  98. { startIndex: 14, type: 'identifier.cs' },
  99. { startIndex: 18, type: 'delimiter.parenthesis.cs' },
  100. { startIndex: 19, type: 'keyword.string.cs' },
  101. { startIndex: 25, type: 'delimiter.square.cs' },
  102. { startIndex: 27, type: '' },
  103. { startIndex: 28, type: 'identifier.cs' },
  104. { startIndex: 32, type: 'delimiter.parenthesis.cs' }
  105. ]}, {
  106. line: ' {',
  107. tokens: [
  108. { startIndex: 0, type: '' },
  109. { startIndex: 2, type: 'delimiter.curly.cs' }
  110. ]}, {
  111. line: ' ProcessStartInfo si = new ProcessStartInfo();',
  112. tokens: [
  113. { startIndex: 0, type: '' },
  114. { startIndex: 3, type: 'identifier.cs' },
  115. { startIndex: 19, type: '' },
  116. { startIndex: 20, type: 'identifier.cs' },
  117. { startIndex: 22, type: '' },
  118. { startIndex: 23, type: 'delimiter.cs' },
  119. { startIndex: 24, type: '' },
  120. { startIndex: 25, type: 'keyword.new.cs' },
  121. { startIndex: 28, type: '' },
  122. { startIndex: 29, type: 'identifier.cs' },
  123. { startIndex: 45, type: 'delimiter.parenthesis.cs' },
  124. { startIndex: 47, type: 'delimiter.cs' }
  125. ]}, {
  126. line: ' float load= 3.2e02f;',
  127. tokens: [
  128. { startIndex: 0, type: '' },
  129. { startIndex: 3, type: 'keyword.float.cs' },
  130. { startIndex: 8, type: '' },
  131. { startIndex: 9, type: 'identifier.cs' },
  132. { startIndex: 13, type: 'delimiter.cs' },
  133. { startIndex: 14, type: '' },
  134. { startIndex: 15, type: 'number.float.cs' },
  135. { startIndex: 22, type: 'delimiter.cs' }
  136. ]}, {
  137. line: '',
  138. tokens: [
  139. ]}, {
  140. line: ' si.FileName = @"tools\\\\node.exe";',
  141. tokens: [
  142. { startIndex: 0, type: '' },
  143. { startIndex: 3, type: 'identifier.cs' },
  144. { startIndex: 5, type: 'delimiter.cs' },
  145. { startIndex: 6, type: 'identifier.cs' },
  146. { startIndex: 14, type: '' },
  147. { startIndex: 15, type: 'delimiter.cs' },
  148. { startIndex: 16, type: '' },
  149. { startIndex: 17, type: 'string.quote.cs' },
  150. { startIndex: 19, type: 'string.cs' },
  151. { startIndex: 34, type: 'string.quote.cs' },
  152. { startIndex: 35, type: 'delimiter.cs' }
  153. ]}, {
  154. line: ' si.Arguments = "tools\\\\simpl3server.js";',
  155. tokens: [
  156. { startIndex: 0, type: '' },
  157. { startIndex: 3, type: 'identifier.cs' },
  158. { startIndex: 5, type: 'delimiter.cs' },
  159. { startIndex: 6, type: 'identifier.cs' },
  160. { startIndex: 15, type: '' },
  161. { startIndex: 16, type: 'delimiter.cs' },
  162. { startIndex: 17, type: '' },
  163. { startIndex: 18, type: 'string.quote.cs' },
  164. { startIndex: 19, type: 'string.cs' },
  165. { startIndex: 24, type: 'string.escape.cs' },
  166. { startIndex: 26, type: 'string.cs' },
  167. { startIndex: 41, type: 'string.quote.cs' },
  168. { startIndex: 42, type: 'delimiter.cs' }
  169. ]}, {
  170. line: ' ',
  171. tokens: [
  172. { startIndex: 0, type: '' }
  173. ]}, {
  174. line: ' string someString = $"hello{outside+variable}the string again {{ escaped";',
  175. tokens: [
  176. { startIndex: 0, type: '' },
  177. { startIndex: 3, type: 'keyword.string.cs' },
  178. { startIndex: 9, type: '' },
  179. { startIndex: 10, type: 'identifier.cs' },
  180. { startIndex: 20, type: '' },
  181. { startIndex: 21, type: 'delimiter.cs' },
  182. { startIndex: 22, type: '' },
  183. { startIndex: 23, type: 'string.quote.cs' },
  184. { startIndex: 25, type: 'string.cs' },
  185. { startIndex: 30, type: 'string.quote.cs' },
  186. { startIndex: 31, type: 'identifier.cs' },
  187. { startIndex: 38, type: 'delimiter.cs' },
  188. { startIndex: 39, type: 'identifier.cs' },
  189. { startIndex: 47, type: 'string.quote.cs' },
  190. { startIndex: 48, type: 'string.cs' },
  191. { startIndex: 65, type: 'string.escape.cs' },
  192. { startIndex: 67, type: 'string.cs' },
  193. { startIndex: 75, type: 'string.quote.cs' },
  194. { startIndex: 76, type: 'delimiter.cs' }
  195. ]}, {
  196. line: ' var @string = 5;',
  197. tokens: [
  198. { startIndex: 0, type: '' },
  199. { startIndex: 3, type: 'keyword.var.cs' },
  200. { startIndex: 6, type: '' },
  201. { startIndex: 7, type: 'identifier.cs' },
  202. { startIndex: 14, type: '' },
  203. { startIndex: 15, type: 'delimiter.cs' },
  204. { startIndex: 16, type: '' },
  205. { startIndex: 17, type: 'number.cs' },
  206. { startIndex: 18, type: 'delimiter.cs' }
  207. ]}, {
  208. line: ' ',
  209. tokens: [
  210. { startIndex: 0, type: '' }
  211. ]}, {
  212. line: ' if (x == 4)',
  213. tokens: [
  214. { startIndex: 0, type: '' },
  215. { startIndex: 3, type: 'keyword.if.cs' },
  216. { startIndex: 5, type: '' },
  217. { startIndex: 6, type: 'delimiter.parenthesis.cs' },
  218. { startIndex: 7, type: 'identifier.cs' },
  219. { startIndex: 8, type: '' },
  220. { startIndex: 9, type: 'delimiter.cs' },
  221. { startIndex: 11, type: '' },
  222. { startIndex: 12, type: 'number.cs' },
  223. { startIndex: 13, type: 'delimiter.parenthesis.cs' }
  224. ]}, {
  225. line: ' {',
  226. tokens: [
  227. { startIndex: 0, type: '' },
  228. { startIndex: 3, type: 'delimiter.curly.cs' }
  229. ]}, {
  230. line: ' for (int i = 4; i<10; i++)',
  231. tokens: [
  232. { startIndex: 0, type: '' },
  233. { startIndex: 4, type: 'keyword.for.cs' },
  234. { startIndex: 7, type: '' },
  235. { startIndex: 8, type: 'delimiter.parenthesis.cs' },
  236. { startIndex: 9, type: 'keyword.int.cs' },
  237. { startIndex: 12, type: '' },
  238. { startIndex: 13, type: 'identifier.cs' },
  239. { startIndex: 14, type: '' },
  240. { startIndex: 15, type: 'delimiter.cs' },
  241. { startIndex: 16, type: '' },
  242. { startIndex: 17, type: 'number.cs' },
  243. { startIndex: 18, type: 'delimiter.cs' },
  244. { startIndex: 19, type: '' },
  245. { startIndex: 20, type: 'identifier.cs' },
  246. { startIndex: 21, type: 'delimiter.angle.cs' },
  247. { startIndex: 22, type: 'number.cs' },
  248. { startIndex: 24, type: 'delimiter.cs' },
  249. { startIndex: 25, type: '' },
  250. { startIndex: 26, type: 'identifier.cs' },
  251. { startIndex: 27, type: 'delimiter.cs' },
  252. { startIndex: 29, type: 'delimiter.parenthesis.cs' }
  253. ]}, {
  254. line: ' {',
  255. tokens: [
  256. { startIndex: 0, type: '' },
  257. { startIndex: 4, type: 'delimiter.curly.cs' }
  258. ]}, {
  259. line: ' var d = i;',
  260. tokens: [
  261. { startIndex: 0, type: '' },
  262. { startIndex: 5, type: 'keyword.var.cs' },
  263. { startIndex: 8, type: '' },
  264. { startIndex: 9, type: 'identifier.cs' },
  265. { startIndex: 10, type: '' },
  266. { startIndex: 11, type: 'delimiter.cs' },
  267. { startIndex: 12, type: '' },
  268. { startIndex: 13, type: 'identifier.cs' },
  269. { startIndex: 14, type: 'delimiter.cs' }
  270. ]}, {
  271. line: ' }',
  272. tokens: [
  273. { startIndex: 0, type: '' },
  274. { startIndex: 4, type: 'delimiter.curly.cs' }
  275. ]}, {
  276. line: ' }',
  277. tokens: [
  278. { startIndex: 0, type: '' },
  279. { startIndex: 3, type: 'delimiter.curly.cs' }
  280. ]}, {
  281. line: ' else',
  282. tokens: [
  283. { startIndex: 0, type: '' },
  284. { startIndex: 3, type: 'keyword.else.cs' }
  285. ]}, {
  286. line: ' {',
  287. tokens: [
  288. { startIndex: 0, type: '' },
  289. { startIndex: 3, type: 'delimiter.curly.cs' }
  290. ]}, {
  291. line: ' return;',
  292. tokens: [
  293. { startIndex: 0, type: '' },
  294. { startIndex: 4, type: 'keyword.return.cs' },
  295. { startIndex: 10, type: 'delimiter.cs' }
  296. ]}, {
  297. line: ' }',
  298. tokens: [
  299. { startIndex: 0, type: '' },
  300. { startIndex: 3, type: 'delimiter.curly.cs' }
  301. ]}, {
  302. line: ' ',
  303. tokens: [
  304. { startIndex: 0, type: '' }
  305. ]}, {
  306. line: '',
  307. tokens: [
  308. ]}, {
  309. line: ' Process.Start(si);',
  310. tokens: [
  311. { startIndex: 0, type: '' },
  312. { startIndex: 3, type: 'identifier.cs' },
  313. { startIndex: 10, type: 'delimiter.cs' },
  314. { startIndex: 11, type: 'identifier.cs' },
  315. { startIndex: 16, type: 'delimiter.parenthesis.cs' },
  316. { startIndex: 17, type: 'identifier.cs' },
  317. { startIndex: 19, type: 'delimiter.parenthesis.cs' },
  318. { startIndex: 20, type: 'delimiter.cs' }
  319. ]}, {
  320. line: ' }',
  321. tokens: [
  322. { startIndex: 0, type: '' },
  323. { startIndex: 2, type: 'delimiter.curly.cs' }
  324. ]}, {
  325. line: ' }',
  326. tokens: [
  327. { startIndex: 0, type: '' },
  328. { startIndex: 1, type: 'delimiter.curly.cs' }
  329. ]}, {
  330. line: '}',
  331. tokens: [
  332. { startIndex: 0, type: 'delimiter.curly.cs' }
  333. ]}, {
  334. line: '',
  335. tokens: [
  336. ]}, {
  337. line: '#pragma region /MapLayer/*Image* /// ',
  338. tokens: [
  339. { startIndex: 0, type: 'namespace.cpp.cs' }
  340. ]}, {
  341. line: 'namespace ShouldNotBeAComment {}',
  342. tokens: [
  343. { startIndex: 0, type: 'keyword.namespace.cs' },
  344. { startIndex: 9, type: '' },
  345. { startIndex: 10, type: 'namespace.cs' },
  346. { startIndex: 29, type: '' },
  347. { startIndex: 30, type: 'delimiter.curly.cs' }
  348. ]}, {
  349. line: '#pragma endregion Region_1',
  350. tokens: [
  351. { startIndex: 0, type: 'namespace.cpp.cs' }
  352. ]}],
  353. // Keywords
  354. [{
  355. line: 'namespace VS { class Program { static void Main(string[] args) {} } }',
  356. tokens: [
  357. { startIndex: 0, type: 'keyword.namespace.cs' },
  358. { startIndex: 9, type: '' },
  359. { startIndex: 10, type: 'namespace.cs' },
  360. { startIndex: 12, type: '' },
  361. { startIndex: 13, type: 'delimiter.curly.cs' },
  362. { startIndex: 14, type: '' },
  363. { startIndex: 15, type: 'keyword.class.cs' },
  364. { startIndex: 20, type: '' },
  365. { startIndex: 21, type: 'identifier.cs' },
  366. { startIndex: 28, type: '' },
  367. { startIndex: 29, type: 'delimiter.curly.cs' },
  368. { startIndex: 30, type: '' },
  369. { startIndex: 31, type: 'keyword.static.cs' },
  370. { startIndex: 37, type: '' },
  371. { startIndex: 38, type: 'keyword.void.cs' },
  372. { startIndex: 42, type: '' },
  373. { startIndex: 43, type: 'identifier.cs' },
  374. { startIndex: 47, type: 'delimiter.parenthesis.cs' },
  375. { startIndex: 48, type: 'keyword.string.cs' },
  376. { startIndex: 54, type: 'delimiter.square.cs' },
  377. { startIndex: 56, type: '' },
  378. { startIndex: 57, type: 'identifier.cs' },
  379. { startIndex: 61, type: 'delimiter.parenthesis.cs' },
  380. { startIndex: 62, type: '' },
  381. { startIndex: 63, type: 'delimiter.curly.cs' },
  382. { startIndex: 65, type: '' },
  383. { startIndex: 66, type: 'delimiter.curly.cs' },
  384. { startIndex: 67, type: '' },
  385. { startIndex: 68, type: 'delimiter.curly.cs' }
  386. ]}],
  387. // Comments - single line
  388. [{
  389. line: '//',
  390. tokens: [
  391. { startIndex: 0, type: 'comment.cs' }
  392. ]}],
  393. [{
  394. line: ' // a comment',
  395. tokens: [
  396. { startIndex: 0, type: '' },
  397. { startIndex: 4, type: 'comment.cs' }
  398. ]}],
  399. [{
  400. line: '// a comment',
  401. tokens: [
  402. { startIndex: 0, type: 'comment.cs' }
  403. ]}],
  404. [{
  405. line: '//sticky comment',
  406. tokens: [
  407. { startIndex: 0, type: 'comment.cs' }
  408. ]}],
  409. [{
  410. line: '/almost a comment',
  411. tokens: [
  412. { startIndex: 0, type: 'delimiter.cs' },
  413. { startIndex: 1, type: 'identifier.cs' },
  414. { startIndex: 7, type: '' },
  415. { startIndex: 8, type: 'identifier.cs' },
  416. { startIndex: 9, type: '' },
  417. { startIndex: 10, type: 'identifier.cs' }
  418. ]}],
  419. [{
  420. line: '1 / 2; /* comment',
  421. tokens: [
  422. { startIndex: 0, type: 'number.cs' },
  423. { startIndex: 1, type: '' },
  424. { startIndex: 2, type: 'delimiter.cs' },
  425. { startIndex: 3, type: '' },
  426. { startIndex: 4, type: 'number.cs' },
  427. { startIndex: 5, type: 'delimiter.cs' },
  428. { startIndex: 6, type: '' },
  429. { startIndex: 7, type: 'comment.cs' }
  430. ]}],
  431. [{
  432. line: 'var x = 1; // my comment // is a nice one',
  433. tokens: [
  434. { startIndex: 0, type: 'keyword.var.cs' },
  435. { startIndex: 3, type: '' },
  436. { startIndex: 4, type: 'identifier.cs' },
  437. { startIndex: 5, type: '' },
  438. { startIndex: 6, type: 'delimiter.cs' },
  439. { startIndex: 7, type: '' },
  440. { startIndex: 8, type: 'number.cs' },
  441. { startIndex: 9, type: 'delimiter.cs' },
  442. { startIndex: 10, type: '' },
  443. { startIndex: 11, type: 'comment.cs' }
  444. ]}],
  445. // Comments - range comment, single line
  446. [{
  447. line: '/* a simple comment */',
  448. tokens: [
  449. { startIndex: 0, type: 'comment.cs' }
  450. ]}],
  451. [{
  452. line: 'var x = /* a simple comment */ 1;',
  453. tokens: [
  454. { startIndex: 0, type: 'keyword.var.cs' },
  455. { startIndex: 3, type: '' },
  456. { startIndex: 4, type: 'identifier.cs' },
  457. { startIndex: 5, type: '' },
  458. { startIndex: 6, type: 'delimiter.cs' },
  459. { startIndex: 7, type: '' },
  460. { startIndex: 8, type: 'comment.cs' },
  461. { startIndex: 30, type: '' },
  462. { startIndex: 31, type: 'number.cs' },
  463. { startIndex: 32, type: 'delimiter.cs' }
  464. ]}],
  465. [{
  466. line: 'var x = /* comment */ 1; */',
  467. tokens: [
  468. { startIndex: 0, type: 'keyword.var.cs' },
  469. { startIndex: 3, type: '' },
  470. { startIndex: 4, type: 'identifier.cs' },
  471. { startIndex: 5, type: '' },
  472. { startIndex: 6, type: 'delimiter.cs' },
  473. { startIndex: 7, type: '' },
  474. { startIndex: 8, type: 'comment.cs' },
  475. { startIndex: 21, type: '' },
  476. { startIndex: 22, type: 'number.cs' },
  477. { startIndex: 23, type: 'delimiter.cs' },
  478. { startIndex: 24, type: '' }
  479. ]}],
  480. [{
  481. line: 'x = /**/;',
  482. tokens: [
  483. { startIndex: 0, type: 'identifier.cs' },
  484. { startIndex: 1, type: '' },
  485. { startIndex: 2, type: 'delimiter.cs' },
  486. { startIndex: 3, type: '' },
  487. { startIndex: 4, type: 'comment.cs' },
  488. { startIndex: 8, type: 'delimiter.cs' }
  489. ]}],
  490. [{
  491. line: 'x = /*/;',
  492. tokens: [
  493. { startIndex: 0, type: 'identifier.cs' },
  494. { startIndex: 1, type: '' },
  495. { startIndex: 2, type: 'delimiter.cs' },
  496. { startIndex: 3, type: '' },
  497. { startIndex: 4, type: 'comment.cs' }
  498. ]}],
  499. // Numbers
  500. [{
  501. line: '0',
  502. tokens: [
  503. { startIndex: 0, type: 'number.cs' }
  504. ]}],
  505. [{
  506. line: '0x',
  507. tokens: [
  508. { startIndex: 0, type: 'number.cs' },
  509. { startIndex: 1, type: 'identifier.cs' }
  510. ]}],
  511. [{
  512. line: '0x123',
  513. tokens: [
  514. { startIndex: 0, type: 'number.hex.cs' }
  515. ]}],
  516. [{
  517. line: '23.5',
  518. tokens: [
  519. { startIndex: 0, type: 'number.float.cs' }
  520. ]}],
  521. [{
  522. line: '23.5e3',
  523. tokens: [
  524. { startIndex: 0, type: 'number.float.cs' }
  525. ]}],
  526. [{
  527. line: '23.5E3',
  528. tokens: [
  529. { startIndex: 0, type: 'number.float.cs' }
  530. ]}],
  531. [{
  532. line: '23.5F',
  533. tokens: [
  534. { startIndex: 0, type: 'number.float.cs' }
  535. ]}],
  536. [{
  537. line: '23.5f',
  538. tokens: [
  539. { startIndex: 0, type: 'number.float.cs' }
  540. ]}],
  541. [{
  542. line: '1.72E3F',
  543. tokens: [
  544. { startIndex: 0, type: 'number.float.cs' }
  545. ]}],
  546. [{
  547. line: '1.72E3f',
  548. tokens: [
  549. { startIndex: 0, type: 'number.float.cs' }
  550. ]}],
  551. [{
  552. line: '1.72e3F',
  553. tokens: [
  554. { startIndex: 0, type: 'number.float.cs' }
  555. ]}],
  556. [{
  557. line: '1.72e3f',
  558. tokens: [
  559. { startIndex: 0, type: 'number.float.cs' }
  560. ]}],
  561. [{
  562. line: '23.5D',
  563. tokens: [
  564. { startIndex: 0, type: 'number.float.cs' }
  565. ]}],
  566. [{
  567. line: '23.5d',
  568. tokens: [
  569. { startIndex: 0, type: 'number.float.cs' }
  570. ]}],
  571. [{
  572. line: '1.72E3D',
  573. tokens: [
  574. { startIndex: 0, type: 'number.float.cs' }
  575. ]}],
  576. [{
  577. line: '1.72E3d',
  578. tokens: [
  579. { startIndex: 0, type: 'number.float.cs' }
  580. ]}],
  581. [{
  582. line: '1.72e3D',
  583. tokens: [
  584. { startIndex: 0, type: 'number.float.cs' }
  585. ]}],
  586. [{
  587. line: '1.72e3d',
  588. tokens: [
  589. { startIndex: 0, type: 'number.float.cs' }
  590. ]}],
  591. [{
  592. line: '0+0',
  593. tokens: [
  594. { startIndex: 0, type: 'number.cs' },
  595. { startIndex: 1, type: 'delimiter.cs' },
  596. { startIndex: 2, type: 'number.cs' }
  597. ]}],
  598. [{
  599. line: '100+10',
  600. tokens: [
  601. { startIndex: 0, type: 'number.cs' },
  602. { startIndex: 3, type: 'delimiter.cs' },
  603. { startIndex: 4, type: 'number.cs' }
  604. ]}],
  605. [{
  606. line: '0 + 0',
  607. tokens: [
  608. { startIndex: 0, type: 'number.cs' },
  609. { startIndex: 1, type: '' },
  610. { startIndex: 2, type: 'delimiter.cs' },
  611. { startIndex: 3, type: '' },
  612. { startIndex: 4, type: 'number.cs' }
  613. ]}],
  614. // Strings
  615. [{
  616. line: 'x = "string";',
  617. tokens: [
  618. { startIndex: 0, type: 'identifier.cs' },
  619. { startIndex: 1, type: '' },
  620. { startIndex: 2, type: 'delimiter.cs' },
  621. { startIndex: 3, type: '' },
  622. { startIndex: 4, type: 'string.quote.cs' },
  623. { startIndex: 5, type: 'string.cs' },
  624. { startIndex: 11, type: 'string.quote.cs' },
  625. { startIndex: 12, type: 'delimiter.cs' }
  626. ]}],
  627. [{
  628. line: 'x = "stri\\"ng";',
  629. tokens: [
  630. { startIndex: 0, type: 'identifier.cs' },
  631. { startIndex: 1, type: '' },
  632. { startIndex: 2, type: 'delimiter.cs' },
  633. { startIndex: 3, type: '' },
  634. { startIndex: 4, type: 'string.quote.cs' },
  635. { startIndex: 5, type: 'string.cs' },
  636. { startIndex: 9, type: 'string.escape.cs' },
  637. { startIndex: 11, type: 'string.cs' },
  638. { startIndex: 13, type: 'string.quote.cs' },
  639. { startIndex: 14, type: 'delimiter.cs' }
  640. ]}],
  641. // Verbatim Strings
  642. [{
  643. line: 'x = @"verbatimstring";',
  644. tokens: [
  645. { startIndex: 0, type: 'identifier.cs' },
  646. { startIndex: 1, type: '' },
  647. { startIndex: 2, type: 'delimiter.cs' },
  648. { startIndex: 3, type: '' },
  649. { startIndex: 4, type: 'string.quote.cs' },
  650. { startIndex: 6, type: 'string.cs' },
  651. { startIndex: 20, type: 'string.quote.cs' },
  652. { startIndex: 21, type: 'delimiter.cs' }
  653. ]}],
  654. [{
  655. line: 'x = @"verbatim""string";',
  656. tokens: [
  657. { startIndex: 0, type: 'identifier.cs' },
  658. { startIndex: 1, type: '' },
  659. { startIndex: 2, type: 'delimiter.cs' },
  660. { startIndex: 3, type: '' },
  661. { startIndex: 4, type: 'string.quote.cs' },
  662. { startIndex: 6, type: 'string.cs' },
  663. { startIndex: 14, type: 'string.escape.cs' },
  664. { startIndex: 16, type: 'string.cs' },
  665. { startIndex: 22, type: 'string.quote.cs' },
  666. { startIndex: 23, type: 'delimiter.cs' }
  667. ]}],
  668. [{
  669. line: 'x = @"verbatim\\string\\";',
  670. tokens: [
  671. { startIndex: 0, type: 'identifier.cs' },
  672. { startIndex: 1, type: '' },
  673. { startIndex: 2, type: 'delimiter.cs' },
  674. { startIndex: 3, type: '' },
  675. { startIndex: 4, type: 'string.quote.cs' },
  676. { startIndex: 6, type: 'string.cs' },
  677. { startIndex: 22, type: 'string.quote.cs' },
  678. { startIndex: 23, type: 'delimiter.cs' }
  679. ]}],
  680. [{
  681. line: 'x = @"verbatim',
  682. tokens: [
  683. { startIndex: 0, type: 'identifier.cs' },
  684. { startIndex: 1, type: '' },
  685. { startIndex: 2, type: 'delimiter.cs' },
  686. { startIndex: 3, type: '' },
  687. { startIndex: 4, type: 'string.quote.cs' },
  688. { startIndex: 6, type: 'string.cs' }
  689. ]},{
  690. line: 'string";',
  691. tokens: [
  692. { startIndex: 0, type: 'string.cs' },
  693. { startIndex: 6, type: 'string.quote.cs' },
  694. { startIndex: 7, type: 'delimiter.cs' }
  695. ]}]
  696. ]);