Title: [141774] trunk
Revision
141774
Author
commit-qu...@webkit.org
Date
2013-02-04 09:42:19 -0800 (Mon, 04 Feb 2013)

Log Message

Web Inspector: add round braces to _javascript_ tokenizer
https://bugs.webkit.org/show_bug.cgi?id=108692

Patch by Andrey Lushnikov <lushni...@chromium.org> on 2013-02-04
Reviewed by Pavel Feldman.

Source/WebCore:

Change SourceJavascriptTokenizer.re2js file to produce "brace-start"
and "brace-end" tokens for round braces.
Regenerate SourceJavascriptTokenizer.js according to new re2js file.

No new tests: no change in behaviour.

* inspector/front-end/SourceJavaScriptTokenizer.js:
(WebInspector.SourceJavaScriptTokenizer.prototype.nextToken):
* inspector/front-end/SourceJavaScriptTokenizer.re2js:

LayoutTests:

Updated test expectations to correspond to new tokens "brace-start"
and "brace-end" in _javascript_ tokenizer.

* inspector/editor/highlighter-basics-expected.txt:
* inspector/editor/text-editor-long-line-expected.txt:
* inspector/syntax-highlight-html-expected.txt:
* inspector/syntax-highlight-_javascript_-expected.txt:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (141773 => 141774)


--- trunk/LayoutTests/ChangeLog	2013-02-04 17:38:58 UTC (rev 141773)
+++ trunk/LayoutTests/ChangeLog	2013-02-04 17:42:19 UTC (rev 141774)
@@ -1,3 +1,18 @@
+2013-02-04  Andrey Lushnikov  <lushni...@chromium.org>
+
+        Web Inspector: add round braces to _javascript_ tokenizer
+        https://bugs.webkit.org/show_bug.cgi?id=108692
+
+        Reviewed by Pavel Feldman.
+
+        Updated test expectations to correspond to new tokens "brace-start"
+        and "brace-end" in _javascript_ tokenizer.
+
+        * inspector/editor/highlighter-basics-expected.txt:
+        * inspector/editor/text-editor-long-line-expected.txt:
+        * inspector/syntax-highlight-html-expected.txt:
+        * inspector/syntax-highlight-_javascript_-expected.txt:
+
 2013-02-04  Sami Kyostila  <skyos...@chromium.org>
 
         Disable -webkit-overflow-scrolling CSS attribute on Chromium

Modified: trunk/LayoutTests/inspector/editor/highlighter-basics-expected.txt (141773 => 141774)


--- trunk/LayoutTests/inspector/editor/highlighter-basics-expected.txt	2013-02-04 17:38:58 UTC (rev 141773)
+++ trunk/LayoutTests/inspector/editor/highlighter-basics-expected.txt	2013-02-04 17:42:19 UTC (rev 141774)
@@ -91,7 +91,7 @@
 15 :  * line #6 : _javascript_-ident[3-7] _javascript_-number[9-10]
 16 :  * line #7 : _javascript_-ident[3-7] _javascript_-number[9-10]
 17 :  * line #8 : _javascript_-ident[3-7] _javascript_-number[9-10]
-18 :  * var a = new A(); //*/ : _javascript_-keyword[3-6] _javascript_-ident[7-8] _javascript_-keyword[11-14] _javascript_-ident[15-16] _javascript_-comment[20-24]
+18 :  * var a = new A(); //*/ : _javascript_-keyword[3-6] _javascript_-ident[7-8] _javascript_-keyword[11-14] _javascript_-ident[15-16] brace-start[16-17] brace-end[17-18] _javascript_-comment[20-24]
 19 : some text : _javascript_-ident[0-4] _javascript_-ident[5-9]
 20 :  :
 
@@ -113,7 +113,7 @@
 15 :  * line #6 : _javascript_-ident[3-7] _javascript_-number[9-10]
 16 :  * line #7 : _javascript_-ident[3-7] _javascript_-number[9-10]
 17 :  * line #8 : _javascript_-ident[3-7] _javascript_-number[9-10]
-18 :  * var a = new A(); //*/ : _javascript_-keyword[3-6] _javascript_-ident[7-8] _javascript_-keyword[11-14] _javascript_-ident[15-16] _javascript_-comment[20-24]
+18 :  * var a = new A(); //*/ : _javascript_-keyword[3-6] _javascript_-ident[7-8] _javascript_-keyword[11-14] _javascript_-ident[15-16] brace-start[16-17] brace-end[17-18] _javascript_-comment[20-24]
 19 : some text : _javascript_-ident[0-4] _javascript_-ident[5-9]
 20 :  :
 

Modified: trunk/LayoutTests/inspector/editor/text-editor-long-line-expected.txt (141773 => 141774)


--- trunk/LayoutTests/inspector/editor/text-editor-long-line-expected.txt	2013-02-04 17:38:58 UTC (rev 141773)
+++ trunk/LayoutTests/inspector/editor/text-editor-long-line-expected.txt	2013-02-04 17:42:19 UTC (rev 141774)
@@ -2,5 +2,5 @@
 
 
 <div class="inner-container" tabindex="0">
-<div class="webkit-line-content"><span class="webkit-_javascript_-comment">/* START */</span> <span class="webkit-_javascript_-keyword">this</span>.<span class="webkit-_javascript_-ident">field</span> = <span class="webkit-_javascript_-string">"foo"</span>; <span class="webkit-_javascript_-comment">/* comment */</span> <span class="webkit-_javascript_-keyword">function</span> <span class="webkit-_javascript_-ident">bar</span>() <span class="webkit-block-start">{</span> <span class="webkit-_javascript_-keyword">return</span> <span class="webkit-_javascript_-keyword">null</span>; <span class="webkit-block-end">}</span><span class="webkit-_javascript_-keyword">this</span>.<span class="webkit-_javascript_-ident">field</span> = <span class="webkit-_javascript_-string">"foo"</span>; <span class="webkit-_javascript_-comment">/* comment */</span> function bar() { return null; }this.field = "foo"; /* comment */ function bar() { return null; }this.field = "foo"; /* comment */ function bar() { return null; }this.field = "foo"; /* comment */ function bar() { return null; }this.field = "foo"; /* comment */ function bar() { return null; }this.field = "foo"; /* comment */ function bar() { return null; }this.field = "foo"; /* comment */ function bar() { return null; }this.field = "foo"; /* comment */ function bar() { return null; }this.field = "foo"; /* comment */ function bar() { return null; }this.field = "foo"; /* comment */ function bar() { return null; }this.field = "foo"; /* comment */ function bar() { return null; }this.field = "foo"; /* comment */ function bar() { return null; }this.field = "foo"; /* comment */ function bar() { return null; }this.field = "foo"; /* comment */ function bar() { return null; }this.field = "foo"; /* comment */ function bar() { return null; }this.field = "foo"; /* comment */ function bar() { return null; }this.field = "foo"; /* comment */ function bar() { return null; }this.field = "foo"; /* comment */ function bar() { return null; }this.field = "foo"; /* comment */ function bar() { return null; }this.field = "foo"; /* comment */ function bar() { return null; }this.field = "foo"; /* comment */ function bar() { return null; }this.field = "foo"; /* comment */ function bar() { return null; }this.field = "foo"; /* comment */ function bar() { return null; }this.field = "foo"; /* comment */ function bar() { return null; }this.field = "foo"; /* comment */ function bar() { return null; }this.field = "foo"; /* comment */ function bar() { return null; }this.field = "foo"; /* comment */ function bar() { return null; }this.field = "foo"; /* comment */ function bar() { return null; }this.field = "foo"; /* comment */ function bar() { return null; }this.field = "foo"; /* comment */ function bar() { return null; }this.field = "foo"; /* comment */ function bar() { return null; }/* FINISH */</div></div>
+<div class="webkit-line-content"><span class="webkit-_javascript_-comment">/* START */</span> <span class="webkit-_javascript_-keyword">this</span>.<span class="webkit-_javascript_-ident">field</span> = <span class="webkit-_javascript_-string">"foo"</span>; <span class="webkit-_javascript_-comment">/* comment */</span> <span class="webkit-_javascript_-keyword">function</span> <span class="webkit-_javascript_-ident">bar</span><span class="webkit-brace-start">(</span><span class="webkit-brace-end">)</span> <span class="webkit-block-start">{</span> <span class="webkit-_javascript_-keyword">return</span> <span class="webkit-_javascript_-keyword">null</span>; <span class="webkit-block-end">}</span><span class="webkit-_javascript_-keyword">this</span>.<span class="webkit-_javascript_-ident">field</span> = <span class="webkit-_javascript_-string">"foo"</span>; <span class="webkit-_javascript_-comment">/* comment */</span> function bar() { return null; }this.field = "foo"; /* comment */ function bar() { return null; }this.field = "foo"; /* comment */ function bar() { return null; }this.field = "foo"; /* comment */ function bar() { return null; }this.field = "foo"; /* comment */ function bar() { return null; }this.field = "foo"; /* comment */ function bar() { return null; }this.field = "foo"; /* comment */ function bar() { return null; }this.field = "foo"; /* comment */ function bar() { return null; }this.field = "foo"; /* comment */ function bar() { return null; }this.field = "foo"; /* comment */ function bar() { return null; }this.field = "foo"; /* comment */ function bar() { return null; }this.field = "foo"; /* comment */ function bar() { return null; }this.field = "foo"; /* comment */ function bar() { return null; }this.field = "foo"; /* comment */ function bar() { return null; }this.field = "foo"; /* comment */ function bar() { return null; }this.field = "foo"; /* comment */ function bar() { return null; }this.field = "foo"; /* comment */ function bar() { return null; }this.field = "foo"; /* comment */ function bar() { return null; }this.field = "foo"; /* comment */ function bar() { return null; }this.field = "foo"; /* comment */ function bar() { return null; }this.field = "foo"; /* comment */ function bar() { return null; }this.field = "foo"; /* comment */ function bar() { return null; }this.field = "foo"; /* comment */ function bar() { return null; }this.field = "foo"; /* comment */ function bar() { return null; }this.field = "foo"; /* comment */ function bar() { return null; }this.field = "foo"; /* comment */ function bar() { return null; }this.field = "foo"; /* comment */ function bar() { return null; }this.field = "foo"; /* comment */ function bar() { return null; }this.field = "foo"; /* comment */ function bar() { return null; }this.field = "foo"; /* comment */ function bar() { return null; }this.field = "foo"; /* comment */ function bar() { return null; }/* FINISH */</div></div>
 

Modified: trunk/LayoutTests/inspector/syntax-highlight-html-expected.txt (141773 => 141774)


--- trunk/LayoutTests/inspector/syntax-highlight-html-expected.txt	2013-02-04 17:38:58 UTC (rev 141773)
+++ trunk/LayoutTests/inspector/syntax-highlight-html-expected.txt	2013-02-04 17:42:19 UTC (rev 141774)
@@ -7,5 +7,5 @@
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">: webkit-html-doctype,webkit-html-doctype,webkit-html-doctype
 <!--div><div foobar-->: webkit-html-comment
 <script></script><!--div-->: webkit-html-tag,webkit-html-tag,webkit-html-tag,webkit-html-tag,webkit-html-comment
-<script type="text/_javascript_">document.write('<script type="text/_javascript_"></' + 'script>');</script>: webkit-html-tag,*,webkit-html-attribute-name,*,webkit-html-attribute-value,webkit-html-tag,webkit-_javascript_-ident,*,webkit-_javascript_-ident,*,webkit-_javascript_-string,*,webkit-_javascript_-string,*,webkit-html-tag,webkit-html-tag
+<script type="text/_javascript_">document.write('<script type="text/_javascript_"></' + 'script>');</script>: webkit-html-tag,*,webkit-html-attribute-name,*,webkit-html-attribute-value,webkit-html-tag,webkit-_javascript_-ident,*,webkit-_javascript_-ident,webkit-brace-start,webkit-_javascript_-string,*,webkit-_javascript_-string,webkit-brace-end,*,webkit-html-tag,webkit-html-tag
 

Modified: trunk/LayoutTests/inspector/syntax-highlight-_javascript_-expected.txt (141773 => 141774)


--- trunk/LayoutTests/inspector/syntax-highlight-_javascript_-expected.txt	2013-02-04 17:38:58 UTC (rev 141773)
+++ trunk/LayoutTests/inspector/syntax-highlight-_javascript_-expected.txt	2013-02-04 17:42:19 UTC (rev 141774)
@@ -3,10 +3,10 @@
 return'foo';: webkit-_javascript_-keyword,webkit-_javascript_-string,*
 /\//g: webkit-_javascript_-regexp
 //ig';: webkit-_javascript_-comment
-1 / 2 + /a/.test('a');: webkit-_javascript_-number,*,webkit-_javascript_-number,*,webkit-_javascript_-regexp,*,webkit-_javascript_-ident,*,webkit-_javascript_-string,*
+1 / 2 + /a/.test('a');: webkit-_javascript_-number,*,webkit-_javascript_-number,*,webkit-_javascript_-regexp,*,webkit-_javascript_-ident,webkit-brace-start,webkit-_javascript_-string,webkit-brace-end,*
 "\"/".length / 2: webkit-_javascript_-string,*,webkit-_javascript_-ident,*,webkit-_javascript_-number
 var foo = 1/*/***//2: webkit-_javascript_-keyword,*,webkit-_javascript_-ident,*,webkit-_javascript_-number,webkit-_javascript_-comment,*,webkit-_javascript_-number
-/*comment*//.*/.test('a'): webkit-_javascript_-comment,webkit-_javascript_-regexp,*,webkit-_javascript_-ident,*,webkit-_javascript_-string,*
+/*comment*//.*/.test('a'): webkit-_javascript_-comment,webkit-_javascript_-regexp,*,webkit-_javascript_-ident,webkit-brace-start,webkit-_javascript_-string,webkit-brace-end
 'f\
 oo';: webkit-_javascript_-string,,webkit-_javascript_-string,*
 '\f\b\t';: webkit-_javascript_-string,*

Modified: trunk/Source/WebCore/ChangeLog (141773 => 141774)


--- trunk/Source/WebCore/ChangeLog	2013-02-04 17:38:58 UTC (rev 141773)
+++ trunk/Source/WebCore/ChangeLog	2013-02-04 17:42:19 UTC (rev 141774)
@@ -1,3 +1,20 @@
+2013-02-04  Andrey Lushnikov  <lushni...@chromium.org>
+
+        Web Inspector: add round braces to _javascript_ tokenizer
+        https://bugs.webkit.org/show_bug.cgi?id=108692
+
+        Reviewed by Pavel Feldman.
+
+        Change SourceJavascriptTokenizer.re2js file to produce "brace-start"
+        and "brace-end" tokens for round braces.
+        Regenerate SourceJavascriptTokenizer.js according to new re2js file.
+
+        No new tests: no change in behaviour.
+
+        * inspector/front-end/SourceJavaScriptTokenizer.js:
+        (WebInspector.SourceJavaScriptTokenizer.prototype.nextToken):
+        * inspector/front-end/SourceJavaScriptTokenizer.re2js:
+
 2013-02-04  Pavel Feldman  <pfeld...@chromium.org>
 
         Web Inspector: take page scale factor into account when updating overlay.

Modified: trunk/Source/WebCore/inspector/front-end/SourceJavaScriptTokenizer.js (141773 => 141774)


--- trunk/Source/WebCore/inspector/front-end/SourceJavaScriptTokenizer.js	2013-02-04 17:38:58 UTC (rev 141773)
+++ trunk/Source/WebCore/inspector/front-end/SourceJavaScriptTokenizer.js	2013-02-04 17:42:19 UTC (rev 141774)
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.13.5 on Mon Jul  9 18:23:02 2012 */
+/* Generated by re2c 0.13.5 on Sun Feb  3 00:54:08 2013 */
 /*
  * Copyright (C) 2009 Google Inc. All rights reserved.
  *
@@ -40,7 +40,7 @@
   | sed 's|{ gotoCase = \([^; continue; };]*\)|{ gotoCase = \1; continue; }|' \
   | sed 's|yych <= \(0x[0-9a-fA-F]*\)|yych \<\= String.fromCharCode(\1)|' \
   | sed 's|unsigned\ int|var|' \
-  | sed 's|var\ yych|case 1: case 1: var yych|'
+  | sed 's|var\ yych|case 1: case 1: var yych|' > Source/WebCore/inspector/front-end/SourceJavaScriptTokenizer.js
  */
 
 /**
@@ -250,6 +250,8 @@
                         this.tokenType = "block-start";
                     else if (token === "}")
                         this.tokenType = "block-end";
+                    else if (token === "(")
+                        this.tokenType = "brace-start";
                     else this.tokenType = null;
                     return cursor;
                 }
@@ -292,7 +294,7 @@
             { gotoCase = 18; continue; };
 case 26:
             ++cursor;
-            { this.tokenType = null; return cursor; }
+            { this.tokenType = "brace-end"; return cursor; }
 case 28:
             yych = this._charAt(++cursor);
             if (yych == '=') { gotoCase = 43; continue; };
@@ -1189,6 +1191,8 @@
                         this.tokenType = "block-start";
                     else if (token === "}")
                         this.tokenType = "block-end";
+                    else if (token === "(")
+                        this.tokenType = "brace-start";
                     else this.tokenType = null;
                     return cursor;
                 }
@@ -1233,7 +1237,7 @@
 case 147:
             ++cursor;
             this.setLexCondition(this._lexConditions.DIV);
-            { this.tokenType = null; return cursor; }
+            { this.tokenType = "brace-end"; return cursor; }
 case 149:
             yych = this._charAt(++cursor);
             if (yych == '=') { gotoCase = 163; continue; };

Modified: trunk/Source/WebCore/inspector/front-end/SourceJavaScriptTokenizer.re2js (141773 => 141774)


--- trunk/Source/WebCore/inspector/front-end/SourceJavaScriptTokenizer.re2js	2013-02-04 17:38:58 UTC (rev 141773)
+++ trunk/Source/WebCore/inspector/front-end/SourceJavaScriptTokenizer.re2js	2013-02-04 17:42:19 UTC (rev 141774)
@@ -177,7 +177,7 @@
                         this.tokenType = "_javascript_-ident";
                     return cursor;
                 }
-                <DIV,NODIV> RightParen => DIV { this.tokenType = null; return cursor; }
+                <DIV,NODIV> RightParen => DIV { this.tokenType = "brace-end"; return cursor; }
                 <DIV,NODIV> Punctuation => NODIV
                 {
                     var token = this._line.charAt(cursorOnEnter);
@@ -185,6 +185,8 @@
                         this.tokenType = "block-start";
                     else if (token === "}")
                         this.tokenType = "block-end";
+                    else if (token === "(")
+                        this.tokenType = "brace-start";
                     else this.tokenType = null;
                     return cursor;
                 }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to