diff options
Diffstat (limited to 'inc/geshi/javascript.php')
-rw-r--r-- | inc/geshi/javascript.php | 62 |
1 files changed, 42 insertions, 20 deletions
diff --git a/inc/geshi/javascript.php b/inc/geshi/javascript.php index 93997a70c..b96d1b5b6 100644 --- a/inc/geshi/javascript.php +++ b/inc/geshi/javascript.php @@ -4,13 +4,15 @@ * -------------- * Author: Ben Keen (ben.keen@gmail.com) * Copyright: (c) 2004 Ben Keen (ben.keen@gmail.com), Nigel McNie (http://qbnz.com/highlighter) - * Release Version: 1.0.8.10 + * Release Version: 1.0.8.11 * Date Started: 2004/06/20 * * JavaScript language file for GeSHi. * * CHANGES * ------- + * 2012/06/27 (1.0.8.11) + * - Reordered Keyword Groups to reflect syntactical meaning of keywords * 2008/05/23 (1.0.7.22) * - Added description of extra language features (SF#1970248) * 2004/11/27 (1.0.1) @@ -54,23 +56,38 @@ $language_data = array ( 'ESCAPE_CHAR' => '\\', 'KEYWORDS' => array( 1 => array( - 'as', 'break', 'case', 'catch', 'continue', 'decodeURI', 'delete', 'do', - 'else', 'encodeURI', 'eval', 'finally', 'for', 'if', 'in', 'is', 'item', - 'instanceof', 'return', 'switch', 'this', 'throw', 'try', 'typeof', 'void', - 'while', 'write', 'with' + //reserved/keywords; also some non-reserved keywords + 'break','case','catch','const','continue', + 'default','delete','do', + 'else', + 'finally','for','function', + 'get','goto', + 'if','in','instanceof', + 'new', + 'prototype', + 'return', + 'set','static','switch', + 'this','throw','try','typeof', + 'var','void' ), 2 => array( - 'class', 'const', 'default', 'debugger', 'export', 'extends', 'false', - 'function', 'import', 'namespace', 'new', 'null', 'package', 'private', - 'protected', 'public', 'super', 'true', 'use', 'var' + //reserved/non-keywords; metaconstants + 'false','null','true','undefined','NaN','Infinity' ), 3 => array( - // common functions for Window object - 'alert', 'back', 'blur', 'close', 'confirm', 'focus', 'forward', 'home', - 'name', 'navigate', 'onblur', 'onerror', 'onfocus', 'onload', 'onmove', - 'onresize', 'onunload', 'open', 'print', 'prompt', 'scroll', 'status', - 'stop', - ) + //magic properties/functions + '__proto__','__defineGetter__','__defineSetter__','hasOwnProperty','hasProperty' + ), + 4 => array( + //type constructors + 'Object', 'Function', 'Date', 'Math', 'String', 'Number', 'Boolean', 'Array' + ), + 5 => array( + //reserved, but invalid in language + 'abstract','boolean','byte','char','class','debugger','double','enum','export','extends', + 'final','float','implements','import','int','interface','long','native', + 'short','super','synchronized','throws','transient','volatile' + ), ), 'SYMBOLS' => array( '(', ')', '[', ']', '{', '}', @@ -81,15 +98,18 @@ $language_data = array ( ), 'CASE_SENSITIVE' => array( GESHI_COMMENTS => false, - 1 => false, - 2 => false, - 3 => false + 1 => true, + 2 => true, + 3 => true, + 4 => true, + 5 => true ), 'STYLES' => array( 'KEYWORDS' => array( 1 => 'color: #000066; font-weight: bold;', 2 => 'color: #003366; font-weight: bold;', - 3 => 'color: #000066;' + 3 => 'color: #000066;', + 5 => 'color: #FF0000;' ), 'COMMENTS' => array( 1 => 'color: #006600; font-style: italic;', @@ -126,8 +146,10 @@ $language_data = array ( 'URLS' => array( 1 => '', 2 => '', - 3 => '' - ), + 3 => '', + 4 => '', + 5 => '' + ), 'OOLANG' => true, 'OBJECT_SPLITTERS' => array( 1 => '.' |