Changeset 86554 in webkit


Ignore:
Timestamp:
May 16, 2011 3:51:09 AM (13 years ago)
Author:
apavlov@chromium.org
Message:

2011-05-16 Alexander Pavlov <apavlov@chromium.org>

Reviewed by Pavel Feldman.

Web Inspector: Fix SourceJavaScriptTokenizer keyword parsing
https://bugs.webkit.org/show_bug.cgi?id=60773

  • inspector/syntax-highlight-javascript-expected.txt:
  • inspector/syntax-highlight-javascript.html:

2011-05-16 Alexander Pavlov <apavlov@chromium.org>

Reviewed by Pavel Feldman.

Web Inspector: Fix SourceJavaScriptTokenizer keyword parsing
https://bugs.webkit.org/show_bug.cgi?id=60773

  • inspector/front-end/SourceJavaScriptTokenizer.js: (WebInspector.SourceJavaScriptTokenizer.prototype.nextToken):
  • inspector/front-end/SourceJavaScriptTokenizer.re2js:
Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r86551 r86554  
     12011-05-16  Alexander Pavlov  <apavlov@chromium.org>
     2
     3        Reviewed by Pavel Feldman.
     4
     5        Web Inspector: Fix SourceJavaScriptTokenizer keyword parsing
     6        https://bugs.webkit.org/show_bug.cgi?id=60773
     7
     8        * inspector/syntax-highlight-javascript-expected.txt:
     9        * inspector/syntax-highlight-javascript.html:
     10
    1112011-05-16  Robert Hogan  <robert@webkit.org>
    212
  • trunk/LayoutTests/inspector/syntax-highlight-javascript-expected.txt

    r60562 r86554  
    1616/
    1717*/foo: webkit-javascript-ident,webkit-javascript-comment,,webkit-javascript-comment,,webkit-javascript-comment,webkit-javascript-ident
     18{0: true}: *,webkit-javascript-number,*,webkit-javascript-keyword,*
     19var toString;: webkit-javascript-keyword,*,webkit-javascript-ident,*
    1820
  • trunk/LayoutTests/inspector/syntax-highlight-javascript.html

    r78535 r86554  
    2323    dumpSyntaxHighlightJS("'/\\\n/';");
    2424    dumpSyntaxHighlightJS("foo/**\n/\n*/foo");
     25    dumpSyntaxHighlightJS("{0: true}");
     26    dumpSyntaxHighlightJS("var toString;");
    2527
    2628    InspectorTest.completeTest();
  • trunk/Source/WebCore/ChangeLog

    r86553 r86554  
     12011-05-16  Alexander Pavlov  <apavlov@chromium.org>
     2
     3        Reviewed by Pavel Feldman.
     4
     5        Web Inspector: Fix SourceJavaScriptTokenizer keyword parsing
     6        https://bugs.webkit.org/show_bug.cgi?id=60773
     7
     8        * inspector/front-end/SourceJavaScriptTokenizer.js:
     9        (WebInspector.SourceJavaScriptTokenizer.prototype.nextToken):
     10        * inspector/front-end/SourceJavaScriptTokenizer.re2js:
     11
    1122011-05-16  Nikolas Zimmermann  <nzimmermann@rim.com>
    213
  • trunk/Source/WebCore/inspector/front-end/SourceJavaScriptTokenizer.js

    r86430 r86554  
    1 /* Generated by re2c 0.13.5 on Fri May  6 13:56:13 2011 */
     1/* Generated by re2c 0.13.5 on Fri May 13 20:01:13 2011 */
    22/*
    33 * Copyright (C) 2009 Google Inc. All rights reserved.
     
    3939// | sed 's|yych = \*\([^;]*\)|yych = this._charAt\1|' \
    4040// | sed 's|{ gotoCase = \([^; continue; };]*\)|{ gotoCase = \1; continue; }|' \
     41// | sed 's|yych <= \(0x[0-9a-fA-f]+\)|yych <= String.fromCharCode(\1)|' \
    4142// | sed 's|unsigned\ int|var|' \
    4243// | sed 's|var\ yych|case 1: case 1: var yych|'
     
    252253            {
    253254                    var token = this._line.substring(cursorOnEnter, cursor);
    254                     if (token in this._keywords)
     255                    if (this._keywords[token] === true && token !== "__proto__")
    255256                        this.tokenType = "javascript-keyword";
    256257                    else
     
    456457                    if (yych <= '`') { gotoCase = 21; continue; };
    457458                    if (yych <= 'z') { gotoCase = 49; continue; };
    458                     if (yych <= 0x7F) { gotoCase = 21; continue; };
     459                    if (yych <= String.fromCharCode(0x7F)) { gotoCase = 21; continue; };
    459460                    { gotoCase = 49; continue; };
    460461                }
     
    11841185            {
    11851186                    var token = this._line.substring(cursorOnEnter, cursor);
    1186                     if (token in this._keywords)
     1187                    if (this._keywords[token] === true && token !== "__proto__")
    11871188                        this.tokenType = "javascript-keyword";
    11881189                    else
     
    14011402                    if (yych <= '`') { gotoCase = 142; continue; };
    14021403                    if (yych <= 'z') { gotoCase = 169; continue; };
    1403                     if (yych <= 0x7F) { gotoCase = 142; continue; };
     1404                    if (yych <= String.fromCharCode(0x7F)) { gotoCase = 142; continue; };
    14041405                    { gotoCase = 169; continue; };
    14051406                }
  • trunk/Source/WebCore/inspector/front-end/SourceJavaScriptTokenizer.re2js

    r86430 r86554  
    3131// Generate js file as follows:
    3232//
    33 // re2c -isc WebCore/inspector/front-end/SourceJavaScriptTokenizer.re2js \
     33// re2c -isc Source/WebCore/inspector/front-end/SourceJavaScriptTokenizer.re2js \
    3434// | sed 's|^yy\([^:]*\)*\:|case \1:|' \
    3535// | sed 's|[*]cursor[+][+]|this._charAt(cursor++)|' \
     
    3838// | sed 's|yych = \*\([^;]*\)|yych = this._charAt\1|' \
    3939// | sed 's|goto case \([^;]*\)|{ gotoCase = \1; continue; }|' \
     40// | sed 's|yych <= \(0x[0-9a-fA-f]*\)|yych <= String.fromCharCode(\1)|' \
    4041// | sed 's|unsigned\ int|var|' \
    4142// | sed 's|var\ yych|case 1: var yych|'
     
    165166                {
    166167                    var token = this._line.substring(cursorOnEnter, cursor);
    167                     if (token in this._keywords)
     168                    if (this._keywords[token] === true && token !== "__proto__")
    168169                        this.tokenType = "javascript-keyword";
    169170                    else
Note: See TracChangeset for help on using the changeset viewer.