PageRenderTime 297ms CodeModel.GetById 10ms RepoModel.GetById 1ms app.codeStats 0ms

/yii/framework/vendors/TextHighlighter/Text/Highlighter/JAVASCRIPT.php

https://github.com/joshuaswarren/weatherhub
PHP | 613 lines | 572 code | 4 blank | 37 comment | 0 complexity | 628610f95fb030c6b51748b01ab90910 MD5 | raw file
  1. <?php
  2. /**
  3. * Auto-generated class. JAVASCRIPT syntax highlighting
  4. *
  5. * PHP version 4 and 5
  6. *
  7. * LICENSE: This source file is subject to version 3.0 of the PHP license
  8. * that is available through the world-wide-web at the following URI:
  9. * http://www.php.net/license/3_0.txt. If you did not receive a copy of
  10. * the PHP License and are unable to obtain it through the web, please
  11. * send a note to license@php.net so we can mail you a copy immediately.
  12. *
  13. * @copyright 2004-2006 Andrey Demenev
  14. * @license http://www.php.net/license/3_0.txt PHP License
  15. * @link http://pear.php.net/package/Text_Highlighter
  16. * @category Text
  17. * @package Text_Highlighter
  18. * @version generated from: : javascript.xml,v 1.3 2008/01/01 23:43:36 ssttoo Exp
  19. * @author Andrey Demenev <demenev@gmail.com>
  20. *
  21. */
  22. /**
  23. * Auto-generated class. JAVASCRIPT syntax highlighting
  24. *
  25. * @author Andrey Demenev <demenev@gmail.com>
  26. * @category Text
  27. * @package Text_Highlighter
  28. * @copyright 2004-2006 Andrey Demenev
  29. * @license http://www.php.net/license/3_0.txt PHP License
  30. * @version Release: 0.7.1
  31. * @link http://pear.php.net/package/Text_Highlighter
  32. */
  33. class Text_Highlighter_JAVASCRIPT extends Text_Highlighter
  34. {
  35. var $_language = 'javascript';
  36. /**
  37. * Constructor
  38. *
  39. * @param array $options
  40. * @access public
  41. */
  42. function __construct($options=array())
  43. {
  44. $this->_options = $options;
  45. $this->_regs = array (
  46. -1 => '/((?i)\\{)|((?i)\\()|((?i)\\[)|((?i)\\/\\*)|((?i)")|((?i)\')|((?i)\\/\\/)|((?i)[a-z_]\\w*)|((?i)0x\\d*|\\d*\\.?\\d+)/',
  47. 0 => '/((?i)\\{)|((?i)\\()|((?i)\\[)|((?i)\\/\\*)|((?i)")|((?i)\')|((?i)\\/\\/)|((?i)[a-z_]\\w*)|((?i)0x\\d*|\\d*\\.?\\d+)/',
  48. 1 => '/((?i)\\{)|((?i)\\()|((?i)\\[)|((?i)\\/\\*)|((?i)")|((?i)\')|((?i)\\/\\/)|((?i)[a-z_]\\w*)|((?i)0x\\d*|\\d*\\.?\\d+)/',
  49. 2 => '/((?i)\\{)|((?i)\\()|((?i)\\[)|((?i)\\/\\*)|((?i)")|((?i)\')|((?i)\\/\\/)|((?i)[a-z_]\\w*)|((?i)0x\\d*|\\d*\\.?\\d+)/',
  50. 3 => '/((?i)((https?|ftp):\\/\\/[\\w\\?\\.\\-\\&=\\/%+]+)|(^|[\\s,!?])www\\.\\w+\\.\\w+[\\w\\?\\.\\&=\\/%+]*)|((?i)\\w+[\\.\\w\\-]+@(\\w+[\\.\\w\\-])+)|((?i)\\b(note|fixme):)|((?i)\\$\\w+:.+\\$)/',
  51. 4 => '/((?i)\\\\\\\\|\\\\"|\\\\\'|\\\\`|\\\\t|\\\\n|\\\\r)/',
  52. 5 => '/((?i)\\\\\\\\|\\\\"|\\\\\'|\\\\`)/',
  53. 6 => '/((?i)((https?|ftp):\\/\\/[\\w\\?\\.\\-\\&=\\/%+]+)|(^|[\\s,!?])www\\.\\w+\\.\\w+[\\w\\?\\.\\&=\\/%+]*)|((?i)\\w+[\\.\\w\\-]+@(\\w+[\\.\\w\\-])+)|((?i)\\b(note|fixme):)|((?i)\\$\\w+:.+\\$)/',
  54. );
  55. $this->_counts = array (
  56. -1 =>
  57. array (
  58. 0 => 0,
  59. 1 => 0,
  60. 2 => 0,
  61. 3 => 0,
  62. 4 => 0,
  63. 5 => 0,
  64. 6 => 0,
  65. 7 => 0,
  66. 8 => 0,
  67. ),
  68. 0 =>
  69. array (
  70. 0 => 0,
  71. 1 => 0,
  72. 2 => 0,
  73. 3 => 0,
  74. 4 => 0,
  75. 5 => 0,
  76. 6 => 0,
  77. 7 => 0,
  78. 8 => 0,
  79. ),
  80. 1 =>
  81. array (
  82. 0 => 0,
  83. 1 => 0,
  84. 2 => 0,
  85. 3 => 0,
  86. 4 => 0,
  87. 5 => 0,
  88. 6 => 0,
  89. 7 => 0,
  90. 8 => 0,
  91. ),
  92. 2 =>
  93. array (
  94. 0 => 0,
  95. 1 => 0,
  96. 2 => 0,
  97. 3 => 0,
  98. 4 => 0,
  99. 5 => 0,
  100. 6 => 0,
  101. 7 => 0,
  102. 8 => 0,
  103. ),
  104. 3 =>
  105. array (
  106. 0 => 3,
  107. 1 => 1,
  108. 2 => 1,
  109. 3 => 0,
  110. ),
  111. 4 =>
  112. array (
  113. 0 => 0,
  114. ),
  115. 5 =>
  116. array (
  117. 0 => 0,
  118. ),
  119. 6 =>
  120. array (
  121. 0 => 3,
  122. 1 => 1,
  123. 2 => 1,
  124. 3 => 0,
  125. ),
  126. );
  127. $this->_delim = array (
  128. -1 =>
  129. array (
  130. 0 => 'brackets',
  131. 1 => 'brackets',
  132. 2 => 'brackets',
  133. 3 => 'comment',
  134. 4 => 'quotes',
  135. 5 => 'quotes',
  136. 6 => 'comment',
  137. 7 => '',
  138. 8 => '',
  139. ),
  140. 0 =>
  141. array (
  142. 0 => 'brackets',
  143. 1 => 'brackets',
  144. 2 => 'brackets',
  145. 3 => 'comment',
  146. 4 => 'quotes',
  147. 5 => 'quotes',
  148. 6 => 'comment',
  149. 7 => '',
  150. 8 => '',
  151. ),
  152. 1 =>
  153. array (
  154. 0 => 'brackets',
  155. 1 => 'brackets',
  156. 2 => 'brackets',
  157. 3 => 'comment',
  158. 4 => 'quotes',
  159. 5 => 'quotes',
  160. 6 => 'comment',
  161. 7 => '',
  162. 8 => '',
  163. ),
  164. 2 =>
  165. array (
  166. 0 => 'brackets',
  167. 1 => 'brackets',
  168. 2 => 'brackets',
  169. 3 => 'comment',
  170. 4 => 'quotes',
  171. 5 => 'quotes',
  172. 6 => 'comment',
  173. 7 => '',
  174. 8 => '',
  175. ),
  176. 3 =>
  177. array (
  178. 0 => '',
  179. 1 => '',
  180. 2 => '',
  181. 3 => '',
  182. ),
  183. 4 =>
  184. array (
  185. 0 => '',
  186. ),
  187. 5 =>
  188. array (
  189. 0 => '',
  190. ),
  191. 6 =>
  192. array (
  193. 0 => '',
  194. 1 => '',
  195. 2 => '',
  196. 3 => '',
  197. ),
  198. );
  199. $this->_inner = array (
  200. -1 =>
  201. array (
  202. 0 => 'code',
  203. 1 => 'code',
  204. 2 => 'code',
  205. 3 => 'comment',
  206. 4 => 'string',
  207. 5 => 'string',
  208. 6 => 'comment',
  209. 7 => 'identifier',
  210. 8 => 'number',
  211. ),
  212. 0 =>
  213. array (
  214. 0 => 'code',
  215. 1 => 'code',
  216. 2 => 'code',
  217. 3 => 'comment',
  218. 4 => 'string',
  219. 5 => 'string',
  220. 6 => 'comment',
  221. 7 => 'identifier',
  222. 8 => 'number',
  223. ),
  224. 1 =>
  225. array (
  226. 0 => 'code',
  227. 1 => 'code',
  228. 2 => 'code',
  229. 3 => 'comment',
  230. 4 => 'string',
  231. 5 => 'string',
  232. 6 => 'comment',
  233. 7 => 'identifier',
  234. 8 => 'number',
  235. ),
  236. 2 =>
  237. array (
  238. 0 => 'code',
  239. 1 => 'code',
  240. 2 => 'code',
  241. 3 => 'comment',
  242. 4 => 'string',
  243. 5 => 'string',
  244. 6 => 'comment',
  245. 7 => 'identifier',
  246. 8 => 'number',
  247. ),
  248. 3 =>
  249. array (
  250. 0 => 'url',
  251. 1 => 'url',
  252. 2 => 'inlinedoc',
  253. 3 => 'inlinedoc',
  254. ),
  255. 4 =>
  256. array (
  257. 0 => 'special',
  258. ),
  259. 5 =>
  260. array (
  261. 0 => 'special',
  262. ),
  263. 6 =>
  264. array (
  265. 0 => 'url',
  266. 1 => 'url',
  267. 2 => 'inlinedoc',
  268. 3 => 'inlinedoc',
  269. ),
  270. );
  271. $this->_end = array (
  272. 0 => '/(?i)\\}/',
  273. 1 => '/(?i)\\)/',
  274. 2 => '/(?i)\\]/',
  275. 3 => '/(?i)\\*\\//',
  276. 4 => '/(?i)"/',
  277. 5 => '/(?i)\'/',
  278. 6 => '/(?mi)$/',
  279. );
  280. $this->_states = array (
  281. -1 =>
  282. array (
  283. 0 => 0,
  284. 1 => 1,
  285. 2 => 2,
  286. 3 => 3,
  287. 4 => 4,
  288. 5 => 5,
  289. 6 => 6,
  290. 7 => -1,
  291. 8 => -1,
  292. ),
  293. 0 =>
  294. array (
  295. 0 => 0,
  296. 1 => 1,
  297. 2 => 2,
  298. 3 => 3,
  299. 4 => 4,
  300. 5 => 5,
  301. 6 => 6,
  302. 7 => -1,
  303. 8 => -1,
  304. ),
  305. 1 =>
  306. array (
  307. 0 => 0,
  308. 1 => 1,
  309. 2 => 2,
  310. 3 => 3,
  311. 4 => 4,
  312. 5 => 5,
  313. 6 => 6,
  314. 7 => -1,
  315. 8 => -1,
  316. ),
  317. 2 =>
  318. array (
  319. 0 => 0,
  320. 1 => 1,
  321. 2 => 2,
  322. 3 => 3,
  323. 4 => 4,
  324. 5 => 5,
  325. 6 => 6,
  326. 7 => -1,
  327. 8 => -1,
  328. ),
  329. 3 =>
  330. array (
  331. 0 => -1,
  332. 1 => -1,
  333. 2 => -1,
  334. 3 => -1,
  335. ),
  336. 4 =>
  337. array (
  338. 0 => -1,
  339. ),
  340. 5 =>
  341. array (
  342. 0 => -1,
  343. ),
  344. 6 =>
  345. array (
  346. 0 => -1,
  347. 1 => -1,
  348. 2 => -1,
  349. 3 => -1,
  350. ),
  351. );
  352. $this->_keywords = array (
  353. -1 =>
  354. array (
  355. 0 => -1,
  356. 1 => -1,
  357. 2 => -1,
  358. 3 => -1,
  359. 4 => -1,
  360. 5 => -1,
  361. 6 => -1,
  362. 7 =>
  363. array (
  364. 'builtin' => '/^(String|Array|RegExp|Function|Math|Number|Date|Image|window|document|navigator|onAbort|onBlur|onChange|onClick|onDblClick|onDragDrop|onError|onFocus|onKeyDown|onKeyPress|onKeyUp|onLoad|onMouseDown|onMouseOver|onMouseOut|onMouseMove|onMouseUp|onMove|onReset|onResize|onSelect|onSubmit|onUnload)$/',
  365. 'reserved' => '/^(break|continue|do|while|export|for|in|if|else|import|return|label|switch|case|var|with|delete|new|this|typeof|void|abstract|boolean|byte|catch|char|class|const|debugger|default|double|enum|extends|false|final|finally|float|function|implements|goto|instanceof|int|interface|long|native|null|package|private|protected|public|short|static|super|synchronized|throw|throws|transient|true|try|volatile)$/',
  366. ),
  367. 8 =>
  368. array (
  369. ),
  370. ),
  371. 0 =>
  372. array (
  373. 0 => -1,
  374. 1 => -1,
  375. 2 => -1,
  376. 3 => -1,
  377. 4 => -1,
  378. 5 => -1,
  379. 6 => -1,
  380. 7 =>
  381. array (
  382. 'builtin' => '/^(String|Array|RegExp|Function|Math|Number|Date|Image|window|document|navigator|onAbort|onBlur|onChange|onClick|onDblClick|onDragDrop|onError|onFocus|onKeyDown|onKeyPress|onKeyUp|onLoad|onMouseDown|onMouseOver|onMouseOut|onMouseMove|onMouseUp|onMove|onReset|onResize|onSelect|onSubmit|onUnload)$/',
  383. 'reserved' => '/^(break|continue|do|while|export|for|in|if|else|import|return|label|switch|case|var|with|delete|new|this|typeof|void|abstract|boolean|byte|catch|char|class|const|debugger|default|double|enum|extends|false|final|finally|float|function|implements|goto|instanceof|int|interface|long|native|null|package|private|protected|public|short|static|super|synchronized|throw|throws|transient|true|try|volatile)$/',
  384. ),
  385. 8 =>
  386. array (
  387. ),
  388. ),
  389. 1 =>
  390. array (
  391. 0 => -1,
  392. 1 => -1,
  393. 2 => -1,
  394. 3 => -1,
  395. 4 => -1,
  396. 5 => -1,
  397. 6 => -1,
  398. 7 =>
  399. array (
  400. 'builtin' => '/^(String|Array|RegExp|Function|Math|Number|Date|Image|window|document|navigator|onAbort|onBlur|onChange|onClick|onDblClick|onDragDrop|onError|onFocus|onKeyDown|onKeyPress|onKeyUp|onLoad|onMouseDown|onMouseOver|onMouseOut|onMouseMove|onMouseUp|onMove|onReset|onResize|onSelect|onSubmit|onUnload)$/',
  401. 'reserved' => '/^(break|continue|do|while|export|for|in|if|else|import|return|label|switch|case|var|with|delete|new|this|typeof|void|abstract|boolean|byte|catch|char|class|const|debugger|default|double|enum|extends|false|final|finally|float|function|implements|goto|instanceof|int|interface|long|native|null|package|private|protected|public|short|static|super|synchronized|throw|throws|transient|true|try|volatile)$/',
  402. ),
  403. 8 =>
  404. array (
  405. ),
  406. ),
  407. 2 =>
  408. array (
  409. 0 => -1,
  410. 1 => -1,
  411. 2 => -1,
  412. 3 => -1,
  413. 4 => -1,
  414. 5 => -1,
  415. 6 => -1,
  416. 7 =>
  417. array (
  418. 'builtin' => '/^(String|Array|RegExp|Function|Math|Number|Date|Image|window|document|navigator|onAbort|onBlur|onChange|onClick|onDblClick|onDragDrop|onError|onFocus|onKeyDown|onKeyPress|onKeyUp|onLoad|onMouseDown|onMouseOver|onMouseOut|onMouseMove|onMouseUp|onMove|onReset|onResize|onSelect|onSubmit|onUnload)$/',
  419. 'reserved' => '/^(break|continue|do|while|export|for|in|if|else|import|return|label|switch|case|var|with|delete|new|this|typeof|void|abstract|boolean|byte|catch|char|class|const|debugger|default|double|enum|extends|false|final|finally|float|function|implements|goto|instanceof|int|interface|long|native|null|package|private|protected|public|short|static|super|synchronized|throw|throws|transient|true|try|volatile)$/',
  420. ),
  421. 8 =>
  422. array (
  423. ),
  424. ),
  425. 3 =>
  426. array (
  427. 0 =>
  428. array (
  429. ),
  430. 1 =>
  431. array (
  432. ),
  433. 2 =>
  434. array (
  435. ),
  436. 3 =>
  437. array (
  438. ),
  439. ),
  440. 4 =>
  441. array (
  442. 0 =>
  443. array (
  444. ),
  445. ),
  446. 5 =>
  447. array (
  448. 0 =>
  449. array (
  450. ),
  451. ),
  452. 6 =>
  453. array (
  454. 0 =>
  455. array (
  456. ),
  457. 1 =>
  458. array (
  459. ),
  460. 2 =>
  461. array (
  462. ),
  463. 3 =>
  464. array (
  465. ),
  466. ),
  467. );
  468. $this->_parts = array (
  469. 0 =>
  470. array (
  471. 0 => NULL,
  472. 1 => NULL,
  473. 2 => NULL,
  474. 3 => NULL,
  475. 4 => NULL,
  476. 5 => NULL,
  477. 6 => NULL,
  478. 7 => NULL,
  479. 8 => NULL,
  480. ),
  481. 1 =>
  482. array (
  483. 0 => NULL,
  484. 1 => NULL,
  485. 2 => NULL,
  486. 3 => NULL,
  487. 4 => NULL,
  488. 5 => NULL,
  489. 6 => NULL,
  490. 7 => NULL,
  491. 8 => NULL,
  492. ),
  493. 2 =>
  494. array (
  495. 0 => NULL,
  496. 1 => NULL,
  497. 2 => NULL,
  498. 3 => NULL,
  499. 4 => NULL,
  500. 5 => NULL,
  501. 6 => NULL,
  502. 7 => NULL,
  503. 8 => NULL,
  504. ),
  505. 3 =>
  506. array (
  507. 0 => NULL,
  508. 1 => NULL,
  509. 2 => NULL,
  510. 3 => NULL,
  511. ),
  512. 4 =>
  513. array (
  514. 0 => NULL,
  515. ),
  516. 5 =>
  517. array (
  518. 0 => NULL,
  519. ),
  520. 6 =>
  521. array (
  522. 0 => NULL,
  523. 1 => NULL,
  524. 2 => NULL,
  525. 3 => NULL,
  526. ),
  527. );
  528. $this->_subst = array (
  529. -1 =>
  530. array (
  531. 0 => false,
  532. 1 => false,
  533. 2 => false,
  534. 3 => false,
  535. 4 => false,
  536. 5 => false,
  537. 6 => false,
  538. 7 => false,
  539. 8 => false,
  540. ),
  541. 0 =>
  542. array (
  543. 0 => false,
  544. 1 => false,
  545. 2 => false,
  546. 3 => false,
  547. 4 => false,
  548. 5 => false,
  549. 6 => false,
  550. 7 => false,
  551. 8 => false,
  552. ),
  553. 1 =>
  554. array (
  555. 0 => false,
  556. 1 => false,
  557. 2 => false,
  558. 3 => false,
  559. 4 => false,
  560. 5 => false,
  561. 6 => false,
  562. 7 => false,
  563. 8 => false,
  564. ),
  565. 2 =>
  566. array (
  567. 0 => false,
  568. 1 => false,
  569. 2 => false,
  570. 3 => false,
  571. 4 => false,
  572. 5 => false,
  573. 6 => false,
  574. 7 => false,
  575. 8 => false,
  576. ),
  577. 3 =>
  578. array (
  579. 0 => false,
  580. 1 => false,
  581. 2 => false,
  582. 3 => false,
  583. ),
  584. 4 =>
  585. array (
  586. 0 => false,
  587. ),
  588. 5 =>
  589. array (
  590. 0 => false,
  591. ),
  592. 6 =>
  593. array (
  594. 0 => false,
  595. 1 => false,
  596. 2 => false,
  597. 3 => false,
  598. ),
  599. );
  600. $this->_conditions = array (
  601. );
  602. $this->_kwmap = array (
  603. 'builtin' => 'builtin',
  604. 'reserved' => 'reserved',
  605. );
  606. $this->_defClass = 'code';
  607. $this->_checkDefines();
  608. }
  609. }