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.

174 lines
5.6KB

  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.11
  8. * Date Started: 2004/06/20
  9. *
  10. * JavaScript language file for GeSHi.
  11. *
  12. * CHANGES
  13. * -------
  14. * 2012/06/27 (1.0.8.11)
  15. * - Reordered Keyword Groups to reflect syntactical meaning of keywords
  16. * 2008/05/23 (1.0.7.22)
  17. * - Added description of extra language features (SF#1970248)
  18. * 2004/11/27 (1.0.1)
  19. * - Added support for multiple object splitters
  20. * 2004/10/27 (1.0.0)
  21. * - First Release
  22. *
  23. * TODO (updated 2004/11/27)
  24. * -------------------------
  25. *
  26. *************************************************************************************
  27. *
  28. * This file is part of GeSHi.
  29. *
  30. * GeSHi is free software; you can redistribute it and/or modify
  31. * it under the terms of the GNU General Public License as published by
  32. * the Free Software Foundation; either version 2 of the License, or
  33. * (at your option) any later version.
  34. *
  35. * GeSHi is distributed in the hope that it will be useful,
  36. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  37. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  38. * GNU General Public License for more details.
  39. *
  40. * You should have received a copy of the GNU General Public License
  41. * along with GeSHi; if not, write to the Free Software
  42. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  43. *
  44. ************************************************************************************/
  45. $language_data = array (
  46. 'LANG_NAME' => 'Javascript',
  47. 'COMMENT_SINGLE' => array(1 => '//'),
  48. 'COMMENT_MULTI' => array('/*' => '*/'),
  49. 'COMMENT_REGEXP' => array(
  50. //Regular Expressions
  51. 2 => "/(?<=[\\s^])(s|tr|y)\\/(?!\*)(?!\s)(?:\\\\.|(?!\n)[^\\/\\\\])+(?<!\s)\\/(?!\s)(?:\\\\.|(?!\n)[^\\/\\\\])*(?<!\s)\\/[msixpogcde]*(?=[\\s$\\.\\;])|(?<=[\\s^(=])(m|q[qrwx]?)?\\/(?!\*)(?!\s)(?:\\\\.|(?!\n)[^\\/\\\\])+(?<!\s)\\/[msixpogc]*(?=[\\s$\\.\\,\\;\\)])/iU"
  52. ),
  53. 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
  54. 'QUOTEMARKS' => array("'", '"'),
  55. 'ESCAPE_CHAR' => '\\',
  56. 'KEYWORDS' => array(
  57. 1 => array(
  58. //reserved/keywords; also some non-reserved keywords
  59. 'break','case','catch','const','continue',
  60. 'default','delete','do',
  61. 'else',
  62. 'finally','for','function',
  63. 'get','goto',
  64. 'if','in','instanceof',
  65. 'new',
  66. 'prototype',
  67. 'return',
  68. 'set','static','switch',
  69. 'this','throw','try','typeof',
  70. 'var','void'
  71. ),
  72. 2 => array(
  73. //reserved/non-keywords; metaconstants
  74. 'false','null','true','undefined','NaN','Infinity'
  75. ),
  76. 3 => array(
  77. //magic properties/functions
  78. '__proto__','__defineGetter__','__defineSetter__','hasOwnProperty','hasProperty'
  79. ),
  80. 4 => array(
  81. //type constructors
  82. 'Object', 'Function', 'Date', 'Math', 'String', 'Number', 'Boolean', 'Array'
  83. ),
  84. 5 => array(
  85. //reserved, but invalid in language
  86. 'abstract','boolean','byte','char','class','debugger','double','enum','export','extends',
  87. 'final','float','implements','import','int','interface','long','native',
  88. 'short','super','synchronized','throws','transient','volatile'
  89. ),
  90. ),
  91. 'SYMBOLS' => array(
  92. '(', ')', '[', ']', '{', '}',
  93. '+', '-', '*', '/', '%',
  94. '!', '@', '&', '|', '^',
  95. '<', '>', '=',
  96. ',', ';', '?', ':'
  97. ),
  98. 'CASE_SENSITIVE' => array(
  99. GESHI_COMMENTS => false,
  100. 1 => true,
  101. 2 => true,
  102. 3 => true,
  103. 4 => true,
  104. 5 => true
  105. ),
  106. 'STYLES' => array(
  107. 'KEYWORDS' => array(
  108. 1 => 'color: #000066; font-weight: bold;',
  109. 2 => 'color: #003366; font-weight: bold;',
  110. 3 => 'color: #000066;',
  111. 5 => 'color: #FF0000;'
  112. ),
  113. 'COMMENTS' => array(
  114. 1 => 'color: #006600; font-style: italic;',
  115. 2 => 'color: #009966; font-style: italic;',
  116. 'MULTI' => 'color: #006600; font-style: italic;'
  117. ),
  118. 'ESCAPE_CHAR' => array(
  119. 0 => 'color: #000099; font-weight: bold;'
  120. ),
  121. 'BRACKETS' => array(
  122. 0 => 'color: #009900;'
  123. ),
  124. 'STRINGS' => array(
  125. 0 => 'color: #3366CC;'
  126. ),
  127. 'NUMBERS' => array(
  128. 0 => 'color: #CC0000;'
  129. ),
  130. 'METHODS' => array(
  131. 1 => 'color: #660066;'
  132. ),
  133. 'SYMBOLS' => array(
  134. 0 => 'color: #339933;'
  135. ),
  136. 'REGEXPS' => array(
  137. ),
  138. 'SCRIPT' => array(
  139. 0 => '',
  140. 1 => '',
  141. 2 => '',
  142. 3 => ''
  143. )
  144. ),
  145. 'URLS' => array(
  146. 1 => '',
  147. 2 => '',
  148. 3 => '',
  149. 4 => '',
  150. 5 => ''
  151. ),
  152. 'OOLANG' => true,
  153. 'OBJECT_SPLITTERS' => array(
  154. 1 => '.'
  155. ),
  156. 'REGEXPS' => array(
  157. ),
  158. 'STRICT_MODE_APPLIES' => GESHI_MAYBE,
  159. 'SCRIPT_DELIMITERS' => array(
  160. 0 => array(
  161. '<script type="text/javascript">' => '</script>'
  162. ),
  163. 1 => array(
  164. '<script language="javascript">' => '</script>'
  165. )
  166. ),
  167. 'HIGHLIGHT_STRICT_BLOCK' => array(
  168. 0 => true,
  169. 1 => true
  170. )
  171. );
  172. ?>