2 /*************************************************************************************
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.7.19
8 * Date Started: 2004/06/20
10 * JavaScript language file for GeSHi.
15 * - Added support for multiple object splitters
19 * TODO (updated 2004/11/27)
20 * -------------------------
22 *************************************************************************************
24 * This file is part of GeSHi.
26 * GeSHi is free software; you can redistribute it and/or modify
27 * it under the terms of the GNU General Public License as published by
28 * the Free Software Foundation; either version 2 of the License, or
29 * (at your option) any later version.
31 * GeSHi is distributed in the hope that it will be useful,
32 * but WITHOUT ANY WARRANTY; without even the implied warranty of
33 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34 * GNU General Public License for more details.
36 * You should have received a copy of the GNU General Public License
37 * along with GeSHi; if not, write to the Free Software
38 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
40 ************************************************************************************/
42 $language_data = array (
43 'LANG_NAME' => 'Javascript',
44 'COMMENT_SINGLE' => array(1 => '//'),
45 'COMMENT_MULTI' => array('/*' => '*/'),
46 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE
,
47 'QUOTEMARKS' => array("'", '"'),
48 'ESCAPE_CHAR' => '\\',
51 'as', 'break', 'case', 'catch', 'continue', 'decodeURI', 'delete', 'do',
52 'else', 'encodeURI', 'eval', 'finally', 'for', 'if', 'in', 'is', 'item',
53 'instanceof', 'return', 'switch', 'this', 'throw', 'try', 'typeof', 'void',
54 'while', 'write', 'with'
57 'class', 'const', 'default', 'debugger', 'export', 'extends', 'false',
58 'function', 'import', 'namespace', 'new', 'null', 'package', 'private',
59 'protected', 'public', 'super', 'true', 'use', 'var'
63 // common functions for Window object
64 'alert', 'back', 'blur', 'close', 'confirm', 'focus', 'forward', 'home',
65 'name', 'navigate', 'onblur', 'onerror', 'onfocus', 'onload', 'onmove',
66 'onresize', 'onunload', 'open', 'print', 'prompt', 'scroll', 'status',
71 '(', ')', '[', ']', '{', '}', '!', '@', '%', '&', '*', '|', '/', '<', '>'
73 'CASE_SENSITIVE' => array(
74 GESHI_COMMENTS
=> false
,
81 1 => 'color: #000066; font-weight: bold;',
82 2 => 'color: #003366; font-weight: bold;',
83 3 => 'color: #000066;'
86 1 => 'color: #009900; font-style: italic;',
87 'MULTI' => 'color: #009900; font-style: italic;'
89 'ESCAPE_CHAR' => array(
90 0 => 'color: #000099; font-weight: bold;'
93 0 => 'color: #66cc66;'
96 0 => 'color: #3366CC;'
99 0 => 'color: #CC0000;'
102 1 => 'color: #006600;'
105 0 => 'color: #66cc66;'
108 0 => 'color: #0066FF;'
123 'OBJECT_SPLITTERS' => array(
127 0 => "/.*/([igm]*)?" // matches js reg exps
129 'STRICT_MODE_APPLIES' => GESHI_MAYBE
,
130 'SCRIPT_DELIMITERS' => array(
132 '<script type="text/javascript">' => '</script>'
135 '<script language="javascript">' => '</script>'
138 'HIGHLIGHT_STRICT_BLOCK' => array(