kwd-swtch.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521
  1. //-------------------------------------------------------------------------------------------------------
  2. // Copyright (C) Microsoft. All rights reserved.
  3. // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
  4. //-------------------------------------------------------------------------------------------------------
  5. // GENERATED FILE, DO NOT HAND-MODIFY!
  6. // Generated with the following command line: wscript jsscan.js kwd-lsc.h kwd-swtch.h
  7. // This should be regenerated whenever the keywords change.
  8. case 'a':
  9. if (identifyKwds)
  10. {
  11. switch (p[0]) {
  12. case 'w':
  13. if (p[1] == 'a' && p[2] == 'i' && p[3] == 't' && !IsIdContinueNext(p+4, last)) {
  14. p += 4;
  15. if (this->m_fAwaitIsKeyword || !this->m_parser || this->m_parser->IsStrictMode()) {
  16. token = tkAWAIT;
  17. goto LReserved;
  18. }
  19. goto LIdentifier;
  20. }
  21. break;
  22. case 'r':
  23. if (p[1] == 'g' && p[2] == 'u' && p[3] == 'm' && p[4] == 'e' && p[5] == 'n' && p[6] == 't' && p[7] == 's' && !IsIdContinueNext(p+8, last)) {
  24. p += 8;
  25. goto LArguments;
  26. }
  27. break;
  28. }
  29. }
  30. goto LIdentifier;
  31. case 'b':
  32. if (identifyKwds)
  33. {
  34. if (p[0] == 'r' && p[1] == 'e' && p[2] == 'a' && p[3] == 'k' && !IsIdContinueNext(p+4, last)) {
  35. p += 4;
  36. token = tkBREAK;
  37. goto LReserved;
  38. }
  39. }
  40. goto LIdentifier;
  41. case 'c':
  42. if (identifyKwds)
  43. {
  44. switch (p[0]) {
  45. case 'a':
  46. switch (p[1]) {
  47. case 's':
  48. if (p[2] == 'e' && !IsIdContinueNext(p+3, last)) {
  49. p += 3;
  50. token = tkCASE;
  51. goto LReserved;
  52. }
  53. break;
  54. case 't':
  55. if (p[2] == 'c' && p[3] == 'h' && !IsIdContinueNext(p+4, last)) {
  56. p += 4;
  57. token = tkCATCH;
  58. goto LReserved;
  59. }
  60. break;
  61. }
  62. break;
  63. case 'o':
  64. if (p[1] == 'n') {
  65. switch (p[2]) {
  66. case 't':
  67. if (p[3] == 'i' && p[4] == 'n' && p[5] == 'u' && p[6] == 'e' && !IsIdContinueNext(p+7, last)) {
  68. p += 7;
  69. token = tkCONTINUE;
  70. goto LReserved;
  71. }
  72. break;
  73. case 's':
  74. if (p[3] == 't' && !IsIdContinueNext(p+4, last)) {
  75. p += 4;
  76. token = tkCONST;
  77. goto LReserved;
  78. }
  79. break;
  80. }
  81. }
  82. break;
  83. case 'l':
  84. if (p[1] == 'a' && p[2] == 's' && p[3] == 's' && !IsIdContinueNext(p+4, last)) {
  85. p += 4;
  86. token = tkCLASS;
  87. goto LReserved;
  88. }
  89. break;
  90. }
  91. }
  92. goto LIdentifier;
  93. case 'd':
  94. if (identifyKwds)
  95. {
  96. switch (p[0]) {
  97. case 'e':
  98. switch (p[1]) {
  99. case 'b':
  100. if (p[2] == 'u' && p[3] == 'g' && p[4] == 'g' && p[5] == 'e' && p[6] == 'r' && !IsIdContinueNext(p+7, last)) {
  101. p += 7;
  102. token = tkDEBUGGER;
  103. goto LReserved;
  104. }
  105. break;
  106. case 'f':
  107. if (p[2] == 'a' && p[3] == 'u' && p[4] == 'l' && p[5] == 't' && !IsIdContinueNext(p+6, last)) {
  108. p += 6;
  109. token = tkDEFAULT;
  110. goto LReserved;
  111. }
  112. break;
  113. case 'l':
  114. if (p[2] == 'e' && p[3] == 't' && p[4] == 'e' && !IsIdContinueNext(p+5, last)) {
  115. p += 5;
  116. token = tkDELETE;
  117. goto LReserved;
  118. }
  119. break;
  120. }
  121. break;
  122. case 'o':
  123. if (!IsIdContinueNext(p+1, last)) {
  124. p += 1;
  125. token = tkDO;
  126. goto LReserved;
  127. }
  128. break;
  129. }
  130. }
  131. goto LIdentifier;
  132. case 'e':
  133. if (identifyKwds)
  134. {
  135. switch (p[0]) {
  136. case 'l':
  137. if (p[1] == 's' && p[2] == 'e' && !IsIdContinueNext(p+3, last)) {
  138. p += 3;
  139. token = tkELSE;
  140. goto LReserved;
  141. }
  142. break;
  143. case 'x':
  144. switch (p[1]) {
  145. case 'p':
  146. if (p[2] == 'o' && p[3] == 'r' && p[4] == 't' && !IsIdContinueNext(p+5, last)) {
  147. p += 5;
  148. token = tkEXPORT;
  149. goto LReserved;
  150. }
  151. break;
  152. case 't':
  153. if (p[2] == 'e' && p[3] == 'n' && p[4] == 'd' && p[5] == 's' && !IsIdContinueNext(p+6, last)) {
  154. p += 6;
  155. token = tkEXTENDS;
  156. goto LReserved;
  157. }
  158. break;
  159. }
  160. break;
  161. case 'n':
  162. if (p[1] == 'u' && p[2] == 'm' && !IsIdContinueNext(p+3, last)) {
  163. p += 3;
  164. token = tkENUM;
  165. goto LReserved;
  166. }
  167. break;
  168. case 'v':
  169. if (p[1] == 'a' && p[2] == 'l' && !IsIdContinueNext(p+3, last)) {
  170. p += 3;
  171. goto LEval;
  172. }
  173. break;
  174. }
  175. }
  176. goto LIdentifier;
  177. case 'f':
  178. if (identifyKwds)
  179. {
  180. switch (p[0]) {
  181. case 'a':
  182. if (p[1] == 'l' && p[2] == 's' && p[3] == 'e' && !IsIdContinueNext(p+4, last)) {
  183. p += 4;
  184. token = tkFALSE;
  185. goto LReserved;
  186. }
  187. break;
  188. case 'i':
  189. if (p[1] == 'n' && p[2] == 'a' && p[3] == 'l' && p[4] == 'l' && p[5] == 'y' && !IsIdContinueNext(p+6, last)) {
  190. p += 6;
  191. token = tkFINALLY;
  192. goto LReserved;
  193. }
  194. break;
  195. case 'o':
  196. if (p[1] == 'r' && !IsIdContinueNext(p+2, last)) {
  197. p += 2;
  198. token = tkFOR;
  199. goto LReserved;
  200. }
  201. break;
  202. case 'u':
  203. if (p[1] == 'n' && p[2] == 'c' && p[3] == 't' && p[4] == 'i' && p[5] == 'o' && p[6] == 'n' && !IsIdContinueNext(p+7, last)) {
  204. p += 7;
  205. token = tkFUNCTION;
  206. goto LReserved;
  207. }
  208. break;
  209. }
  210. }
  211. goto LIdentifier;
  212. case 'i':
  213. if (identifyKwds)
  214. {
  215. switch (p[0]) {
  216. case 'f':
  217. if (!IsIdContinueNext(p+1, last)) {
  218. p += 1;
  219. token = tkIF;
  220. goto LReserved;
  221. }
  222. break;
  223. case 'n':
  224. switch (p[1]) {
  225. case 's':
  226. if (p[2] == 't' && p[3] == 'a' && p[4] == 'n' && p[5] == 'c' && p[6] == 'e' && p[7] == 'o' && p[8] == 'f' && !IsIdContinueNext(p+9, last)) {
  227. p += 9;
  228. token = tkINSTANCEOF;
  229. goto LReserved;
  230. }
  231. break;
  232. case 't':
  233. if (p[2] == 'e' && p[3] == 'r' && p[4] == 'f' && p[5] == 'a' && p[6] == 'c' && p[7] == 'e' && !IsIdContinueNext(p+8, last)) {
  234. p += 8;
  235. if (!this->m_parser || this->m_parser->IsStrictMode()) {
  236. token = tkINTERFACE;
  237. goto LReserved;
  238. }
  239. goto LIdentifier;
  240. }
  241. break;
  242. }
  243. if (!IsIdContinueNext(p+1,last)) {
  244. p += 1;
  245. token = tkIN;
  246. goto LReserved;
  247. }
  248. break;
  249. case 'm':
  250. if (p[1] == 'p') {
  251. switch (p[2]) {
  252. case 'o':
  253. if (p[3] == 'r' && p[4] == 't' && !IsIdContinueNext(p+5, last)) {
  254. p += 5;
  255. token = tkIMPORT;
  256. goto LReserved;
  257. }
  258. break;
  259. case 'l':
  260. if (p[3] == 'e' && p[4] == 'm' && p[5] == 'e' && p[6] == 'n' && p[7] == 't' && p[8] == 's' && !IsIdContinueNext(p+9, last)) {
  261. p += 9;
  262. if (!this->m_parser || this->m_parser->IsStrictMode()) {
  263. token = tkIMPLEMENTS;
  264. goto LReserved;
  265. }
  266. goto LIdentifier;
  267. }
  268. break;
  269. }
  270. }
  271. break;
  272. }
  273. }
  274. goto LIdentifier;
  275. case 'n':
  276. if (identifyKwds)
  277. {
  278. switch (p[0]) {
  279. case 'e':
  280. if (p[1] == 'w' && !IsIdContinueNext(p+2, last)) {
  281. p += 2;
  282. token = tkNEW;
  283. goto LReserved;
  284. }
  285. break;
  286. case 'u':
  287. if (p[1] == 'l' && p[2] == 'l' && !IsIdContinueNext(p+3, last)) {
  288. p += 3;
  289. token = tkNULL;
  290. goto LReserved;
  291. }
  292. break;
  293. }
  294. }
  295. goto LIdentifier;
  296. case 'r':
  297. if (identifyKwds)
  298. {
  299. if (p[0] == 'e' && p[1] == 't' && p[2] == 'u' && p[3] == 'r' && p[4] == 'n' && !IsIdContinueNext(p+5, last)) {
  300. p += 5;
  301. token = tkRETURN;
  302. goto LReserved;
  303. }
  304. }
  305. goto LIdentifier;
  306. case 's':
  307. if (identifyKwds)
  308. {
  309. switch (p[0]) {
  310. case 'w':
  311. if (p[1] == 'i' && p[2] == 't' && p[3] == 'c' && p[4] == 'h' && !IsIdContinueNext(p+5, last)) {
  312. p += 5;
  313. token = tkSWITCH;
  314. goto LReserved;
  315. }
  316. break;
  317. case 'u':
  318. if (p[1] == 'p' && p[2] == 'e' && p[3] == 'r' && !IsIdContinueNext(p+4, last)) {
  319. p += 4;
  320. token = tkSUPER;
  321. goto LReserved;
  322. }
  323. break;
  324. case 't':
  325. if (p[1] == 'a' && p[2] == 't' && p[3] == 'i' && p[4] == 'c' && !IsIdContinueNext(p+5, last)) {
  326. p += 5;
  327. if (!this->m_parser || this->m_parser->IsStrictMode()) {
  328. token = tkSTATIC;
  329. goto LReserved;
  330. }
  331. goto LIdentifier;
  332. }
  333. break;
  334. }
  335. }
  336. goto LIdentifier;
  337. case 't':
  338. if (identifyKwds)
  339. {
  340. switch (p[0]) {
  341. case 'h':
  342. switch (p[1]) {
  343. case 'i':
  344. if (p[2] == 's' && !IsIdContinueNext(p+3, last)) {
  345. p += 3;
  346. token = tkTHIS;
  347. goto LReserved;
  348. }
  349. break;
  350. case 'r':
  351. if (p[2] == 'o' && p[3] == 'w' && !IsIdContinueNext(p+4, last)) {
  352. p += 4;
  353. token = tkTHROW;
  354. goto LReserved;
  355. }
  356. break;
  357. }
  358. break;
  359. case 'r':
  360. switch (p[1]) {
  361. case 'u':
  362. if (p[2] == 'e' && !IsIdContinueNext(p+3, last)) {
  363. p += 3;
  364. token = tkTRUE;
  365. goto LReserved;
  366. }
  367. break;
  368. case 'y':
  369. if (!IsIdContinueNext(p+2, last)) {
  370. p += 2;
  371. token = tkTRY;
  372. goto LReserved;
  373. }
  374. break;
  375. }
  376. break;
  377. case 'y':
  378. if (p[1] == 'p' && p[2] == 'e' && p[3] == 'o' && p[4] == 'f' && !IsIdContinueNext(p+5, last)) {
  379. p += 5;
  380. token = tkTYPEOF;
  381. goto LReserved;
  382. }
  383. break;
  384. case 'a':
  385. if (p[1] == 'r' && p[2] == 'g' && p[3] == 'e' && p[4] == 't' && !IsIdContinueNext(p+5, last)) {
  386. p += 5;
  387. goto LTarget;
  388. }
  389. break;
  390. }
  391. }
  392. goto LIdentifier;
  393. case 'v':
  394. if (identifyKwds)
  395. {
  396. switch (p[0]) {
  397. case 'a':
  398. if (p[1] == 'r' && !IsIdContinueNext(p+2, last)) {
  399. p += 2;
  400. token = tkVAR;
  401. goto LReserved;
  402. }
  403. break;
  404. case 'o':
  405. if (p[1] == 'i' && p[2] == 'd' && !IsIdContinueNext(p+3, last)) {
  406. p += 3;
  407. token = tkVOID;
  408. goto LReserved;
  409. }
  410. break;
  411. }
  412. }
  413. goto LIdentifier;
  414. case 'w':
  415. if (identifyKwds)
  416. {
  417. switch (p[0]) {
  418. case 'h':
  419. if (p[1] == 'i' && p[2] == 'l' && p[3] == 'e' && !IsIdContinueNext(p+4, last)) {
  420. p += 4;
  421. token = tkWHILE;
  422. goto LReserved;
  423. }
  424. break;
  425. case 'i':
  426. if (p[1] == 't' && p[2] == 'h' && !IsIdContinueNext(p+3, last)) {
  427. p += 3;
  428. token = tkWITH;
  429. goto LReserved;
  430. }
  431. break;
  432. }
  433. }
  434. goto LIdentifier;
  435. case 'y':
  436. if (identifyKwds)
  437. {
  438. if (p[0] == 'i' && p[1] == 'e' && p[2] == 'l' && p[3] == 'd' && !IsIdContinueNext(p+4, last)) {
  439. p += 4;
  440. if (this->m_fYieldIsKeyword || !this->m_parser || this->m_parser->IsStrictMode()) {
  441. token = tkYIELD;
  442. goto LReserved;
  443. }
  444. goto LIdentifier;
  445. }
  446. }
  447. goto LIdentifier;
  448. case 'l':
  449. if (identifyKwds)
  450. {
  451. if (p[0] == 'e' && p[1] == 't' && !IsIdContinueNext(p+2, last)) {
  452. p += 2;
  453. if (!this->m_parser || this->m_parser->IsStrictMode()) {
  454. token = tkLET;
  455. goto LReserved;
  456. }
  457. goto LIdentifier;
  458. }
  459. }
  460. goto LIdentifier;
  461. case 'p':
  462. if (identifyKwds)
  463. {
  464. switch (p[0]) {
  465. case 'a':
  466. if (p[1] == 'c' && p[2] == 'k' && p[3] == 'a' && p[4] == 'g' && p[5] == 'e' && !IsIdContinueNext(p+6, last)) {
  467. p += 6;
  468. if (!this->m_parser || this->m_parser->IsStrictMode()) {
  469. token = tkPACKAGE;
  470. goto LReserved;
  471. }
  472. goto LIdentifier;
  473. }
  474. break;
  475. case 'r':
  476. switch (p[1]) {
  477. case 'i':
  478. if (p[2] == 'v' && p[3] == 'a' && p[4] == 't' && p[5] == 'e' && !IsIdContinueNext(p+6, last)) {
  479. p += 6;
  480. if (!this->m_parser || this->m_parser->IsStrictMode()) {
  481. token = tkPRIVATE;
  482. goto LReserved;
  483. }
  484. goto LIdentifier;
  485. }
  486. break;
  487. case 'o':
  488. if (p[2] == 't' && p[3] == 'e' && p[4] == 'c' && p[5] == 't' && p[6] == 'e' && p[7] == 'd' && !IsIdContinueNext(p+8, last)) {
  489. p += 8;
  490. if (!this->m_parser || this->m_parser->IsStrictMode()) {
  491. token = tkPROTECTED;
  492. goto LReserved;
  493. }
  494. goto LIdentifier;
  495. }
  496. break;
  497. }
  498. break;
  499. case 'u':
  500. if (p[1] == 'b' && p[2] == 'l' && p[3] == 'i' && p[4] == 'c' && !IsIdContinueNext(p+5, last)) {
  501. p += 5;
  502. if (!this->m_parser || this->m_parser->IsStrictMode()) {
  503. token = tkPUBLIC;
  504. goto LReserved;
  505. }
  506. goto LIdentifier;
  507. }
  508. break;
  509. }
  510. }
  511. goto LIdentifier;
  512. // characters not in a reserved word
  513. case 'g': case 'h': case 'j':
  514. case 'k': case 'm': case 'o':
  515. case 'q':
  516. case 'u': case 'x':
  517. case 'z':
  518. goto LIdentifier;