KXStudio Website https://kx.studio/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

152 lines
5.1KB

  1. <?php
  2. /*************************************************************************************
  3. * javascript.php
  4. * --------------
  5. * Author: Ben Keen (ben.keen@gmail.com)
  6. * Copyright: (c) 2004 Ben Keen (ben.keen@gmail.com), Nigel McNie (http://qbnz.com/highlighter)
  7. * Release Version: 1.0.8.10
  8. * Date Started: 2004/06/20
  9. *
  10. * JavaScript language file for GeSHi.
  11. *
  12. * CHANGES
  13. * -------
  14. * 2008/05/23 (1.0.7.22)
  15. * - Added description of extra language features (SF#1970248)
  16. * 2004/11/27 (1.0.1)
  17. * - Added support for multiple object splitters
  18. * 2004/10/27 (1.0.0)
  19. * - First Release
  20. *
  21. * TODO (updated 2004/11/27)
  22. * -------------------------
  23. *
  24. *************************************************************************************
  25. *
  26. * This file is part of GeSHi.
  27. *
  28. * GeSHi is free software; you can redistribute it and/or modify
  29. * it under the terms of the GNU General Public License as published by
  30. * the Free Software Foundation; either version 2 of the License, or
  31. * (at your option) any later version.
  32. *
  33. * GeSHi is distributed in the hope that it will be useful,
  34. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  35. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  36. * GNU General Public License for more details.
  37. *
  38. * You should have received a copy of the GNU General Public License
  39. * along with GeSHi; if not, write to the Free Software
  40. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  41. *
  42. ************************************************************************************/
  43. $language_data = array (
  44. 'LANG_NAME' => 'Javascript',
  45. 'COMMENT_SINGLE' => array(1 => '//'),
  46. 'COMMENT_MULTI' => array('/*' => '*/'),
  47. 'COMMENT_REGEXP' => array(
  48. //Regular Expressions
  49. 2 => "/(?<=[\\s^])(s|tr|y)\\/(?!\*)(?!\s)(?:\\\\.|(?!\n)[^\\/\\\\])+(?<!\s)\\/(?!\s)(?:\\\\.|(?!\n)[^\\/\\\\])*(?<!\s)\\/[msixpogcde]*(?=[\\s$\\.\\;])|(?<=[\\s^(=])(m|q[qrwx]?)?\\/(?!\*)(?!\s)(?:\\\\.|(?!\n)[^\\/\\\\])+(?<!\s)\\/[msixpogc]*(?=[\\s$\\.\\,\\;\\)])/iU"
  50. ),
  51. 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
  52. 'QUOTEMARKS' => array("'", '"'),
  53. 'ESCAPE_CHAR' => '\\',
  54. 'KEYWORDS' => array(
  55. 1 => array(
  56. 'as', 'break', 'case', 'catch', 'continue', 'decodeURI', 'delete', 'do',
  57. 'else', 'encodeURI', 'eval', 'finally', 'for', 'if', 'in', 'is', 'item',
  58. 'instanceof', 'return', 'switch', 'this', 'throw', 'try', 'typeof', 'void',
  59. 'while', 'write', 'with'
  60. ),
  61. 2 => array(
  62. 'class', 'const', 'default', 'debugger', 'export', 'extends', 'false',
  63. 'function', 'import', 'namespace', 'new', 'null', 'package', 'private',
  64. 'protected', 'public', 'super', 'true', 'use', 'var'
  65. ),
  66. 3 => array(
  67. // common functions for Window object
  68. 'alert', 'back', 'blur', 'close', 'confirm', 'focus', 'forward', 'home',
  69. 'name', 'navigate', 'onblur', 'onerror', 'onfocus', 'onload', 'onmove',
  70. 'onresize', 'onunload', 'open', 'print', 'prompt', 'scroll', 'status',
  71. 'stop',
  72. )
  73. ),
  74. 'SYMBOLS' => array(
  75. '(', ')', '[', ']', '{', '}',
  76. '+', '-', '*', '/', '%',
  77. '!', '@', '&', '|', '^',
  78. '<', '>', '=',
  79. ',', ';', '?', ':'
  80. ),
  81. 'CASE_SENSITIVE' => array(
  82. GESHI_COMMENTS => false,
  83. 1 => false,
  84. 2 => false,
  85. 3 => false
  86. ),
  87. 'STYLES' => array(
  88. 'KEYWORDS' => array(
  89. 1 => 'color: #000066; font-weight: bold;',
  90. 2 => 'color: #003366; font-weight: bold;',
  91. 3 => 'color: #000066;'
  92. ),
  93. 'COMMENTS' => array(
  94. 1 => 'color: #006600; font-style: italic;',
  95. 2 => 'color: #009966; font-style: italic;',
  96. 'MULTI' => 'color: #006600; font-style: italic;'
  97. ),
  98. 'ESCAPE_CHAR' => array(
  99. 0 => 'color: #000099; font-weight: bold;'
  100. ),
  101. 'BRACKETS' => array(
  102. 0 => 'color: #009900;'
  103. ),
  104. 'STRINGS' => array(
  105. 0 => 'color: #3366CC;'
  106. ),
  107. 'NUMBERS' => array(
  108. 0 => 'color: #CC0000;'
  109. ),
  110. 'METHODS' => array(
  111. 1 => 'color: #660066;'
  112. ),
  113. 'SYMBOLS' => array(
  114. 0 => 'color: #339933;'
  115. ),
  116. 'REGEXPS' => array(
  117. ),
  118. 'SCRIPT' => array(
  119. 0 => '',
  120. 1 => '',
  121. 2 => '',
  122. 3 => ''
  123. )
  124. ),
  125. 'URLS' => array(
  126. 1 => '',
  127. 2 => '',
  128. 3 => ''
  129. ),
  130. 'OOLANG' => true,
  131. 'OBJECT_SPLITTERS' => array(
  132. 1 => '.'
  133. ),
  134. 'REGEXPS' => array(
  135. ),
  136. 'STRICT_MODE_APPLIES' => GESHI_MAYBE,
  137. 'SCRIPT_DELIMITERS' => array(
  138. 0 => array(
  139. '<script type="text/javascript">' => '</script>'
  140. ),
  141. 1 => array(
  142. '<script language="javascript">' => '</script>'
  143. )
  144. ),
  145. 'HIGHLIGHT_STRICT_BLOCK' => array(
  146. 0 => true,
  147. 1 => true
  148. )
  149. );
  150. ?>