php.test.ts 51 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882
  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. import {htmlTokenTypes} from '../src/php';
  8. testTokenization(['php', 'css'], [
  9. // Bug 13596:[ErrorTelemetry] Stream did not advance while tokenizing. Mode id is php (stuck)
  10. // We're testing the fact that tokenize does not throw
  11. [
  12. { line: '<?php', tokens: [{ startIndex:0, type: "metatag.php" }]},
  13. { line: '"', tokens: [{ startIndex:0, type: "string.php"}]},
  14. { line: '\\', tokens: [{startIndex:0, type:""}]}
  15. ],
  16. // Blocks
  17. [{
  18. line: '<?php',
  19. tokens: [
  20. { startIndex:0, type: 'metatag.php' }
  21. ]}],
  22. [{
  23. line: '<?php ?>',
  24. tokens: [
  25. { startIndex:0, type: 'metatag.php' },
  26. { startIndex:5, type: '' },
  27. { startIndex:6, type: 'metatag.php' }
  28. ]}],
  29. [{
  30. line: '<?=',
  31. tokens: [
  32. { startIndex:0, type: 'metatag.php' }
  33. ]}],
  34. [{
  35. line: '<?php /* comment */ ?>',
  36. tokens: [
  37. { startIndex:0, type: 'metatag.php' },
  38. { startIndex:5, type: '' },
  39. { startIndex:6, type: 'comment.php' },
  40. { startIndex:19, type: '' },
  41. { startIndex:20, type: 'metatag.php' }
  42. ]}],
  43. // Variables
  44. [{
  45. line: '<?php $abc = 5; ?>',
  46. tokens: [
  47. { startIndex:0, type: 'metatag.php' },
  48. { startIndex:5, type: '' },
  49. { startIndex:6, type: 'variable.php' },
  50. { startIndex:10, type: '' },
  51. { startIndex:11, type: 'delimiter.php' },
  52. { startIndex:12, type: '' },
  53. { startIndex:13, type: 'number.php' },
  54. { startIndex:14, type: 'delimiter.php' },
  55. { startIndex:15, type: '' },
  56. { startIndex:16, type: 'metatag.php' }
  57. ]}],
  58. [{
  59. line: '<?php $a = "chris"; ?>',
  60. tokens: [
  61. { startIndex:0, type: 'metatag.php' },
  62. { startIndex:5, type: '' },
  63. { startIndex:6, type: 'variable.php' },
  64. { startIndex:8, type: '' },
  65. { startIndex:9, type: 'delimiter.php' },
  66. { startIndex:10, type: '' },
  67. { startIndex:11, type: 'string.php' },
  68. { startIndex:18, type: 'delimiter.php' },
  69. { startIndex:19, type: '' },
  70. { startIndex:20, type: 'metatag.php' }
  71. ]}],
  72. [{
  73. line: '<?php $myVar = -10; ?>',
  74. tokens: [
  75. { startIndex:0, type: 'metatag.php' },
  76. { startIndex:5, type: '' },
  77. { startIndex:6, type: 'variable.php' },
  78. { startIndex:12, type: '' },
  79. { startIndex:13, type: 'delimiter.php' },
  80. { startIndex:14, type: '' },
  81. { startIndex:15, type: 'delimiter.php' },
  82. { startIndex:16, type: 'number.php' },
  83. { startIndex:18, type: 'delimiter.php' },
  84. { startIndex:19, type: '' },
  85. { startIndex:20, type: 'metatag.php' }
  86. ]}],
  87. [{
  88. line: '<?php $myVar = 5 + (10 * 2); ?>',
  89. tokens: [
  90. { startIndex:0, type: 'metatag.php' },
  91. { startIndex:5, type: '' },
  92. { startIndex:6, type: 'variable.php' },
  93. { startIndex:12, type: '' },
  94. { startIndex:13, type: 'delimiter.php' },
  95. { startIndex:14, type: '' },
  96. { startIndex:15, type: 'number.php' },
  97. { startIndex:16, type: '' },
  98. { startIndex:17, type: 'delimiter.php' },
  99. { startIndex:18, type: '' },
  100. { startIndex:19, type: 'delimiter.parenthesis.php' },
  101. { startIndex:20, type: 'number.php' },
  102. { startIndex:22, type: '' },
  103. { startIndex:23, type: 'delimiter.php' },
  104. { startIndex:24, type: '' },
  105. { startIndex:25, type: 'number.php' },
  106. { startIndex:26, type: 'delimiter.parenthesis.php' },
  107. { startIndex:27, type: 'delimiter.php' },
  108. { startIndex:28, type: '' },
  109. { startIndex:29, type: 'metatag.php' }
  110. ]}],
  111. // Keywords
  112. [{
  113. line: '<?php function myFunc() { } ?>',
  114. tokens: [
  115. { startIndex:0, type: 'metatag.php' },
  116. { startIndex:5, type: '' },
  117. { startIndex:6, type: 'keyword.php' },
  118. { startIndex:14, type: '' },
  119. { startIndex:15, type: 'identifier.php' },
  120. { startIndex:21, type: 'delimiter.parenthesis.php' },
  121. { startIndex:23, type: '' },
  122. { startIndex:24, type: 'delimiter.bracket.php' },
  123. { startIndex:25, type: '' },
  124. { startIndex:26, type: 'delimiter.bracket.php' },
  125. { startIndex:27, type: '' },
  126. { startIndex:28, type: 'metatag.php' }
  127. ]}],
  128. [{
  129. line: '<?php function ?>',
  130. tokens: [
  131. { startIndex:0, type: 'metatag.php' },
  132. { startIndex:5, type: '' },
  133. { startIndex:6, type: 'keyword.php' },
  134. { startIndex:14, type: '' },
  135. { startIndex:15, type: 'metatag.php' }
  136. ]}],
  137. [{
  138. line: '<?php if ($start > 52) { $start = 0; } ?>',
  139. tokens: [
  140. { startIndex:0, type: 'metatag.php' },
  141. { startIndex:5, type: '' },
  142. { startIndex:6, type: 'keyword.php' },
  143. { startIndex:8, type: '' },
  144. { startIndex:9, type: 'delimiter.parenthesis.php' },
  145. { startIndex:10, type: 'variable.php' },
  146. { startIndex:16, type: '' },
  147. { startIndex:17, type: 'delimiter.php' },
  148. { startIndex:18, type: '' },
  149. { startIndex:19, type: 'number.php' },
  150. { startIndex:21, type: 'delimiter.parenthesis.php' },
  151. { startIndex:22, type: '' },
  152. { startIndex:23, type: 'delimiter.bracket.php' },
  153. { startIndex:24, type: '' },
  154. { startIndex:25, type: 'variable.php' },
  155. { startIndex:31, type: '' },
  156. { startIndex:32, type: 'delimiter.php' },
  157. { startIndex:33, type: '' },
  158. { startIndex:34, type: 'number.php' },
  159. { startIndex:35, type: 'delimiter.php' },
  160. { startIndex:36, type: '' },
  161. { startIndex:37, type: 'delimiter.bracket.php' },
  162. { startIndex:38, type: '' },
  163. { startIndex:39, type: 'metatag.php' }
  164. ]}],
  165. [{
  166. line: '<?php if (true) { $start = 0; } ?>',
  167. tokens: [
  168. { startIndex:0, type: 'metatag.php' },
  169. { startIndex:5, type: '' },
  170. { startIndex:6, type: 'keyword.php' },
  171. { startIndex:8, type: '' },
  172. { startIndex:9, type: 'delimiter.parenthesis.php' },
  173. { startIndex:10, type: 'keyword.php' },
  174. { startIndex:14, type: 'delimiter.parenthesis.php' },
  175. { startIndex:15, type: '' },
  176. { startIndex:16, type: 'delimiter.bracket.php' },
  177. { startIndex:17, type: '' },
  178. { startIndex:18, type: 'variable.php' },
  179. { startIndex:24, type: '' },
  180. { startIndex:25, type: 'delimiter.php' },
  181. { startIndex:26, type: '' },
  182. { startIndex:27, type: 'number.php' },
  183. { startIndex:28, type: 'delimiter.php' },
  184. { startIndex:29, type: '' },
  185. { startIndex:30, type: 'delimiter.bracket.php' },
  186. { startIndex:31, type: '' },
  187. { startIndex:32, type: 'metatag.php' }
  188. ]}],
  189. [{
  190. line: '<?php abstract ?>',
  191. tokens: [
  192. { startIndex:0, type: 'metatag.php' },
  193. { startIndex:5, type: '' },
  194. { startIndex:6, type: 'keyword.php' },
  195. { startIndex:14, type: '' },
  196. { startIndex:15, type: 'metatag.php' }
  197. ]}],
  198. [{
  199. line: '<?php and ?>',
  200. tokens: [
  201. { startIndex:0, type: 'metatag.php' },
  202. { startIndex:5, type: '' },
  203. { startIndex:6, type: 'keyword.php' },
  204. { startIndex:9, type: '' },
  205. { startIndex:10, type: 'metatag.php' }
  206. ]}],
  207. [{
  208. line: '<?php array ?>',
  209. tokens: [
  210. { startIndex:0, type: 'metatag.php' },
  211. { startIndex:5, type: '' },
  212. { startIndex:6, type: 'keyword.php' },
  213. { startIndex:11, type: '' },
  214. { startIndex:12, type: 'metatag.php' }
  215. ]}],
  216. [{
  217. line: '<?php as ?>',
  218. tokens: [
  219. { startIndex:0, type: 'metatag.php' },
  220. { startIndex:5, type: '' },
  221. { startIndex:6, type: 'keyword.php' },
  222. { startIndex:8, type: '' },
  223. { startIndex:9, type: 'metatag.php' }
  224. ]}],
  225. [{
  226. line: '<?php break ?>',
  227. tokens: [
  228. { startIndex:0, type: 'metatag.php' },
  229. { startIndex:5, type: '' },
  230. { startIndex:6, type: 'keyword.php' },
  231. { startIndex:11, type: '' },
  232. { startIndex:12, type: 'metatag.php' }
  233. ]}],
  234. [{
  235. line: '<?php case ?>',
  236. tokens: [
  237. { startIndex:0, type: 'metatag.php' },
  238. { startIndex:5, type: '' },
  239. { startIndex:6, type: 'keyword.php' },
  240. { startIndex:10, type: '' },
  241. { startIndex:11, type: 'metatag.php' }
  242. ]}],
  243. [{
  244. line: '<?php catch ?>',
  245. tokens: [
  246. { startIndex:0, type: 'metatag.php' },
  247. { startIndex:5, type: '' },
  248. { startIndex:6, type: 'keyword.php' },
  249. { startIndex:11, type: '' },
  250. { startIndex:12, type: 'metatag.php' }
  251. ]}],
  252. [{
  253. line: '<?php cfunction ?>',
  254. tokens: [
  255. { startIndex:0, type: 'metatag.php' },
  256. { startIndex:5, type: '' },
  257. { startIndex:6, type: 'keyword.php' },
  258. { startIndex:15, type: '' },
  259. { startIndex:16, type: 'metatag.php' }
  260. ]}],
  261. [{
  262. line: '<?php class ?>',
  263. tokens: [
  264. { startIndex:0, type: 'metatag.php' },
  265. { startIndex:5, type: '' },
  266. { startIndex:6, type: 'keyword.php' },
  267. { startIndex:11, type: '' },
  268. { startIndex:12, type: 'metatag.php' }
  269. ]}],
  270. [{
  271. line: '<?php clone ?>',
  272. tokens: [
  273. { startIndex:0, type: 'metatag.php' },
  274. { startIndex:5, type: '' },
  275. { startIndex:6, type: 'keyword.php' },
  276. { startIndex:11, type: '' },
  277. { startIndex:12, type: 'metatag.php' }
  278. ]}],
  279. [{
  280. line: '<?php const ?>',
  281. tokens: [
  282. { startIndex:0, type: 'metatag.php' },
  283. { startIndex:5, type: '' },
  284. { startIndex:6, type: 'keyword.php' },
  285. { startIndex:11, type: '' },
  286. { startIndex:12, type: 'metatag.php' }
  287. ]}],
  288. [{
  289. line: '<?php continue ?>',
  290. tokens: [
  291. { startIndex:0, type: 'metatag.php' },
  292. { startIndex:5, type: '' },
  293. { startIndex:6, type: 'keyword.php' },
  294. { startIndex:14, type: '' },
  295. { startIndex:15, type: 'metatag.php' }
  296. ]}],
  297. [{
  298. line: '<?php declare ?>',
  299. tokens: [
  300. { startIndex:0, type: 'metatag.php' },
  301. { startIndex:5, type: '' },
  302. { startIndex:6, type: 'keyword.php' },
  303. { startIndex:13, type: '' },
  304. { startIndex:14, type: 'metatag.php' }
  305. ]}],
  306. [{
  307. line: '<?php default ?>',
  308. tokens: [
  309. { startIndex:0, type: 'metatag.php' },
  310. { startIndex:5, type: '' },
  311. { startIndex:6, type: 'keyword.php' },
  312. { startIndex:13, type: '' },
  313. { startIndex:14, type: 'metatag.php' }
  314. ]}],
  315. [{
  316. line: '<?php do ?>',
  317. tokens: [
  318. { startIndex:0, type: 'metatag.php' },
  319. { startIndex:5, type: '' },
  320. { startIndex:6, type: 'keyword.php' },
  321. { startIndex:8, type: '' },
  322. { startIndex:9, type: 'metatag.php' }
  323. ]}],
  324. [{
  325. line: '<?php else ?>',
  326. tokens: [
  327. { startIndex:0, type: 'metatag.php' },
  328. { startIndex:5, type: '' },
  329. { startIndex:6, type: 'keyword.php' },
  330. { startIndex:10, type: '' },
  331. { startIndex:11, type: 'metatag.php' }
  332. ]}],
  333. [{
  334. line: '<?php elseif ?>',
  335. tokens: [
  336. { startIndex:0, type: 'metatag.php' },
  337. { startIndex:5, type: '' },
  338. { startIndex:6, type: 'keyword.php' },
  339. { startIndex:12, type: '' },
  340. { startIndex:13, type: 'metatag.php' }
  341. ]}],
  342. [{
  343. line: '<?php enddeclare ?>',
  344. tokens: [
  345. { startIndex:0, type: 'metatag.php' },
  346. { startIndex:5, type: '' },
  347. { startIndex:6, type: 'keyword.php' },
  348. { startIndex:16, type: '' },
  349. { startIndex:17, type: 'metatag.php' }
  350. ]}],
  351. [{
  352. line: '<?php endfor ?>',
  353. tokens: [
  354. { startIndex:0, type: 'metatag.php' },
  355. { startIndex:5, type: '' },
  356. { startIndex:6, type: 'keyword.php' },
  357. { startIndex:12, type: '' },
  358. { startIndex:13, type: 'metatag.php' }
  359. ]}],
  360. [{
  361. line: '<?php endforeach ?>',
  362. tokens: [
  363. { startIndex:0, type: 'metatag.php' },
  364. { startIndex:5, type: '' },
  365. { startIndex:6, type: 'keyword.php' },
  366. { startIndex:16, type: '' },
  367. { startIndex:17, type: 'metatag.php' }
  368. ]}],
  369. [{
  370. line: '<?php endif ?>',
  371. tokens: [
  372. { startIndex:0, type: 'metatag.php' },
  373. { startIndex:5, type: '' },
  374. { startIndex:6, type: 'keyword.php' },
  375. { startIndex:11, type: '' },
  376. { startIndex:12, type: 'metatag.php' }
  377. ]}],
  378. [{
  379. line: '<?php endswitch ?>',
  380. tokens: [
  381. { startIndex:0, type: 'metatag.php' },
  382. { startIndex:5, type: '' },
  383. { startIndex:6, type: 'keyword.php' },
  384. { startIndex:15, type: '' },
  385. { startIndex:16, type: 'metatag.php' }
  386. ]}],
  387. [{
  388. line: '<?php endwhile ?>',
  389. tokens: [
  390. { startIndex:0, type: 'metatag.php' },
  391. { startIndex:5, type: '' },
  392. { startIndex:6, type: 'keyword.php' },
  393. { startIndex:14, type: '' },
  394. { startIndex:15, type: 'metatag.php' }
  395. ]}],
  396. [{
  397. line: '<?php extends ?>',
  398. tokens: [
  399. { startIndex:0, type: 'metatag.php' },
  400. { startIndex:5, type: '' },
  401. { startIndex:6, type: 'keyword.php' },
  402. { startIndex:13, type: '' },
  403. { startIndex:14, type: 'metatag.php' }
  404. ]}],
  405. [{
  406. line: '<?php false ?>',
  407. tokens: [
  408. { startIndex:0, type: 'metatag.php' },
  409. { startIndex:5, type: '' },
  410. { startIndex:6, type: 'keyword.php' },
  411. { startIndex:11, type: '' },
  412. { startIndex:12, type: 'metatag.php' }
  413. ]}],
  414. [{
  415. line: '<?php final ?>',
  416. tokens: [
  417. { startIndex:0, type: 'metatag.php' },
  418. { startIndex:5, type: '' },
  419. { startIndex:6, type: 'keyword.php' },
  420. { startIndex:11, type: '' },
  421. { startIndex:12, type: 'metatag.php' }
  422. ]}],
  423. [{
  424. line: '<?php for ?>',
  425. tokens: [
  426. { startIndex:0, type: 'metatag.php' },
  427. { startIndex:5, type: '' },
  428. { startIndex:6, type: 'keyword.php' },
  429. { startIndex:9, type: '' },
  430. { startIndex:10, type: 'metatag.php' }
  431. ]}],
  432. [{
  433. line: '<?php foreach ?>',
  434. tokens: [
  435. { startIndex:0, type: 'metatag.php' },
  436. { startIndex:5, type: '' },
  437. { startIndex:6, type: 'keyword.php' },
  438. { startIndex:13, type: '' },
  439. { startIndex:14, type: 'metatag.php' }
  440. ]}],
  441. [{
  442. line: '<?php function ?>',
  443. tokens: [
  444. { startIndex:0, type: 'metatag.php' },
  445. { startIndex:5, type: '' },
  446. { startIndex:6, type: 'keyword.php' },
  447. { startIndex:14, type: '' },
  448. { startIndex:15, type: 'metatag.php' }
  449. ]}],
  450. [{
  451. line: '<?php global ?>',
  452. tokens: [
  453. { startIndex:0, type: 'metatag.php' },
  454. { startIndex:5, type: '' },
  455. { startIndex:6, type: 'keyword.php' },
  456. { startIndex:12, type: '' },
  457. { startIndex:13, type: 'metatag.php' }
  458. ]}],
  459. [{
  460. line: '<?php goto ?>',
  461. tokens: [
  462. { startIndex:0, type: 'metatag.php' },
  463. { startIndex:5, type: '' },
  464. { startIndex:6, type: 'keyword.php' },
  465. { startIndex:10, type: '' },
  466. { startIndex:11, type: 'metatag.php' }
  467. ]}],
  468. [{
  469. line: '<?php if ?>',
  470. tokens: [
  471. { startIndex:0, type: 'metatag.php' },
  472. { startIndex:5, type: '' },
  473. { startIndex:6, type: 'keyword.php' },
  474. { startIndex:8, type: '' },
  475. { startIndex:9, type: 'metatag.php' }
  476. ]}],
  477. [{
  478. line: '<?php implements ?>',
  479. tokens: [
  480. { startIndex:0, type: 'metatag.php' },
  481. { startIndex:5, type: '' },
  482. { startIndex:6, type: 'keyword.php' },
  483. { startIndex:16, type: '' },
  484. { startIndex:17, type: 'metatag.php' }
  485. ]}],
  486. [{
  487. line: '<?php interface ?>',
  488. tokens: [
  489. { startIndex:0, type: 'metatag.php' },
  490. { startIndex:5, type: '' },
  491. { startIndex:6, type: 'keyword.php' },
  492. { startIndex:15, type: '' },
  493. { startIndex:16, type: 'metatag.php' }
  494. ]}],
  495. [{
  496. line: '<?php instanceof ?>',
  497. tokens: [
  498. { startIndex:0, type: 'metatag.php' },
  499. { startIndex:5, type: '' },
  500. { startIndex:6, type: 'keyword.php' },
  501. { startIndex:16, type: '' },
  502. { startIndex:17, type: 'metatag.php' }
  503. ]}],
  504. [{
  505. line: '<?php namespace ?>',
  506. tokens: [
  507. { startIndex:0, type: 'metatag.php' },
  508. { startIndex:5, type: '' },
  509. { startIndex:6, type: 'keyword.php' },
  510. { startIndex:15, type: '' },
  511. { startIndex:16, type: 'metatag.php' }
  512. ]}],
  513. [{
  514. line: '<?php new ?>',
  515. tokens: [
  516. { startIndex:0, type: 'metatag.php' },
  517. { startIndex:5, type: '' },
  518. { startIndex:6, type: 'keyword.php' },
  519. { startIndex:9, type: '' },
  520. { startIndex:10, type: 'metatag.php' }
  521. ]}],
  522. [{
  523. line: '<?php null ?>',
  524. tokens: [
  525. { startIndex:0, type: 'metatag.php' },
  526. { startIndex:5, type: '' },
  527. { startIndex:6, type: 'keyword.php' },
  528. { startIndex:10, type: '' },
  529. { startIndex:11, type: 'metatag.php' }
  530. ]}],
  531. [{
  532. line: '<?php object ?>',
  533. tokens: [
  534. { startIndex:0, type: 'metatag.php' },
  535. { startIndex:5, type: '' },
  536. { startIndex:6, type: 'keyword.php' },
  537. { startIndex:12, type: '' },
  538. { startIndex:13, type: 'metatag.php' }
  539. ]}],
  540. [{
  541. line: '<?php old_function ?>',
  542. tokens: [
  543. { startIndex:0, type: 'metatag.php' },
  544. { startIndex:5, type: '' },
  545. { startIndex:6, type: 'keyword.php' },
  546. { startIndex:18, type: '' },
  547. { startIndex:19, type: 'metatag.php' }
  548. ]}],
  549. [{
  550. line: '<?php or ?>',
  551. tokens: [
  552. { startIndex:0, type: 'metatag.php' },
  553. { startIndex:5, type: '' },
  554. { startIndex:6, type: 'keyword.php' },
  555. { startIndex:8, type: '' },
  556. { startIndex:9, type: 'metatag.php' }
  557. ]}],
  558. [{
  559. line: '<?php private ?>',
  560. tokens: [
  561. { startIndex:0, type: 'metatag.php' },
  562. { startIndex:5, type: '' },
  563. { startIndex:6, type: 'keyword.php' },
  564. { startIndex:13, type: '' },
  565. { startIndex:14, type: 'metatag.php' }
  566. ]}],
  567. [{
  568. line: '<?php protected ?>',
  569. tokens: [
  570. { startIndex:0, type: 'metatag.php' },
  571. { startIndex:5, type: '' },
  572. { startIndex:6, type: 'keyword.php' },
  573. { startIndex:15, type: '' },
  574. { startIndex:16, type: 'metatag.php' }
  575. ]}],
  576. [{
  577. line: '<?php public ?>',
  578. tokens: [
  579. { startIndex:0, type: 'metatag.php' },
  580. { startIndex:5, type: '' },
  581. { startIndex:6, type: 'keyword.php' },
  582. { startIndex:12, type: '' },
  583. { startIndex:13, type: 'metatag.php' }
  584. ]}],
  585. [{
  586. line: '<?php resource ?>',
  587. tokens: [
  588. { startIndex:0, type: 'metatag.php' },
  589. { startIndex:5, type: '' },
  590. { startIndex:6, type: 'keyword.php' },
  591. { startIndex:14, type: '' },
  592. { startIndex:15, type: 'metatag.php' }
  593. ]}],
  594. [{
  595. line: '<?php static ?>',
  596. tokens: [
  597. { startIndex:0, type: 'metatag.php' },
  598. { startIndex:5, type: '' },
  599. { startIndex:6, type: 'keyword.php' },
  600. { startIndex:12, type: '' },
  601. { startIndex:13, type: 'metatag.php' }
  602. ]}],
  603. [{
  604. line: '<?php switch ?>',
  605. tokens: [
  606. { startIndex:0, type: 'metatag.php' },
  607. { startIndex:5, type: '' },
  608. { startIndex:6, type: 'keyword.php' },
  609. { startIndex:12, type: '' },
  610. { startIndex:13, type: 'metatag.php' }
  611. ]}],
  612. [{
  613. line: '<?php throw ?>',
  614. tokens: [
  615. { startIndex:0, type: 'metatag.php' },
  616. { startIndex:5, type: '' },
  617. { startIndex:6, type: 'keyword.php' },
  618. { startIndex:11, type: '' },
  619. { startIndex:12, type: 'metatag.php' }
  620. ]}],
  621. [{
  622. line: '<?php try ?>',
  623. tokens: [
  624. { startIndex:0, type: 'metatag.php' },
  625. { startIndex:5, type: '' },
  626. { startIndex:6, type: 'keyword.php' },
  627. { startIndex:9, type: '' },
  628. { startIndex:10, type: 'metatag.php' }
  629. ]}],
  630. [{
  631. line: '<?php true ?>',
  632. tokens: [
  633. { startIndex:0, type: 'metatag.php' },
  634. { startIndex:5, type: '' },
  635. { startIndex:6, type: 'keyword.php' },
  636. { startIndex:10, type: '' },
  637. { startIndex:11, type: 'metatag.php' }
  638. ]}],
  639. [{
  640. line: '<?php use ?>',
  641. tokens: [
  642. { startIndex:0, type: 'metatag.php' },
  643. { startIndex:5, type: '' },
  644. { startIndex:6, type: 'keyword.php' },
  645. { startIndex:9, type: '' },
  646. { startIndex:10, type: 'metatag.php' }
  647. ]}],
  648. [{
  649. line: '<?php var ?>',
  650. tokens: [
  651. { startIndex:0, type: 'metatag.php' },
  652. { startIndex:5, type: '' },
  653. { startIndex:6, type: 'keyword.php' },
  654. { startIndex:9, type: '' },
  655. { startIndex:10, type: 'metatag.php' }
  656. ]}],
  657. [{
  658. line: '<?php while ?>',
  659. tokens: [
  660. { startIndex:0, type: 'metatag.php' },
  661. { startIndex:5, type: '' },
  662. { startIndex:6, type: 'keyword.php' },
  663. { startIndex:11, type: '' },
  664. { startIndex:12, type: 'metatag.php' }
  665. ]}],
  666. [{
  667. line: '<?php xor ?>',
  668. tokens: [
  669. { startIndex:0, type: 'metatag.php' },
  670. { startIndex:5, type: '' },
  671. { startIndex:6, type: 'keyword.php' },
  672. { startIndex:9, type: '' },
  673. { startIndex:10, type: 'metatag.php' }
  674. ]}],
  675. [{
  676. line: '<?php die ?>',
  677. tokens: [
  678. { startIndex:0, type: 'metatag.php' },
  679. { startIndex:5, type: '' },
  680. { startIndex:6, type: 'keyword.php' },
  681. { startIndex:9, type: '' },
  682. { startIndex:10, type: 'metatag.php' }
  683. ]}],
  684. [{
  685. line: '<?php echo ?>',
  686. tokens: [
  687. { startIndex:0, type: 'metatag.php' },
  688. { startIndex:5, type: '' },
  689. { startIndex:6, type: 'keyword.php' },
  690. { startIndex:10, type: '' },
  691. { startIndex:11, type: 'metatag.php' }
  692. ]}],
  693. [{
  694. line: '<?php empty ?>',
  695. tokens: [
  696. { startIndex:0, type: 'metatag.php' },
  697. { startIndex:5, type: '' },
  698. { startIndex:6, type: 'keyword.php' },
  699. { startIndex:11, type: '' },
  700. { startIndex:12, type: 'metatag.php' }
  701. ]}],
  702. [{
  703. line: '<?php exit ?>',
  704. tokens: [
  705. { startIndex:0, type: 'metatag.php' },
  706. { startIndex:5, type: '' },
  707. { startIndex:6, type: 'keyword.php' },
  708. { startIndex:10, type: '' },
  709. { startIndex:11, type: 'metatag.php' }
  710. ]}],
  711. [{
  712. line: '<?php eval ?>',
  713. tokens: [
  714. { startIndex:0, type: 'metatag.php' },
  715. { startIndex:5, type: '' },
  716. { startIndex:6, type: 'keyword.php' },
  717. { startIndex:10, type: '' },
  718. { startIndex:11, type: 'metatag.php' }
  719. ]}],
  720. [{
  721. line: '<?php include ?>',
  722. tokens: [
  723. { startIndex:0, type: 'metatag.php' },
  724. { startIndex:5, type: '' },
  725. { startIndex:6, type: 'keyword.php' },
  726. { startIndex:13, type: '' },
  727. { startIndex:14, type: 'metatag.php' }
  728. ]}],
  729. [{
  730. line: '<?php include_once ?>',
  731. tokens: [
  732. { startIndex:0, type: 'metatag.php' },
  733. { startIndex:5, type: '' },
  734. { startIndex:6, type: 'keyword.php' },
  735. { startIndex:18, type: '' },
  736. { startIndex:19, type: 'metatag.php' }
  737. ]}],
  738. [{
  739. line: '<?php isset ?>',
  740. tokens: [
  741. { startIndex:0, type: 'metatag.php' },
  742. { startIndex:5, type: '' },
  743. { startIndex:6, type: 'keyword.php' },
  744. { startIndex:11, type: '' },
  745. { startIndex:12, type: 'metatag.php' }
  746. ]}],
  747. [{
  748. line: '<?php list ?>',
  749. tokens: [
  750. { startIndex:0, type: 'metatag.php' },
  751. { startIndex:5, type: '' },
  752. { startIndex:6, type: 'keyword.php' },
  753. { startIndex:10, type: '' },
  754. { startIndex:11, type: 'metatag.php' }
  755. ]}],
  756. [{
  757. line: '<?php require ?>',
  758. tokens: [
  759. { startIndex:0, type: 'metatag.php' },
  760. { startIndex:5, type: '' },
  761. { startIndex:6, type: 'keyword.php' },
  762. { startIndex:13, type: '' },
  763. { startIndex:14, type: 'metatag.php' }
  764. ]}],
  765. [{
  766. line: '<?php require_once ?>',
  767. tokens: [
  768. { startIndex:0, type: 'metatag.php' },
  769. { startIndex:5, type: '' },
  770. { startIndex:6, type: 'keyword.php' },
  771. { startIndex:18, type: '' },
  772. { startIndex:19, type: 'metatag.php' }
  773. ]}],
  774. [{
  775. line: '<?php return ?>',
  776. tokens: [
  777. { startIndex:0, type: 'metatag.php' },
  778. { startIndex:5, type: '' },
  779. { startIndex:6, type: 'keyword.php' },
  780. { startIndex:12, type: '' },
  781. { startIndex:13, type: 'metatag.php' }
  782. ]}],
  783. [{
  784. line: '<?php print ?>',
  785. tokens: [
  786. { startIndex:0, type: 'metatag.php' },
  787. { startIndex:5, type: '' },
  788. { startIndex:6, type: 'keyword.php' },
  789. { startIndex:11, type: '' },
  790. { startIndex:12, type: 'metatag.php' }
  791. ]}],
  792. [{
  793. line: '<?php unset ?>',
  794. tokens: [
  795. { startIndex:0, type: 'metatag.php' },
  796. { startIndex:5, type: '' },
  797. { startIndex:6, type: 'keyword.php' },
  798. { startIndex:11, type: '' },
  799. { startIndex:12, type: 'metatag.php' }
  800. ]}],
  801. [{
  802. line: '<?php __construct ?>',
  803. tokens: [
  804. { startIndex:0, type: 'metatag.php' },
  805. { startIndex:5, type: '' },
  806. { startIndex:6, type: 'keyword.php' },
  807. { startIndex:17, type: '' },
  808. { startIndex:18, type: 'metatag.php' }
  809. ]}],
  810. // Compile Time Constants
  811. [{
  812. line: '<?php __FILE__ ?>',
  813. tokens: [
  814. { startIndex:0, type: 'metatag.php' },
  815. { startIndex:5, type: '' },
  816. { startIndex:6, type: 'constant.php' },
  817. { startIndex:14, type: '' },
  818. { startIndex:15, type: 'metatag.php' }
  819. ]}],
  820. [{
  821. line: '<?php $myscript = __FILE__; ?>',
  822. tokens: [
  823. { startIndex:0, type: 'metatag.php' },
  824. { startIndex:5, type: '' },
  825. { startIndex:6, type: 'variable.php' },
  826. { startIndex:15, type: '' },
  827. { startIndex:16, type: 'delimiter.php' },
  828. { startIndex:17, type: '' },
  829. { startIndex:18, type: 'constant.php' },
  830. { startIndex:26, type: 'delimiter.php' },
  831. { startIndex:27, type: '' },
  832. { startIndex:28, type: 'metatag.php' }
  833. ]}],
  834. [{
  835. line: '<?php __CLASS__ ?>',
  836. tokens: [
  837. { startIndex:0, type: 'metatag.php' },
  838. { startIndex:5, type: '' },
  839. { startIndex:6, type: 'constant.php' },
  840. { startIndex:15, type: '' },
  841. { startIndex:16, type: 'metatag.php' }
  842. ]}],
  843. [{
  844. line: '<?php __DIR__ ?>',
  845. tokens: [
  846. { startIndex:0, type: 'metatag.php' },
  847. { startIndex:5, type: '' },
  848. { startIndex:6, type: 'constant.php' },
  849. { startIndex:13, type: '' },
  850. { startIndex:14, type: 'metatag.php' }
  851. ]}],
  852. [{
  853. line: '<?php __LINE__ ?>',
  854. tokens: [
  855. { startIndex:0, type: 'metatag.php' },
  856. { startIndex:5, type: '' },
  857. { startIndex:6, type: 'constant.php' },
  858. { startIndex:14, type: '' },
  859. { startIndex:15, type: 'metatag.php' }
  860. ]}],
  861. [{
  862. line: '<?php __NAMESPACE__ ?>',
  863. tokens: [
  864. { startIndex:0, type: 'metatag.php' },
  865. { startIndex:5, type: '' },
  866. { startIndex:6, type: 'constant.php' },
  867. { startIndex:19, type: '' },
  868. { startIndex:20, type: 'metatag.php' }
  869. ]}],
  870. [{
  871. line: '<?php __METHOD__ ?>',
  872. tokens: [
  873. { startIndex:0, type: 'metatag.php' },
  874. { startIndex:5, type: '' },
  875. { startIndex:6, type: 'constant.php' },
  876. { startIndex:16, type: '' },
  877. { startIndex:17, type: 'metatag.php' }
  878. ]}],
  879. [{
  880. line: '<?php __FUNCTION__ ?>',
  881. tokens: [
  882. { startIndex:0, type: 'metatag.php' },
  883. { startIndex:5, type: '' },
  884. { startIndex:6, type: 'constant.php' },
  885. { startIndex:18, type: '' },
  886. { startIndex:19, type: 'metatag.php' }
  887. ]}],
  888. [{
  889. line: '<?php __TRAIT__ ?>',
  890. tokens: [
  891. { startIndex:0, type: 'metatag.php' },
  892. { startIndex:5, type: '' },
  893. { startIndex:6, type: 'constant.php' },
  894. { startIndex:15, type: '' },
  895. { startIndex:16, type: 'metatag.php' }
  896. ]}],
  897. // Predefined Variables
  898. [{
  899. line: '<?php $_ENV ?>',
  900. tokens: [
  901. { startIndex:0, type: 'metatag.php' },
  902. { startIndex:5, type: '' },
  903. { startIndex:6, type: 'variable.predefined.php' },
  904. { startIndex:11, type: '' },
  905. { startIndex:12, type: 'metatag.php' }
  906. ]}],
  907. [{
  908. line: '<?php echo $_ENV; ?>',
  909. tokens: [
  910. { startIndex:0, type: 'metatag.php' },
  911. { startIndex:5, type: '' },
  912. { startIndex:6, type: 'keyword.php' },
  913. { startIndex:10, type: '' },
  914. { startIndex:11, type: 'variable.predefined.php' },
  915. { startIndex:16, type: 'delimiter.php' },
  916. { startIndex:17, type: '' },
  917. { startIndex:18, type: 'metatag.php' }
  918. ]}],
  919. [{
  920. line: '<?php $GLOBALS ?>',
  921. tokens: [
  922. { startIndex:0, type: 'metatag.php' },
  923. { startIndex:5, type: '' },
  924. { startIndex:6, type: 'variable.predefined.php' },
  925. { startIndex:14, type: '' },
  926. { startIndex:15, type: 'metatag.php' }
  927. ]}],
  928. [{
  929. line: '<?php $_SERVER ?>',
  930. tokens: [
  931. { startIndex:0, type: 'metatag.php' },
  932. { startIndex:5, type: '' },
  933. { startIndex:6, type: 'variable.predefined.php' },
  934. { startIndex:14, type: '' },
  935. { startIndex:15, type: 'metatag.php' }
  936. ]}],
  937. [{
  938. line: '<?php $_GET ?>',
  939. tokens: [
  940. { startIndex:0, type: 'metatag.php' },
  941. { startIndex:5, type: '' },
  942. { startIndex:6, type: 'variable.predefined.php' },
  943. { startIndex:11, type: '' },
  944. { startIndex:12, type: 'metatag.php' }
  945. ]}],
  946. [{
  947. line: '<?php $_POST ?>',
  948. tokens: [
  949. { startIndex:0, type: 'metatag.php' },
  950. { startIndex:5, type: '' },
  951. { startIndex:6, type: 'variable.predefined.php' },
  952. { startIndex:12, type: '' },
  953. { startIndex:13, type: 'metatag.php' }
  954. ]}],
  955. [{
  956. line: '<?php $_FILES ?>',
  957. tokens: [
  958. { startIndex:0, type: 'metatag.php' },
  959. { startIndex:5, type: '' },
  960. { startIndex:6, type: 'variable.predefined.php' },
  961. { startIndex:13, type: '' },
  962. { startIndex:14, type: 'metatag.php' }
  963. ]}],
  964. [{
  965. line: '<?php $_REQUEST ?>',
  966. tokens: [
  967. { startIndex:0, type: 'metatag.php' },
  968. { startIndex:5, type: '' },
  969. { startIndex:6, type: 'variable.predefined.php' },
  970. { startIndex:15, type: '' },
  971. { startIndex:16, type: 'metatag.php' }
  972. ]}],
  973. [{
  974. line: '<?php $_SESSION ?>',
  975. tokens: [
  976. { startIndex:0, type: 'metatag.php' },
  977. { startIndex:5, type: '' },
  978. { startIndex:6, type: 'variable.predefined.php' },
  979. { startIndex:15, type: '' },
  980. { startIndex:16, type: 'metatag.php' }
  981. ]}],
  982. [{
  983. line: '<?php $_ENV ?>',
  984. tokens: [
  985. { startIndex:0, type: 'metatag.php' },
  986. { startIndex:5, type: '' },
  987. { startIndex:6, type: 'variable.predefined.php' },
  988. { startIndex:11, type: '' },
  989. { startIndex:12, type: 'metatag.php' }
  990. ]}],
  991. [{
  992. line: '<?php $_COOKIE ?>',
  993. tokens: [
  994. { startIndex:0, type: 'metatag.php' },
  995. { startIndex:5, type: '' },
  996. { startIndex:6, type: 'variable.predefined.php' },
  997. { startIndex:14, type: '' },
  998. { startIndex:15, type: 'metatag.php' }
  999. ]}],
  1000. [{
  1001. line: '<?php $php_errormsg ?>',
  1002. tokens: [
  1003. { startIndex:0, type: 'metatag.php' },
  1004. { startIndex:5, type: '' },
  1005. { startIndex:6, type: 'variable.predefined.php' },
  1006. { startIndex:19, type: '' },
  1007. { startIndex:20, type: 'metatag.php' }
  1008. ]}],
  1009. [{
  1010. line: '<?php $HTTP_RAW_POST_DATA ?>',
  1011. tokens: [
  1012. { startIndex:0, type: 'metatag.php' },
  1013. { startIndex:5, type: '' },
  1014. { startIndex:6, type: 'variable.predefined.php' },
  1015. { startIndex:25, type: '' },
  1016. { startIndex:26, type: 'metatag.php' }
  1017. ]}],
  1018. [{
  1019. line: '<?php $http_response_header ?>',
  1020. tokens: [
  1021. { startIndex:0, type: 'metatag.php' },
  1022. { startIndex:5, type: '' },
  1023. { startIndex:6, type: 'variable.predefined.php' },
  1024. { startIndex:27, type: '' },
  1025. { startIndex:28, type: 'metatag.php' }
  1026. ]}],
  1027. [{
  1028. line: '<?php $argc ?>',
  1029. tokens: [
  1030. { startIndex:0, type: 'metatag.php' },
  1031. { startIndex:5, type: '' },
  1032. { startIndex:6, type: 'variable.predefined.php' },
  1033. { startIndex:11, type: '' },
  1034. { startIndex:12, type: 'metatag.php' }
  1035. ]}],
  1036. [{
  1037. line: '<?php $argv ?>',
  1038. tokens: [
  1039. { startIndex:0, type: 'metatag.php' },
  1040. { startIndex:5, type: '' },
  1041. { startIndex:6, type: 'variable.predefined.php' },
  1042. { startIndex:11, type: '' },
  1043. { startIndex:12, type: 'metatag.php' }
  1044. ]}],
  1045. // Comments - single line
  1046. [{
  1047. line: '<?php // a',
  1048. tokens: [
  1049. { startIndex:0, type: 'metatag.php' },
  1050. { startIndex:5, type: '' },
  1051. { startIndex:6, type: 'comment.php' }
  1052. ]}],
  1053. [{
  1054. line: '<?php / / / not a comment',
  1055. tokens: [
  1056. { startIndex:0, type: 'metatag.php' },
  1057. { startIndex:5, type: '' },
  1058. { startIndex:6, type: 'delimiter.php' },
  1059. { startIndex:7, type: '' },
  1060. { startIndex:8, type: 'delimiter.php' },
  1061. { startIndex:9, type: '' },
  1062. { startIndex:10, type: 'delimiter.php' },
  1063. { startIndex:11, type: '' },
  1064. { startIndex:12, type: 'identifier.php' },
  1065. { startIndex:15, type: '' },
  1066. { startIndex:16, type: 'identifier.php' },
  1067. { startIndex:17, type: '' },
  1068. { startIndex:18, type: 'identifier.php' },
  1069. ]}],
  1070. [{
  1071. line: '<?php // a comment',
  1072. tokens: [
  1073. { startIndex:0, type: 'metatag.php' },
  1074. { startIndex:5, type: '' },
  1075. { startIndex:9, type: 'comment.php' }
  1076. ]}],
  1077. [{
  1078. line: '<?php // a comment',
  1079. tokens: [
  1080. { startIndex:0, type: 'metatag.php' },
  1081. { startIndex:5, type: '' },
  1082. { startIndex:6, type: 'comment.php' }
  1083. ]}],
  1084. [{
  1085. line: '<?php //sticky comment',
  1086. tokens: [
  1087. { startIndex:0, type: 'metatag.php' },
  1088. { startIndex:5, type: '' },
  1089. { startIndex:6, type: 'comment.php' }
  1090. ]}],
  1091. [{
  1092. line: '<?php /almost a comment',
  1093. tokens: [
  1094. { startIndex:0, type: 'metatag.php' },
  1095. { startIndex:5, type: '' },
  1096. { startIndex:6, type: 'delimiter.php' },
  1097. { startIndex:7, type: 'identifier.php' },
  1098. { startIndex:13, type: '' },
  1099. { startIndex:14, type: 'identifier.php' },
  1100. { startIndex:15, type: '' },
  1101. { startIndex:16, type: 'identifier.php' },
  1102. ]}],
  1103. [{
  1104. line: '<?php $x = 1; // my comment // is a nice one',
  1105. tokens: [
  1106. { startIndex:0, type: 'metatag.php' },
  1107. { startIndex:5, type: '' },
  1108. { startIndex:6, type: 'variable.php' },
  1109. { startIndex:8, type: '' },
  1110. { startIndex:9, type: 'delimiter.php' },
  1111. { startIndex:10, type: '' },
  1112. { startIndex:11, type: 'number.php' },
  1113. { startIndex:12, type: 'delimiter.php' },
  1114. { startIndex:13, type: '' },
  1115. { startIndex:14, type: 'comment.php' }
  1116. ]}],
  1117. // Comments - range comment, single line
  1118. [{
  1119. line: '<?php /* a simple comment */ ?>',
  1120. tokens: [
  1121. { startIndex:0, type: 'metatag.php' },
  1122. { startIndex:5, type: '' },
  1123. { startIndex:6, type: 'comment.php' },
  1124. { startIndex:28, type: '' },
  1125. { startIndex:29, type: 'metatag.php' }
  1126. ]}],
  1127. [{
  1128. line: '<?php $x = /* a simple comment */ 1; ?>',
  1129. tokens: [
  1130. { startIndex:0, type: 'metatag.php' },
  1131. { startIndex:5, type: '' },
  1132. { startIndex:6, type: 'variable.php' },
  1133. { startIndex:8, type: '' },
  1134. { startIndex:9, type: 'delimiter.php' },
  1135. { startIndex:10, type: '' },
  1136. { startIndex:11, type: 'comment.php' },
  1137. { startIndex:33, type: '' },
  1138. { startIndex:34, type: 'number.php' },
  1139. { startIndex:35, type: 'delimiter.php' },
  1140. { startIndex:36, type: '' },
  1141. { startIndex:37, type: 'metatag.php' }
  1142. ]}],
  1143. [{
  1144. line: '<?php $x = /* comment */ 1; */ ?>',
  1145. tokens: [
  1146. { startIndex:0, type: 'metatag.php' },
  1147. { startIndex:5, type: '' },
  1148. { startIndex:6, type: 'variable.php' },
  1149. { startIndex:8, type: '' },
  1150. { startIndex:9, type: 'delimiter.php' },
  1151. { startIndex:10, type: '' },
  1152. { startIndex:11, type: 'comment.php' },
  1153. { startIndex:24, type: '' },
  1154. { startIndex:25, type: 'number.php' },
  1155. { startIndex:26, type: 'delimiter.php' },
  1156. { startIndex:27, type: '' },
  1157. { startIndex:28, type: 'delimiter.php' },
  1158. { startIndex:30, type: '' },
  1159. { startIndex:31, type: 'metatag.php' }
  1160. ]}],
  1161. [{
  1162. line: '<?php $x = /**/; ?>',
  1163. tokens: [
  1164. { startIndex:0, type: 'metatag.php' },
  1165. { startIndex:5, type: '' },
  1166. { startIndex:6, type: 'variable.php' },
  1167. { startIndex:8, type: '' },
  1168. { startIndex:9, type: 'delimiter.php' },
  1169. { startIndex:10, type: '' },
  1170. { startIndex:11, type: 'comment.php' },
  1171. { startIndex:15, type: 'delimiter.php' },
  1172. { startIndex:16, type: '' },
  1173. { startIndex:17, type: 'metatag.php' }
  1174. ]}],
  1175. [{
  1176. line: '<?php $x = /*/;',
  1177. tokens: [
  1178. { startIndex:0, type: 'metatag.php' },
  1179. { startIndex:5, type: '' },
  1180. { startIndex:6, type: 'variable.php' },
  1181. { startIndex:8, type: '' },
  1182. { startIndex:9, type: 'delimiter.php' },
  1183. { startIndex:10, type: '' },
  1184. { startIndex:11, type: 'comment.php' }
  1185. ]}],
  1186. // Comments - range comment, multi lines
  1187. [{
  1188. line: '<?php /* a multiline comment',
  1189. tokens: [
  1190. { startIndex:0, type: 'metatag.php' },
  1191. { startIndex:5, type: '' },
  1192. { startIndex:6, type: 'comment.php' }
  1193. ]}, {
  1194. line: 'can actually span',
  1195. tokens: [
  1196. { startIndex:0, type: 'comment.php' }
  1197. ]}, {
  1198. line: 'multiple lines */',
  1199. tokens: [
  1200. { startIndex:0, type: 'comment.php' }
  1201. ]}],
  1202. [{
  1203. line: '<?php $x = /* start a comment',
  1204. tokens: [
  1205. { startIndex:0, type: 'metatag.php' },
  1206. { startIndex:5, type: '' },
  1207. { startIndex:6, type: 'variable.php' },
  1208. { startIndex:8, type: '' },
  1209. { startIndex:9, type: 'delimiter.php' },
  1210. { startIndex:10, type: '' },
  1211. { startIndex:11, type: 'comment.php' }
  1212. ]}, {
  1213. line: ' a ',
  1214. tokens: [
  1215. { startIndex:0, type: 'comment.php' }
  1216. ]}, {
  1217. line: 'and end it */ var a = 2;',
  1218. tokens: [
  1219. { startIndex:0, type: 'comment.php' },
  1220. { startIndex:13, type: '' },
  1221. { startIndex:14, type: 'keyword.php' },
  1222. { startIndex:17, type: '' },
  1223. { startIndex:18, type: 'identifier.php' },
  1224. { startIndex:19, type: '' },
  1225. { startIndex:20, type: 'delimiter.php' },
  1226. { startIndex:21, type: '' },
  1227. { startIndex:22, type: 'number.php' },
  1228. { startIndex:23, type: 'delimiter.php' }
  1229. ]}],
  1230. // Strings
  1231. [{
  1232. line: '<?php $a = \'a\'; ?>',
  1233. tokens: [
  1234. { startIndex:0, type: 'metatag.php' },
  1235. { startIndex:5, type: '' },
  1236. { startIndex:6, type: 'variable.php' },
  1237. { startIndex:8, type: '' },
  1238. { startIndex:9, type: 'delimiter.php' },
  1239. { startIndex:10, type: '' },
  1240. { startIndex:11, type: 'string.php' },
  1241. { startIndex:14, type: 'delimiter.php' },
  1242. { startIndex:15, type: '' },
  1243. { startIndex:16, type: 'metatag.php' }
  1244. ]}],
  1245. [{
  1246. line: '<?php \'use strict\'; ?>',
  1247. tokens: [
  1248. { startIndex:0, type: 'metatag.php' },
  1249. { startIndex:5, type: '' },
  1250. { startIndex:6, type: 'string.php' },
  1251. { startIndex:18, type: 'delimiter.php' },
  1252. { startIndex:19, type: '' },
  1253. { startIndex:20, type: 'metatag.php' }
  1254. ]}],
  1255. [{
  1256. line: '<?php $b = $a + " \'cool\' " ?>',
  1257. tokens: [
  1258. { startIndex:0, type: 'metatag.php' },
  1259. { startIndex:5, type: '' },
  1260. { startIndex:6, type: 'variable.php' },
  1261. { startIndex:8, type: '' },
  1262. { startIndex:9, type: 'delimiter.php' },
  1263. { startIndex:10, type: '' },
  1264. { startIndex:11, type: 'variable.php' },
  1265. { startIndex:13, type: '' },
  1266. { startIndex:14, type: 'delimiter.php' },
  1267. { startIndex:15, type: '' },
  1268. { startIndex:16, type: 'string.php' },
  1269. { startIndex:27, type: '' },
  1270. { startIndex:28, type: 'metatag.php' }
  1271. ]}],
  1272. [{
  1273. line: '<?php \'\'\'',
  1274. tokens: [
  1275. { startIndex:0, type: 'metatag.php' },
  1276. { startIndex:5, type: '' },
  1277. { startIndex:6, type: 'string.php' },
  1278. ]}],
  1279. [{
  1280. line: '<?php "multiline',
  1281. tokens: [
  1282. { startIndex:0, type: 'metatag.php' },
  1283. { startIndex:5, type: '' },
  1284. { startIndex:6, type: 'string.php' }
  1285. ]}, {
  1286. line: 'strings";',
  1287. tokens: [
  1288. { startIndex:0, type: 'string.php' },
  1289. { startIndex:8, type: 'delimiter.php' }
  1290. ]}],
  1291. // Numbers
  1292. [{
  1293. line: '<?php 0 ?>',
  1294. tokens: [
  1295. { startIndex:0, type: 'metatag.php' },
  1296. { startIndex:5, type: '' },
  1297. { startIndex:6, type: 'number.php' },
  1298. { startIndex:7, type: '' },
  1299. { startIndex:8, type: 'metatag.php' }
  1300. ]}],
  1301. [{
  1302. line: '<?php 0+0 ?>',
  1303. tokens: [
  1304. { startIndex:0, type: 'metatag.php' },
  1305. { startIndex:5, type: '' },
  1306. { startIndex:6, type: 'number.php' },
  1307. { startIndex:7, type: 'delimiter.php' },
  1308. { startIndex:8, type: 'number.php' },
  1309. { startIndex:9, type: '' },
  1310. { startIndex:10, type: 'metatag.php' }
  1311. ]}],
  1312. [{
  1313. line: '<?php 100+10 ?>',
  1314. tokens: [
  1315. { startIndex:0, type: 'metatag.php' },
  1316. { startIndex:5, type: '' },
  1317. { startIndex:6, type: 'number.php' },
  1318. { startIndex:9, type: 'delimiter.php' },
  1319. { startIndex:10, type: 'number.php' },
  1320. { startIndex:12, type: '' },
  1321. { startIndex:13, type: 'metatag.php' }
  1322. ]}],
  1323. [{
  1324. line: '<?php 0 + 0 ?>',
  1325. tokens: [
  1326. { startIndex:0, type: 'metatag.php' },
  1327. { startIndex:5, type: '' },
  1328. { startIndex:6, type: 'number.php' },
  1329. { startIndex:7, type: '' },
  1330. { startIndex:8, type: 'delimiter.php' },
  1331. { startIndex:9, type: '' },
  1332. { startIndex:10, type: 'number.php' },
  1333. { startIndex:11, type: '' },
  1334. { startIndex:12, type: 'metatag.php' }
  1335. ]}],
  1336. [{
  1337. line: '<?php 0123 ?>',
  1338. tokens: [
  1339. { startIndex:0, type: 'metatag.php' },
  1340. { startIndex:5, type: '' },
  1341. { startIndex:6, type: 'number.octal.php' },
  1342. { startIndex:10, type: '' },
  1343. { startIndex:11, type: 'metatag.php' }
  1344. ]}],
  1345. [{
  1346. line: '<?php 01239 ?>',
  1347. tokens: [
  1348. { startIndex:0, type: 'metatag.php' },
  1349. { startIndex:5, type: '' },
  1350. { startIndex:6, type: 'number.octal.php' },
  1351. { startIndex:10, type: 'number.php' },
  1352. { startIndex:11, type: '' },
  1353. { startIndex:12, type: 'metatag.php' }
  1354. ]}],
  1355. [{
  1356. line: '<?php 0x ?>',
  1357. tokens: [
  1358. { startIndex:0, type: 'metatag.php' },
  1359. { startIndex:5, type: '' },
  1360. { startIndex:6, type: 'number.php' },
  1361. { startIndex:7, type: 'identifier.php' },
  1362. { startIndex:8, type: '' },
  1363. { startIndex:9, type: 'metatag.php' }
  1364. ]}],
  1365. [{
  1366. line: '<?php 0x123 ?>',
  1367. tokens: [
  1368. { startIndex:0, type: 'metatag.php' },
  1369. { startIndex:5, type: '' },
  1370. { startIndex:6, type: 'number.hex.php' },
  1371. { startIndex:11, type: '' },
  1372. { startIndex:12, type: 'metatag.php' }
  1373. ]}],
  1374. [{
  1375. line: '<?php 0b1 ?>',
  1376. tokens: [
  1377. { startIndex:0, type: 'metatag.php' },
  1378. { startIndex:5, type: '' },
  1379. { startIndex:6, type: 'number.binary.php' },
  1380. { startIndex:9, type: '' },
  1381. { startIndex:10, type: 'metatag.php' }
  1382. ]}],
  1383. [{
  1384. line: '<?php { } ?>',
  1385. tokens: [
  1386. { startIndex:0, type: 'metatag.php' },
  1387. { startIndex:5, type: '' },
  1388. { startIndex:6, type: 'delimiter.bracket.php' },
  1389. { startIndex:7, type: '' },
  1390. { startIndex:8, type: 'delimiter.bracket.php' },
  1391. { startIndex:9, type: '' },
  1392. { startIndex:10, type: 'metatag.php' }
  1393. ]}],
  1394. [{
  1395. line: '<?php [1,2,3] ?>',
  1396. tokens: [
  1397. { startIndex:0, type: 'metatag.php' },
  1398. { startIndex:5, type: '' },
  1399. { startIndex:6, type: 'delimiter.array.php' },
  1400. { startIndex:7, type: 'number.php' },
  1401. { startIndex:8, type: 'delimiter.php' },
  1402. { startIndex:9, type: 'number.php' },
  1403. { startIndex:10, type: 'delimiter.php' },
  1404. { startIndex:11, type: 'number.php' },
  1405. { startIndex:12, type: 'delimiter.array.php' },
  1406. { startIndex:13, type: '' },
  1407. { startIndex:14, type: 'metatag.php' }
  1408. ]}],
  1409. [{
  1410. line: '<?php foo(123);',
  1411. tokens: [
  1412. { startIndex:0, type: 'metatag.php' },
  1413. { startIndex:5, type: '' },
  1414. { startIndex:6, type: 'identifier.php' },
  1415. { startIndex:9, type: 'delimiter.parenthesis.php' },
  1416. { startIndex:10, type: 'number.php' },
  1417. { startIndex:13, type: 'delimiter.parenthesis.php' },
  1418. { startIndex:14, type: 'delimiter.php' }
  1419. ]}],
  1420. [{
  1421. line: '<?php $x = "[{()}]" ?>',
  1422. tokens: [
  1423. { startIndex:0, type: 'metatag.php' },
  1424. { startIndex:5, type: '' },
  1425. { startIndex:6, type: 'variable.php' },
  1426. { startIndex:8, type: '' },
  1427. { startIndex:9, type: 'delimiter.php' },
  1428. { startIndex:10, type: '' },
  1429. { startIndex:11, type: 'string.php' },
  1430. { startIndex:19, type: '' },
  1431. { startIndex:20, type: 'metatag.php' }
  1432. ]}],
  1433. // Comments - comment with sharp
  1434. [{
  1435. line: '<?php # a',
  1436. tokens: [
  1437. { startIndex:0, type: 'metatag.php' },
  1438. { startIndex:5, type: '' },
  1439. { startIndex:6, type: 'comment.php' }
  1440. ]}],
  1441. [{
  1442. line: '<?php ## a',
  1443. tokens: [
  1444. { startIndex:0, type: 'metatag.php' },
  1445. { startIndex:5, type: '' },
  1446. { startIndex:6, type: 'comment.php' }
  1447. ]}],
  1448. [{
  1449. line: '<?php # a comment',
  1450. tokens: [
  1451. { startIndex:0, type: 'metatag.php' },
  1452. { startIndex:5, type: '' },
  1453. { startIndex:9, type: 'comment.php' }
  1454. ]}],
  1455. [{
  1456. line: '<?php #sticky comment',
  1457. tokens: [
  1458. { startIndex:0, type: 'metatag.php' },
  1459. { startIndex:5, type: '' },
  1460. { startIndex:6, type: 'comment.php' }
  1461. ]}],
  1462. [{
  1463. line: '<?php $x = 1; # my comment // is a nice one',
  1464. tokens: [
  1465. { startIndex:0, type: 'metatag.php' },
  1466. { startIndex:5, type: '' },
  1467. { startIndex:6, type: 'variable.php' },
  1468. { startIndex:8, type: '' },
  1469. { startIndex:9, type: 'delimiter.php' },
  1470. { startIndex:10, type: '' },
  1471. { startIndex:11, type: 'number.php' },
  1472. { startIndex:12, type: 'delimiter.php' },
  1473. { startIndex:13, type: '' },
  1474. { startIndex:14, type: 'comment.php' }
  1475. ]}],
  1476. [{
  1477. line: '<?php # comment?>',
  1478. tokens: [
  1479. { startIndex:0, type: 'metatag.php' },
  1480. { startIndex:5, type: '' },
  1481. { startIndex:6, type: 'comment.php' },
  1482. { startIndex:15, type: 'metatag.php' }
  1483. ]}],
  1484. [{
  1485. line: '<?php # comment? ?>',
  1486. tokens: [
  1487. { startIndex:0, type: 'metatag.php' },
  1488. { startIndex:5, type: '' },
  1489. { startIndex:6, type: 'comment.php' },
  1490. { startIndex:17, type: 'metatag.php' }
  1491. ]}],
  1492. // 3-languages parser
  1493. // php
  1494. [{
  1495. line: '<?=\'hi\'?>',
  1496. tokens: [
  1497. { startIndex:0, type: 'metatag.php' },
  1498. { startIndex:3, type: 'string.php' },
  1499. { startIndex:7, type: 'metatag.php' }
  1500. ]}],
  1501. // php/html/php
  1502. [{
  1503. line: '<?php5+3?><br/><?=1?>',
  1504. tokens: [
  1505. { startIndex:0, type: 'metatag.php' },
  1506. { startIndex:5, type: 'number.php' },
  1507. { startIndex:6, type: 'delimiter.php' },
  1508. { startIndex:7, type: 'number.php' },
  1509. { startIndex:8, type: 'metatag.php' },
  1510. { startIndex:10, type: htmlTokenTypes.DELIM_START },
  1511. { startIndex:11, type: htmlTokenTypes.getTag('br') },
  1512. { startIndex:13, type: htmlTokenTypes.DELIM_END },
  1513. { startIndex:15, type: 'metatag.php' },
  1514. { startIndex:18, type: 'number.php' },
  1515. { startIndex:19, type: 'metatag.php' }
  1516. ]}],
  1517. // php/html/php
  1518. [{
  1519. line: '<?php5+3?><abc><?=1?>',
  1520. tokens: [
  1521. { startIndex:0, type: 'metatag.php' },
  1522. { startIndex:5, type: 'number.php' },
  1523. { startIndex:6, type: 'delimiter.php' },
  1524. { startIndex:7, type: 'number.php' },
  1525. { startIndex:8, type: 'metatag.php' },
  1526. { startIndex:10, type: htmlTokenTypes.DELIM_START },
  1527. { startIndex:11, type: htmlTokenTypes.getTag('abc') },
  1528. { startIndex:14, type: htmlTokenTypes.DELIM_END },
  1529. { startIndex:15, type: 'metatag.php' },
  1530. { startIndex:18, type: 'number.php' },
  1531. { startIndex:19, type: 'metatag.php' }
  1532. ]}],
  1533. // html/php/html
  1534. [{
  1535. line: '<abc><?php5+3?><abc>',
  1536. tokens: [
  1537. { startIndex:0, type: htmlTokenTypes.DELIM_START },
  1538. { startIndex:1, type: htmlTokenTypes.getTag('abc') },
  1539. { startIndex:4, type: htmlTokenTypes.DELIM_END },
  1540. { startIndex:5, type: 'metatag.php' },
  1541. { startIndex:10, type: 'number.php' },
  1542. { startIndex:11, type: 'delimiter.php' },
  1543. { startIndex:12, type: 'number.php' },
  1544. { startIndex:13, type: 'metatag.php' },
  1545. { startIndex:15, type: htmlTokenTypes.DELIM_START },
  1546. { startIndex:16, type: htmlTokenTypes.getTag('abc') },
  1547. { startIndex:19, type: htmlTokenTypes.DELIM_END }
  1548. ]}],
  1549. // html/js/php/html
  1550. [{
  1551. line: '<abc><script>var i= 10;</script><?php5+3?><abc>',
  1552. tokens: [
  1553. { startIndex:0, type: htmlTokenTypes.DELIM_START },
  1554. { startIndex:1, type: htmlTokenTypes.getTag('abc') },
  1555. { startIndex:4, type: htmlTokenTypes.DELIM_END },
  1556. { startIndex:5, type: htmlTokenTypes.DELIM_START },
  1557. { startIndex:6, type: htmlTokenTypes.getTag('script') },
  1558. { startIndex:12, type: htmlTokenTypes.DELIM_END },
  1559. { startIndex:13, type: '' },
  1560. { startIndex:23, type: htmlTokenTypes.DELIM_START },
  1561. { startIndex:25, type: htmlTokenTypes.getTag('script') },
  1562. { startIndex:31, type: htmlTokenTypes.DELIM_END },
  1563. { startIndex:32, type: 'metatag.php' },
  1564. { startIndex:37, type: 'number.php' },
  1565. { startIndex:38, type: 'delimiter.php' },
  1566. { startIndex:39, type: 'number.php' },
  1567. { startIndex:40, type: 'metatag.php' },
  1568. { startIndex:42, type: htmlTokenTypes.DELIM_START },
  1569. { startIndex:43, type: htmlTokenTypes.getTag('abc') },
  1570. { startIndex:46, type: htmlTokenTypes.DELIM_END }
  1571. ]}],
  1572. // html/js/php/js/
  1573. [{
  1574. line: '<abc><script>var i= 10;</script><?php5+3?><script>var x= 15;</script>',
  1575. tokens: [
  1576. { startIndex:0, type: htmlTokenTypes.DELIM_START },
  1577. { startIndex:1, type: htmlTokenTypes.getTag('abc') },
  1578. { startIndex:4, type: htmlTokenTypes.DELIM_END },
  1579. { startIndex:5, type: htmlTokenTypes.DELIM_START },
  1580. { startIndex:6, type: htmlTokenTypes.getTag('script') },
  1581. { startIndex:12, type: htmlTokenTypes.DELIM_END },
  1582. { startIndex:13, type: '' },
  1583. { startIndex:23, type: htmlTokenTypes.DELIM_START },
  1584. { startIndex:25, type: htmlTokenTypes.getTag('script') },
  1585. { startIndex:31, type: htmlTokenTypes.DELIM_END },
  1586. { startIndex:32, type: 'metatag.php' },
  1587. { startIndex:37, type: 'number.php' },
  1588. { startIndex:38, type: 'delimiter.php' },
  1589. { startIndex:39, type: 'number.php' },
  1590. { startIndex:40, type: 'metatag.php' },
  1591. { startIndex:42, type: htmlTokenTypes.DELIM_START },
  1592. { startIndex:43, type: htmlTokenTypes.getTag('script') },
  1593. { startIndex:49, type: htmlTokenTypes.DELIM_END },
  1594. { startIndex:50, type: '' },
  1595. { startIndex:60, type: htmlTokenTypes.DELIM_START },
  1596. { startIndex:62, type: htmlTokenTypes.getTag('script') },
  1597. { startIndex:68, type: htmlTokenTypes.DELIM_END }
  1598. ]}],
  1599. // Multiline test
  1600. [{
  1601. line: '<html>',
  1602. tokens: [
  1603. { startIndex:0, type: htmlTokenTypes.DELIM_START },
  1604. { startIndex:1, type: htmlTokenTypes.getTag('html') },
  1605. { startIndex:5, type: htmlTokenTypes.DELIM_END }
  1606. ]}, {
  1607. line: '<style><?="div"?>{ color:blue; }</style>',
  1608. tokens: [
  1609. { startIndex:0, type: htmlTokenTypes.DELIM_START },
  1610. { startIndex:1, type: htmlTokenTypes.getTag('style') },
  1611. { startIndex:6, type: htmlTokenTypes.DELIM_END },
  1612. { startIndex:7, type: 'metatag.php' },
  1613. { startIndex:10, type: 'string.php' },
  1614. { startIndex:15, type: 'metatag.php' },
  1615. { startIndex:17, type: 'punctuation.curly.css' },
  1616. { startIndex:18, type: '' },
  1617. { startIndex:19, type: 'support.type.property-name.css' },
  1618. { startIndex:25, type: 'support.property-value.css' },
  1619. { startIndex:29, type: 'punctuation.css' },
  1620. { startIndex:30, type: '' },
  1621. { startIndex:31, type: 'punctuation.curly.css' },
  1622. { startIndex:32, type: htmlTokenTypes.DELIM_START },
  1623. { startIndex:34, type: htmlTokenTypes.getTag('style') },
  1624. { startIndex:39, type: htmlTokenTypes.DELIM_END }
  1625. ]}],
  1626. // HTML (CSS (PHP)), HTML ( PHP, JS (PHP), PHP)
  1627. [{
  1628. line: '<html><style><?="div"?> { color:blue; }</style><!--<?="HTML Comment"?>--><script>var x = 3;/* <?="JS Comment"/*</script>*/?> */var y = 4;</script></html><? $x = 3;?>',
  1629. tokens: [
  1630. { startIndex:0, type: htmlTokenTypes.DELIM_START },
  1631. { startIndex:1, type: htmlTokenTypes.getTag('html') },
  1632. { startIndex:5, type: htmlTokenTypes.DELIM_END },
  1633. { startIndex:6, type: htmlTokenTypes.DELIM_START },
  1634. { startIndex:7, type: htmlTokenTypes.getTag('style') },
  1635. { startIndex:12, type: htmlTokenTypes.DELIM_END },
  1636. { startIndex:13, type: 'metatag.php' },
  1637. { startIndex:16, type: 'string.php' },
  1638. { startIndex:21, type: 'metatag.php' },
  1639. { startIndex:23, type: '' },
  1640. { startIndex:24, type: 'punctuation.curly.css' },
  1641. { startIndex:25, type: '' },
  1642. { startIndex:26, type: 'support.type.property-name.css' },
  1643. { startIndex:32, type: 'support.property-value.css' },
  1644. { startIndex:36, type: 'punctuation.css' },
  1645. { startIndex:37, type: '' },
  1646. { startIndex:38, type: 'punctuation.curly.css' },
  1647. { startIndex:39, type: htmlTokenTypes.DELIM_START },
  1648. { startIndex:41, type: htmlTokenTypes.getTag('style') },
  1649. { startIndex:46, type: htmlTokenTypes.DELIM_END },
  1650. { startIndex:47, type: htmlTokenTypes.DELIM_COMMENT },
  1651. { startIndex:51, type: 'metatag.php' },
  1652. { startIndex:54, type: 'string.php' },
  1653. { startIndex:68, type: 'metatag.php' },
  1654. { startIndex:70, type: htmlTokenTypes.DELIM_COMMENT },
  1655. { startIndex:73, type: htmlTokenTypes.DELIM_START },
  1656. { startIndex:74, type: htmlTokenTypes.getTag('script') },
  1657. { startIndex:80, type: htmlTokenTypes.DELIM_END },
  1658. { startIndex:81, type: '' },
  1659. { startIndex:94, type: 'metatag.php' },
  1660. { startIndex:97, type: 'string.php' },
  1661. { startIndex:109, type: 'comment.php' },
  1662. { startIndex:122, type: 'metatag.php' },
  1663. { startIndex:124, type: '' },
  1664. { startIndex:137, type: htmlTokenTypes.DELIM_START },
  1665. { startIndex:139, type: htmlTokenTypes.getTag('script') },
  1666. { startIndex:145, type: htmlTokenTypes.DELIM_END },
  1667. { startIndex:146, type: htmlTokenTypes.DELIM_START },
  1668. { startIndex:148, type: htmlTokenTypes.getTag('html') },
  1669. { startIndex:152, type: htmlTokenTypes.DELIM_END },
  1670. { startIndex:153, type: 'metatag.php' },
  1671. { startIndex:155, type: '' },
  1672. { startIndex:156, type: 'variable.php' },
  1673. { startIndex:158, type: '' },
  1674. { startIndex:159, type: 'delimiter.php' },
  1675. { startIndex:160, type: '' },
  1676. { startIndex:161, type: 'number.php' },
  1677. { startIndex:162, type: 'delimiter.php' },
  1678. { startIndex:163, type: 'metatag.php' }
  1679. ]}],
  1680. // PHP-tag detection
  1681. [{
  1682. line: '<!--c--><?',
  1683. tokens: [
  1684. { startIndex:0, type: htmlTokenTypes.DELIM_COMMENT },
  1685. { startIndex:8, type: 'metatag.php' }
  1686. ]}],
  1687. [{
  1688. line: '<script>//<?',
  1689. tokens: [
  1690. { startIndex:0, type: htmlTokenTypes.DELIM_START },
  1691. { startIndex:1, type: htmlTokenTypes.getTag('script') },
  1692. { startIndex:7, type: htmlTokenTypes.DELIM_END },
  1693. { startIndex:8, type: '' },
  1694. { startIndex:10, type: 'metatag.php' }
  1695. ]}],
  1696. [{
  1697. line: '<script>"<?php5+3?>"',
  1698. tokens: [
  1699. { startIndex:0, type: htmlTokenTypes.DELIM_START },
  1700. { startIndex:1, type: htmlTokenTypes.getTag('script') },
  1701. { startIndex:7, type: htmlTokenTypes.DELIM_END },
  1702. { startIndex:8, type: '' },
  1703. { startIndex:9, type: 'metatag.php' },
  1704. { startIndex:14, type: 'number.php' },
  1705. { startIndex:15, type: 'delimiter.php' },
  1706. { startIndex:16, type: 'number.php' },
  1707. { startIndex:17, type: 'metatag.php' },
  1708. { startIndex:19, type: '' }
  1709. ]}],
  1710. [{
  1711. line: '<?php toString(); ?>',
  1712. tokens: [
  1713. { startIndex:0, type: 'metatag.php' },
  1714. { startIndex:5, type: '' },
  1715. { startIndex:6, type: 'identifier.php' },
  1716. { startIndex:14, type: 'delimiter.parenthesis.php' },
  1717. { startIndex:16, type: 'delimiter.php' },
  1718. { startIndex:17, type: '' },
  1719. { startIndex:18, type: 'metatag.php' }
  1720. ]}]
  1721. ]);