summaryrefslogtreecommitdiff
path: root/inc/geshi/javascript.php
diff options
context:
space:
mode:
Diffstat (limited to 'inc/geshi/javascript.php')
-rw-r--r--inc/geshi/javascript.php70
1 files changed, 47 insertions, 23 deletions
diff --git a/inc/geshi/javascript.php b/inc/geshi/javascript.php
index 429cdd653..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.8
+ * 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)
@@ -45,30 +47,47 @@ $language_data = array (
'LANG_NAME' => 'Javascript',
'COMMENT_SINGLE' => array(1 => '//'),
'COMMENT_MULTI' => array('/*' => '*/'),
- //Regular Expressions
- 'COMMENT_REGEXP' => array(2 => "/(?<=[\\s^])s\\/(?:\\\\.|(?!\n)[^\\/\\\\])+\\/(?:\\\\.|(?!\n)[^\\/\\\\])+\\/[gimsu]*(?=[\\s$\\.\\;])|(?<=[\\s^(=])m?\\/(?:\\\\.|(?!\n)[^\\/\\\\])+\\/[gimsu]*(?=[\\s$\\.\\,\\;\\)])/iU"),
+ 'COMMENT_REGEXP' => array(
+ //Regular Expressions
+ 2 => "/(?<=[\\s^])(s|tr|y)\\/(?!\*)(?!\s)(?:\\\\.|(?!\n)[^\\/\\\\])+(?<!\s)\\/(?!\s)(?:\\\\.|(?!\n)[^\\/\\\\])*(?<!\s)\\/[msixpogcde]*(?=[\\s$\\.\\;])|(?<=[\\s^(=])(m|q[qrwx]?)?\\/(?!\*)(?!\s)(?:\\\\.|(?!\n)[^\\/\\\\])+(?<!\s)\\/[msixpogc]*(?=[\\s$\\.\\,\\;\\)])/iU"
+ ),
'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
'QUOTEMARKS' => 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(
'(', ')', '[', ']', '{', '}',
@@ -79,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;',
@@ -124,8 +146,10 @@ $language_data = array (
'URLS' => array(
1 => '',
2 => '',
- 3 => ''
- ),
+ 3 => '',
+ 4 => '',
+ 5 => ''
+ ),
'OOLANG' => true,
'OBJECT_SPLITTERS' => array(
1 => '.'
@@ -147,4 +171,4 @@ $language_data = array (
)
);
-?>
+?> \ No newline at end of file