Add syntax highglighting for ES6 "let", "const" and "of" keywords.
authorjond@apple.com <jond@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 23 May 2016 20:14:45 +0000 (20:14 +0000)
committerjond@apple.com <jond@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 23 May 2016 20:14:45 +0000 (20:14 +0000)
https://bugs.webkit.org/show_bug.cgi?id=157994

Reviewed by Geoffrey Garen.

* wp-content/plugins/hyperlight/hyperlight/languages/javascript.php:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@201291 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Websites/webkit.org/ChangeLog
Websites/webkit.org/wp-content/plugins/hyperlight/hyperlight/languages/javascript.php

index 3ed48ab..7ed45d4 100644 (file)
@@ -1,3 +1,12 @@
+2016-05-23  Jon Davis  <jond@apple.com>
+
+        Add syntax highglighting for ES6 "let", "const" and "of" keywords.
+        https://bugs.webkit.org/show_bug.cgi?id=157994
+
+        Reviewed by Geoffrey Garen.
+
+        * wp-content/plugins/hyperlight/hyperlight/languages/javascript.php:
+
 2016-05-13  Brady Eidson  <beidson@apple.com>
 
         Extend protector naming code style guideline to cover operator= assignment.
index 675caf0..d5858e0 100644 (file)
@@ -16,11 +16,11 @@ class JavaScriptLanguage extends HyperLanguage {
 
         $this->addStates(array(
             'init' => array(
-                   'string', 'char', 'number', 'comment',
-                   'keyword' => array('', 'type', 'modifier','control','literal', 'operator'),
-                   'identifier',
-                   'operator'
-               )
+                'string', 'char', 'number', 'comment',
+                'keyword' => array('', 'type', 'modifier','control','literal', 'operator'),
+                'identifier',
+                'operator'
+            )
         ));
 
         $this->addRules(array(
@@ -32,22 +32,22 @@ class JavaScriptLanguage extends HyperLanguage {
             'comment' => Rule::C_COMMENT,
             'keyword' => array(
                 array(
-                                       'super','this','arguments','prototype','constructor'
+                    'super','this','arguments','prototype','constructor'
                 ),
                 'type' => array(
-                    'boolean', 'byte', 'char', 'class', 'double', 'enum', 'float', 'function', 'int', 'interface', 'long', 'short', 'var', 'void'
+                    'boolean', 'byte', 'char', 'class', 'const', 'double', 'enum', 'float', 'function', 'int', 'interface', 'let', 'long', 'short', 'var', 'void'
+                ),
+                'modifier' => array(
+                    'const','export','extends','final','implements','native','private','protected','public','static','synchronized','throws','transient','volatile'
+                ),
+                'control' => array(
+                    'break','case','catch','continue','default','do','else','finally','for','goto','if','import','package','return','switch','throw','try','while'
                 ),
-                               'modifier' => array(
-                                       'const','export','extends','final','implements','native','private','protected','public','static','synchronized','throws','transient','volatile'
-                               ),
-                               'control' => array(
-                                       'break','case','catch','continue','default','do','else','finally','for','goto','if','import','package','return','switch','throw','try','while'
-                               ),
                 'literal' => array(
                     'false', 'this', 'true', 'null', 'undefined', 'NaN'
                 ),
                 'operator' => array(
-                                       'delete','in','instanceof','new','typeof','void','with'
+                    'delete', 'in', 'instanceof', 'new', 'of', 'typeof', 'void', 'with'
                 ),
             ),
             'identifier' => Rule::C_IDENTIFIER,