Changeset 54053 in webkit


Ignore:
Timestamp:
Jan 29, 2010 3:04:09 AM (14 years ago)
Author:
pfeldman@chromium.org
Message:

2010-01-29 Pavel Feldman <pfeldman@chromium.org>

Reviewed by Timothy Hatcher.

Web Inspector: migrate to tokenizer-based highlighting in the Elements panel.

https://bugs.webkit.org/show_bug.cgi?id=34273

  • WebCore.gypi:
  • WebCore.vcproj/WebCore.vcproj:
  • inspector/front-end/CSSSourceSyntaxHighlighter.js: Removed.
  • inspector/front-end/DOMSyntaxHighlighter.js: Added. (WebInspector.DOMSyntaxHighlighter): (WebInspector.DOMSyntaxHighlighter.prototype.createSpan): (WebInspector.DOMSyntaxHighlighter.prototype.syntaxHighlightNode):
  • inspector/front-end/ElementsTreeOutline.js:
  • inspector/front-end/JavaScriptSourceSyntaxHighlighter.js: Removed.
  • inspector/front-end/SourceCSSTokenizer.js: (WebInspector.SourceCSSTokenizer): (WebInspector.SourceCSSTokenizer.prototype.nextToken):
  • inspector/front-end/SourceCSSTokenizer.re2js:
  • inspector/front-end/SourceHTMLTokenizer.js: (WebInspector.SourceHTMLTokenizer): (WebInspector.SourceHTMLTokenizer.prototype.nextToken):
  • inspector/front-end/SourceHTMLTokenizer.re2js:
  • inspector/front-end/SourceJavaScriptTokenizer.js: (WebInspector.SourceJavaScriptTokenizer): (WebInspector.SourceJavaScriptTokenizer.prototype.nextToken):
  • inspector/front-end/SourceJavaScriptTokenizer.re2js:
  • inspector/front-end/SourceSyntaxHighlighter.js: Removed.
  • inspector/front-end/SourceTokenizer.js: Added. (WebInspector.SourceTokenizer): (WebInspector.SourceTokenizer.prototype.set line): (WebInspector.SourceTokenizer.prototype.set condition): (WebInspector.SourceTokenizer.prototype.get condition): (WebInspector.SourceTokenizer.prototype.hasCondition): (WebInspector.SourceTokenizer.prototype.getLexCondition): (WebInspector.SourceTokenizer.prototype.setLexCondition): (WebInspector.SourceTokenizer.prototype._charAt): (WebInspector.SourceTokenizer.Registry): (WebInspector.SourceTokenizer.Registry.getInstance): (WebInspector.SourceTokenizer.Registry.prototype.getTokenizer):
  • inspector/front-end/TextEditorHighlighter.js: (WebInspector.TextEditorHighlighter): (WebInspector.TextEditorHighlighter.prototype.set mimeType):
  • inspector/front-end/WebKit.qrc:
  • inspector/front-end/inspector.html: LayoutTests:
  • inspector/syntax-highlight-css-expected.txt:
  • inspector/syntax-highlight-css.html:
  • inspector/syntax-highlight-javascript-expected.txt:
  • inspector/syntax-highlight-javascript.html:
  • inspector/syntax-highlight.js: (frontend_dumpSyntaxHighlight):
Location:
trunk
Files:
2 added
3 deleted
19 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r54047 r54053  
     12010-01-29  Pavel Feldman  <pfeldman@chromium.org>
     2
     3        Reviewed by Timothy Hatcher.
     4
     5        Web Inspector: migrate to tokenizer-based highlighting in the Elements panel.
     6
     7        https://bugs.webkit.org/show_bug.cgi?id=34273
     8
     9        * inspector/syntax-highlight-css-expected.txt:
     10        * inspector/syntax-highlight-css.html:
     11        * inspector/syntax-highlight-javascript-expected.txt:
     12        * inspector/syntax-highlight-javascript.html:
     13        * inspector/syntax-highlight.js:
     14        (frontend_dumpSyntaxHighlight):
     15
    1162010-01-28  Oliver Hunt  <oliver@apple.com>
    217
  • trunk/LayoutTests/inspector/syntax-highlight-css-expected.txt

    r52495 r54053  
    22
    33a[href='/']: webkit-css-selector
    4 #content > a:hover: webkit-css-selector,*,webkit-css-selector
    5 @import url(style.css);: webkit-css-at-rule,*,webkit-css-url,*
    6 @import url("style.css") projection, tv;: webkit-css-at-rule,*,webkit-css-url,*,webkit-css-keyword,*,webkit-css-keyword,*
     4#content > a:hover: *,webkit-css-selector,*,webkit-css-selector,*,webkit-css-selector
     5@import url(style.css);: webkit-css-at-rule,*,webkit-css-keyword,*
     6@import url("style.css") projection, tv;: webkit-css-at-rule,*,webkit-css-keyword,*,webkit-css-string,*,webkit-css-keyword,*,webkit-css-keyword,*
    77@media screen { body { color: red; } }: webkit-css-at-rule,*,webkit-css-keyword,*,webkit-css-selector,*,webkit-css-property,*,webkit-css-keyword,*
    88@font-face { font-family: MyHelvetica; }: webkit-css-at-rule,*,webkit-css-property,*
  • trunk/LayoutTests/inspector/syntax-highlight-css.html

    r50664 r54053  
    99function frontend_dumpSyntaxHighlightCSS(str)
    1010{
    11     return frontend_dumpSyntaxHighlight(str, WebInspector.CSSSourceSyntaxHighlighter);
     11    return frontend_dumpSyntaxHighlight(str, "text/css");
    1212}
    1313
  • trunk/LayoutTests/inspector/syntax-highlight-javascript-expected.txt

    r52495 r54053  
    88var foo = 1/*/***//2: webkit-javascript-keyword,*,webkit-javascript-ident,*,webkit-javascript-number,webkit-javascript-comment,*,webkit-javascript-number
    99/*comment*//.*/.test('a'): webkit-javascript-comment,webkit-javascript-regexp,*,webkit-javascript-ident,*,webkit-javascript-string,*
    10 'f\ oo';: webkit-javascript-string,*
     10'f\ oo';: webkit-javascript-string,,webkit-javascript-string,*
    1111'\f\b\t';: webkit-javascript-string,*
    12 '/\ /';: webkit-javascript-string,*
    13 foo/** / */foo: webkit-javascript-ident,webkit-javascript-comment,webkit-javascript-ident
     12'/\ /';: webkit-javascript-string,,webkit-javascript-string,*
     13foo/** / */foo: webkit-javascript-ident,webkit-javascript-comment,,webkit-javascript-comment,,webkit-javascript-comment,webkit-javascript-ident
    1414
  • trunk/LayoutTests/inspector/syntax-highlight-javascript.html

    r50582 r54053  
    99function frontend_dumpSyntaxHighlightJS(str)
    1010{
    11     return frontend_dumpSyntaxHighlight(str, WebInspector.JavaScriptSourceSyntaxHighlighter);
     11    return frontend_dumpSyntaxHighlight(str, "text/javascript");
    1212}
    1313
  • trunk/LayoutTests/inspector/syntax-highlight.js

    r52495 r54053  
    1414// Frontend functions.
    1515
    16 function frontend_dumpSyntaxHighlight(str, highlighterConstructor)
     16function frontend_dumpSyntaxHighlight(str, mimeType)
    1717{
    1818    var node = document.createElement("span");
    1919    node.textContent = str;
    20     var javascriptSyntaxHighlighter = new highlighterConstructor(null, null);
     20    var javascriptSyntaxHighlighter = new WebInspector.DOMSyntaxHighlighter(mimeType);
    2121    javascriptSyntaxHighlighter.syntaxHighlightNode(node);
    2222    var node_parts = [];
  • trunk/WebCore/ChangeLog

    r54052 r54053  
     12010-01-29  Pavel Feldman  <pfeldman@chromium.org>
     2
     3        Reviewed by Timothy Hatcher.
     4
     5        Web Inspector: migrate to tokenizer-based highlighting in the Elements panel.
     6
     7        https://bugs.webkit.org/show_bug.cgi?id=34273
     8
     9        * WebCore.gypi:
     10        * WebCore.vcproj/WebCore.vcproj:
     11        * inspector/front-end/CSSSourceSyntaxHighlighter.js: Removed.
     12        * inspector/front-end/DOMSyntaxHighlighter.js: Added.
     13        (WebInspector.DOMSyntaxHighlighter):
     14        (WebInspector.DOMSyntaxHighlighter.prototype.createSpan):
     15        (WebInspector.DOMSyntaxHighlighter.prototype.syntaxHighlightNode):
     16        * inspector/front-end/ElementsTreeOutline.js:
     17        * inspector/front-end/JavaScriptSourceSyntaxHighlighter.js: Removed.
     18        * inspector/front-end/SourceCSSTokenizer.js:
     19        (WebInspector.SourceCSSTokenizer):
     20        (WebInspector.SourceCSSTokenizer.prototype.nextToken):
     21        * inspector/front-end/SourceCSSTokenizer.re2js:
     22        * inspector/front-end/SourceHTMLTokenizer.js:
     23        (WebInspector.SourceHTMLTokenizer):
     24        (WebInspector.SourceHTMLTokenizer.prototype.nextToken):
     25        * inspector/front-end/SourceHTMLTokenizer.re2js:
     26        * inspector/front-end/SourceJavaScriptTokenizer.js:
     27        (WebInspector.SourceJavaScriptTokenizer):
     28        (WebInspector.SourceJavaScriptTokenizer.prototype.nextToken):
     29        * inspector/front-end/SourceJavaScriptTokenizer.re2js:
     30        * inspector/front-end/SourceSyntaxHighlighter.js: Removed.
     31        * inspector/front-end/SourceTokenizer.js: Added.
     32        (WebInspector.SourceTokenizer):
     33        (WebInspector.SourceTokenizer.prototype.set line):
     34        (WebInspector.SourceTokenizer.prototype.set condition):
     35        (WebInspector.SourceTokenizer.prototype.get condition):
     36        (WebInspector.SourceTokenizer.prototype.hasCondition):
     37        (WebInspector.SourceTokenizer.prototype.getLexCondition):
     38        (WebInspector.SourceTokenizer.prototype.setLexCondition):
     39        (WebInspector.SourceTokenizer.prototype._charAt):
     40        (WebInspector.SourceTokenizer.Registry):
     41        (WebInspector.SourceTokenizer.Registry.getInstance):
     42        (WebInspector.SourceTokenizer.Registry.prototype.getTokenizer):
     43        * inspector/front-end/TextEditorHighlighter.js:
     44        (WebInspector.TextEditorHighlighter):
     45        (WebInspector.TextEditorHighlighter.prototype.set mimeType):
     46        * inspector/front-end/WebKit.qrc:
     47        * inspector/front-end/inspector.html:
     48
    1492010-01-29  Pavel Feldman  <pfeldman@chromium.org>
    250
  • trunk/WebCore/WebCore.gypi

    r54042 r54053  
    36843684            'inspector/front-end/ContextMenu.js',
    36853685            'inspector/front-end/CookieItemsView.js',
    3686             'inspector/front-end/CSSSourceSyntaxHighlighter.js',
    36873686            'inspector/front-end/Database.js',
    36883687            'inspector/front-end/DatabaseQueryView.js',
     
    36923691            'inspector/front-end/DOMStorage.js',
    36933692            'inspector/front-end/DOMStorageItemsView.js',
     3693            'inspector/front-end/DOMSyntaxHighlighter.js',
    36943694            'inspector/front-end/Drawer.js',
    36953695            'inspector/front-end/ElementsPanel.js',
     
    37033703            'inspector/front-end/InjectedScriptAccess.js',
    37043704            'inspector/front-end/inspector.js',
    3705             'inspector/front-end/JavaScriptSourceSyntaxHighlighter.js',
    37063705            'inspector/front-end/KeyboardShortcut.js',
    37073706            'inspector/front-end/MetricsSidebarPane.js',
     
    37343733            'inspector/front-end/SourceHTMLTokenizer.js',
    37353734            'inspector/front-end/SourceJavaScriptTokenizer.js',
    3736             'inspector/front-end/SourceSyntaxHighlighter.js',
     3735            'inspector/front-end/SourceTokenizer.js',
    37373736            'inspector/front-end/SourceView.js',
    37383737            'inspector/front-end/StatusBarButton.js',
  • trunk/WebCore/WebCore.vcproj/WebCore.vcproj

    r54009 r54053  
    4273342733                                </File>
    4273442734                                <File
    42735                                         RelativePath="..\inspector\front-end\CSSSourceSyntaxHighlighter.js"
    42736                                         >
    42737                                 </File>
    42738                                 <File
    4273942735                                        RelativePath="..\inspector\front-end\Database.js"
    4274042736                                        >
     
    4276542761                                </File>
    4276642762                                <File
     42763                                        RelativePath="..\inspector\front-end\DOMSyntaxHighlighter.js"
     42764                                        >
     42765                                </File>
     42766                                <File
    4276742767                                        RelativePath="..\inspector\front-end\Drawer.js"
    4276842768                                        >
     
    4281342813                                </File>
    4281442814                                <File
    42815                                         RelativePath="..\inspector\front-end\JavaScriptSourceSyntaxHighlighter.js"
    42816                                         >
    42817                                 </File>
    42818                                 <File
    4281942815                                        RelativePath="..\inspector\front-end\MetricsSidebarPane.js"
    4282042816                                        >
     
    4293342929                                </File>
    4293442930                                <File
    42935                                         RelativePath="..\inspector\front-end\SourceSyntaxHighlighter.js"
     42931                                        RelativePath="..\inspector\front-end\SourceTokenizer.js"
    4293642932                                        >
    4293742933                                </File>
  • trunk/WebCore/inspector/front-end/ElementsTreeOutline.js

    r53766 r54053  
    980980                        newNode.textContent = node.textContent;
    981981
    982                         var javascriptSyntaxHighlighter = new WebInspector.JavaScriptSourceSyntaxHighlighter(null, null);
     982                        var javascriptSyntaxHighlighter = new WebInspector.DOMSyntaxHighlighter("text/javascript");
    983983                        javascriptSyntaxHighlighter.syntaxHighlightNode(newNode);
    984984                       
     
    988988                        newNode.textContent = node.textContent;
    989989                       
    990                         var cssSyntaxHighlighter = new WebInspector.CSSSourceSyntaxHighlighter(null, null);
     990                        var cssSyntaxHighlighter = new WebInspector.DOMSyntaxHighlighter("text/css");
    991991                        cssSyntaxHighlighter.syntaxHighlightNode(newNode);
    992992                       
  • trunk/WebCore/inspector/front-end/SourceCSSTokenizer.js

    r53846 r54053  
    1 /* Generated by re2c 0.13.5 on Tue Jan 26 01:16:33 2010 */
     1/* Generated by re2c 0.13.5 on Thu Jan 28 20:49:22 2010 */
    22/*
    33 * Copyright (C) 2009 Google Inc. All rights reserved.
     
    4444WebInspector.SourceCSSTokenizer = function()
    4545{
    46     WebInspector.TextEditorHighlighter.Tokenizer.call(this);
     46    WebInspector.SourceTokenizer.call(this);
    4747
    4848    this._propertyKeywords = [
     
    374374case this.case_INITIAL:
    375375            yych = this._charAt(cursor);
    376             if (yych <= '9') {
    377                 if (yych <= '&') {
     376            if (yych <= ';') {
     377                if (yych <= '\'') {
    378378                    if (yych <= '"') {
    379379                        if (yych <= ' ') { gotoCase = 29; continue; };
     
    382382                    } else {
    383383                        if (yych == '$') { gotoCase = 31; continue; };
    384                     }
    385                 } else {
    386                     if (yych <= '-') {
    387                         if (yych <= '\'') { gotoCase = 34; continue; };
    388                         if (yych >= '-') { gotoCase = 35; continue; };
    389                     } else {
    390                         if (yych <= '.') { gotoCase = 36; continue; };
     384                        if (yych >= '\'') { gotoCase = 34; continue; };
     385                    }
     386                } else {
     387                    if (yych <= '.') {
     388                        if (yych <= ',') { gotoCase = 29; continue; };
     389                        if (yych <= '-') { gotoCase = 35; continue; };
     390                        { gotoCase = 36; continue; };
     391                    } else {
    391392                        if (yych <= '/') { gotoCase = 37; continue; };
    392                         { gotoCase = 38; continue; };
    393                     }
    394                 }
    395             } else {
    396                 if (yych <= '_') {
     393                        if (yych <= '9') { gotoCase = 38; continue; };
     394                        if (yych <= ':') { gotoCase = 40; continue; };
     395                        { gotoCase = 42; continue; };
     396                    }
     397                }
     398            } else {
     399                if (yych <= '^') {
    397400                    if (yych <= '?') {
    398                         if (yych <= ':') { gotoCase = 40; continue; };
    399                         if (yych <= ';') { gotoCase = 42; continue; };
    400                     } else {
    401                         if (yych <= 'Z') { gotoCase = 31; continue; };
    402                         if (yych >= '_') { gotoCase = 31; continue; };
    403                     }
    404                 } else {
    405                     if (yych <= '{') {
    406                         if (yych <= '`') { gotoCase = 29; continue; };
    407                         if (yych <= 'z') { gotoCase = 31; continue; };
    408                         { gotoCase = 44; continue; };
    409                     } else {
     401                        if (yych == '=') { gotoCase = 31; continue; };
     402                    } else {
     403                        if (yych == '\\') { gotoCase = 29; continue; };
     404                        if (yych <= ']') { gotoCase = 31; continue; };
     405                    }
     406                } else {
     407                    if (yych <= 'z') {
     408                        if (yych != '`') { gotoCase = 31; continue; };
     409                    } else {
     410                        if (yych <= '{') { gotoCase = 44; continue; };
    410411                        if (yych == '}') { gotoCase = 46; continue; };
    411412                    }
     
    427428                            this.tokenType = "css-at-rule";
    428429                            this._parseCondition = this._parseConditions.AT_RULE;
    429                         } else
     430                        } else if (token.indexOf("@") === 0)
     431                            this.tokenType = "css-at-rule";
     432                        else
    430433                            this.tokenType = "css-selector";
    431434                    }
     
    445448            yyaccept = 0;
    446449            yych = this._charAt(YYMARKER = ++cursor);
    447             if (yych == '\n') { gotoCase = 30; continue; };
    448             if (yych == '\r') { gotoCase = 30; continue; };
    449             { gotoCase = 120; continue; };
     450            if (yych <= '-') {
     451                if (yych <= '!') {
     452                    if (yych <= '\f') {
     453                        if (yych == '\n') { gotoCase = 32; continue; };
     454                        { gotoCase = 124; continue; };
     455                    } else {
     456                        if (yych <= '\r') { gotoCase = 32; continue; };
     457                        if (yych <= ' ') { gotoCase = 124; continue; };
     458                        { gotoCase = 122; continue; };
     459                    }
     460                } else {
     461                    if (yych <= '$') {
     462                        if (yych <= '"') { gotoCase = 114; continue; };
     463                        if (yych <= '#') { gotoCase = 124; continue; };
     464                        { gotoCase = 122; continue; };
     465                    } else {
     466                        if (yych == '\'') { gotoCase = 122; continue; };
     467                        if (yych <= ',') { gotoCase = 124; continue; };
     468                        { gotoCase = 122; continue; };
     469                    }
     470                }
     471            } else {
     472                if (yych <= '[') {
     473                    if (yych <= '<') {
     474                        if (yych <= '.') { gotoCase = 124; continue; };
     475                        if (yych <= '9') { gotoCase = 122; continue; };
     476                        { gotoCase = 124; continue; };
     477                    } else {
     478                        if (yych <= '=') { gotoCase = 122; continue; };
     479                        if (yych <= '?') { gotoCase = 124; continue; };
     480                        { gotoCase = 122; continue; };
     481                    }
     482                } else {
     483                    if (yych <= '^') {
     484                        if (yych <= '\\') { gotoCase = 126; continue; };
     485                        if (yych <= ']') { gotoCase = 122; continue; };
     486                        { gotoCase = 124; continue; };
     487                    } else {
     488                        if (yych == '`') { gotoCase = 124; continue; };
     489                        if (yych <= 'z') { gotoCase = 122; continue; };
     490                        { gotoCase = 124; continue; };
     491                    }
     492                }
     493            }
    450494case 34:
    451495            yyaccept = 0;
    452496            yych = this._charAt(YYMARKER = ++cursor);
    453             if (yych == '\n') { gotoCase = 30; continue; };
    454             if (yych == '\r') { gotoCase = 30; continue; };
    455             { gotoCase = 113; continue; };
     497            if (yych <= '-') {
     498                if (yych <= '"') {
     499                    if (yych <= '\f') {
     500                        if (yych == '\n') { gotoCase = 32; continue; };
     501                        { gotoCase = 116; continue; };
     502                    } else {
     503                        if (yych <= '\r') { gotoCase = 32; continue; };
     504                        if (yych <= ' ') { gotoCase = 116; continue; };
     505                        { gotoCase = 112; continue; };
     506                    }
     507                } else {
     508                    if (yych <= '&') {
     509                        if (yych == '$') { gotoCase = 112; continue; };
     510                        { gotoCase = 116; continue; };
     511                    } else {
     512                        if (yych <= '\'') { gotoCase = 114; continue; };
     513                        if (yych <= ',') { gotoCase = 116; continue; };
     514                        { gotoCase = 112; continue; };
     515                    }
     516                }
     517            } else {
     518                if (yych <= '[') {
     519                    if (yych <= '<') {
     520                        if (yych <= '.') { gotoCase = 116; continue; };
     521                        if (yych <= '9') { gotoCase = 112; continue; };
     522                        { gotoCase = 116; continue; };
     523                    } else {
     524                        if (yych <= '=') { gotoCase = 112; continue; };
     525                        if (yych <= '?') { gotoCase = 116; continue; };
     526                        { gotoCase = 112; continue; };
     527                    }
     528                } else {
     529                    if (yych <= '^') {
     530                        if (yych <= '\\') { gotoCase = 118; continue; };
     531                        if (yych <= ']') { gotoCase = 112; continue; };
     532                        { gotoCase = 116; continue; };
     533                    } else {
     534                        if (yych == '`') { gotoCase = 116; continue; };
     535                        if (yych <= 'z') { gotoCase = 112; continue; };
     536                        { gotoCase = 116; continue; };
     537                    }
     538                }
     539            }
    456540case 35:
    457             yyaccept = 1;
     541            yyaccept = 0;
    458542            yych = this._charAt(YYMARKER = ++cursor);
    459543            if (yych == '.') { gotoCase = 65; continue; };
     
    470554            yych = this._charAt(YYMARKER = ++cursor);
    471555            if (yych == '*') { gotoCase = 104; continue; };
    472             { gotoCase = 30; continue; };
     556            { gotoCase = 49; continue; };
    473557case 38:
    474             yyaccept = 2;
     558            yyaccept = 1;
    475559            yych = this._charAt(YYMARKER = ++cursor);
    476560            switch (yych) {
    477561            case '!':
     562            case '"':
    478563            case '$':
     564            case '\'':
    479565            case '-':
     566            case '/':
     567            case '=':
    480568            case '@':
    481569            case 'A':
     
    504592            case 'Y':
    505593            case 'Z':
     594            case '[':
     595            case ']':
    506596            case 'a':
    507597            case 'b':
     
    593683            yych = this._charAt(cursor);
    594684case 49:
    595             if (yych <= '/') {
    596                 if (yych <= '#') {
    597                     if (yych == '!') { gotoCase = 48; continue; };
    598                     { gotoCase = 32; continue; };
    599                 } else {
    600                     if (yych <= '$') { gotoCase = 48; continue; };
    601                     if (yych == '-') { gotoCase = 48; continue; };
    602                     { gotoCase = 32; continue; };
    603                 }
    604             } else {
    605                 if (yych <= '^') {
    606                     if (yych <= '9') { gotoCase = 48; continue; };
    607                     if (yych <= '?') { gotoCase = 32; continue; };
    608                     if (yych <= 'Z') { gotoCase = 48; continue; };
    609                     { gotoCase = 32; continue; };
    610                 } else {
    611                     if (yych == '`') { gotoCase = 32; continue; };
    612                     if (yych <= 'z') { gotoCase = 48; continue; };
    613                     { gotoCase = 32; continue; };
     685            if (yych <= '9') {
     686                if (yych <= '&') {
     687                    if (yych <= '"') {
     688                        if (yych <= ' ') { gotoCase = 32; continue; };
     689                        { gotoCase = 48; continue; };
     690                    } else {
     691                        if (yych == '$') { gotoCase = 48; continue; };
     692                        { gotoCase = 32; continue; };
     693                    }
     694                } else {
     695                    if (yych <= ',') {
     696                        if (yych <= '\'') { gotoCase = 48; continue; };
     697                        { gotoCase = 32; continue; };
     698                    } else {
     699                        if (yych == '.') { gotoCase = 32; continue; };
     700                        { gotoCase = 48; continue; };
     701                    }
     702                }
     703            } else {
     704                if (yych <= '\\') {
     705                    if (yych <= '=') {
     706                        if (yych <= '<') { gotoCase = 32; continue; };
     707                        { gotoCase = 48; continue; };
     708                    } else {
     709                        if (yych <= '?') { gotoCase = 32; continue; };
     710                        if (yych <= '[') { gotoCase = 48; continue; };
     711                        { gotoCase = 32; continue; };
     712                    }
     713                } else {
     714                    if (yych <= '_') {
     715                        if (yych == '^') { gotoCase = 32; continue; };
     716                        { gotoCase = 48; continue; };
     717                    } else {
     718                        if (yych <= '`') { gotoCase = 32; continue; };
     719                        if (yych <= 'z') { gotoCase = 48; continue; };
     720                        { gotoCase = 32; continue; };
     721                    }
    614722                }
    615723            }
    616724case 50:
    617             yyaccept = 2;
     725            yyaccept = 1;
    618726            YYMARKER = ++cursor;
    619727            yych = this._charAt(cursor);
    620728            switch (yych) {
    621729            case '!':
     730            case '"':
    622731            case '$':
     732            case '\'':
    623733            case '-':
     734            case '/':
     735            case '=':
    624736            case '@':
    625737            case 'A':
     
    648760            case 'Y':
    649761            case 'Z':
     762            case '[':
     763            case ']':
    650764            case 'a':
    651765            case 'b':
     
    745859case 63:
    746860            yych = this._charAt(++cursor);
    747             if (yych <= '/') {
    748                 if (yych <= '#') {
    749                     if (yych == '!') { gotoCase = 48; continue; };
    750                     { gotoCase = 39; continue; };
    751                 } else {
    752                     if (yych <= '$') { gotoCase = 48; continue; };
    753                     if (yych == '-') { gotoCase = 48; continue; };
    754                     { gotoCase = 39; continue; };
    755                 }
    756             } else {
    757                 if (yych <= '^') {
    758                     if (yych <= '9') { gotoCase = 48; continue; };
    759                     if (yych <= '?') { gotoCase = 39; continue; };
    760                     if (yych <= 'Z') { gotoCase = 48; continue; };
    761                     { gotoCase = 39; continue; };
    762                 } else {
    763                     if (yych == '`') { gotoCase = 39; continue; };
    764                     if (yych <= 'z') { gotoCase = 48; continue; };
    765                     { gotoCase = 39; continue; };
     861            if (yych <= '9') {
     862                if (yych <= '&') {
     863                    if (yych <= '"') {
     864                        if (yych <= ' ') { gotoCase = 39; continue; };
     865                        { gotoCase = 48; continue; };
     866                    } else {
     867                        if (yych == '$') { gotoCase = 48; continue; };
     868                        { gotoCase = 39; continue; };
     869                    }
     870                } else {
     871                    if (yych <= ',') {
     872                        if (yych <= '\'') { gotoCase = 48; continue; };
     873                        { gotoCase = 39; continue; };
     874                    } else {
     875                        if (yych == '.') { gotoCase = 39; continue; };
     876                        { gotoCase = 48; continue; };
     877                    }
     878                }
     879            } else {
     880                if (yych <= '\\') {
     881                    if (yych <= '=') {
     882                        if (yych <= '<') { gotoCase = 39; continue; };
     883                        { gotoCase = 48; continue; };
     884                    } else {
     885                        if (yych <= '?') { gotoCase = 39; continue; };
     886                        if (yych <= '[') { gotoCase = 48; continue; };
     887                        { gotoCase = 39; continue; };
     888                    }
     889                } else {
     890                    if (yych <= '_') {
     891                        if (yych == '^') { gotoCase = 39; continue; };
     892                        { gotoCase = 48; continue; };
     893                    } else {
     894                        if (yych <= '`') { gotoCase = 39; continue; };
     895                        if (yych <= 'z') { gotoCase = 48; continue; };
     896                        { gotoCase = 39; continue; };
     897                    }
    766898                }
    767899            }
     
    776908case 66:
    777909            cursor = YYMARKER;
    778             if (yyaccept <= 1) {
    779                 if (yyaccept <= 0) {
    780                     { gotoCase = 30; continue; };
    781                 } else {
    782                     { gotoCase = 32; continue; };
    783                 }
     910            if (yyaccept <= 0) {
     911                { gotoCase = 32; continue; };
    784912            } else {
    785913                { gotoCase = 39; continue; };
     
    789917            { gotoCase = 39; continue; };
    790918case 68:
    791             yyaccept = 2;
     919            yyaccept = 1;
    792920            YYMARKER = ++cursor;
    793921            yych = this._charAt(cursor);
     
    9851113            { this.tokenType = "css-comment"; return cursor; }
    9861114case 112:
    987             ++cursor;
    988             yych = this._charAt(cursor);
    989 case 113:
     1115            yyaccept = 0;
     1116            YYMARKER = ++cursor;
     1117            yych = this._charAt(cursor);
     1118            if (yych <= '-') {
     1119                if (yych <= '"') {
     1120                    if (yych <= '\f') {
     1121                        if (yych == '\n') { gotoCase = 32; continue; };
     1122                        { gotoCase = 116; continue; };
     1123                    } else {
     1124                        if (yych <= '\r') { gotoCase = 32; continue; };
     1125                        if (yych <= ' ') { gotoCase = 116; continue; };
     1126                        { gotoCase = 112; continue; };
     1127                    }
     1128                } else {
     1129                    if (yych <= '&') {
     1130                        if (yych == '$') { gotoCase = 112; continue; };
     1131                        { gotoCase = 116; continue; };
     1132                    } else {
     1133                        if (yych <= '\'') { gotoCase = 114; continue; };
     1134                        if (yych <= ',') { gotoCase = 116; continue; };
     1135                        { gotoCase = 112; continue; };
     1136                    }
     1137                }
     1138            } else {
     1139                if (yych <= '[') {
     1140                    if (yych <= '<') {
     1141                        if (yych <= '.') { gotoCase = 116; continue; };
     1142                        if (yych <= '9') { gotoCase = 112; continue; };
     1143                        { gotoCase = 116; continue; };
     1144                    } else {
     1145                        if (yych <= '=') { gotoCase = 112; continue; };
     1146                        if (yych <= '?') { gotoCase = 116; continue; };
     1147                        { gotoCase = 112; continue; };
     1148                    }
     1149                } else {
     1150                    if (yych <= '^') {
     1151                        if (yych <= '\\') { gotoCase = 118; continue; };
     1152                        if (yych <= ']') { gotoCase = 112; continue; };
     1153                        { gotoCase = 116; continue; };
     1154                    } else {
     1155                        if (yych == '`') { gotoCase = 116; continue; };
     1156                        if (yych <= 'z') { gotoCase = 112; continue; };
     1157                        { gotoCase = 116; continue; };
     1158                    }
     1159                }
     1160            }
     1161case 114:
     1162            ++cursor;
     1163            if ((yych = this._charAt(cursor)) <= '9') {
     1164                if (yych <= '&') {
     1165                    if (yych <= '"') {
     1166                        if (yych >= '!') { gotoCase = 48; continue; };
     1167                    } else {
     1168                        if (yych == '$') { gotoCase = 48; continue; };
     1169                    }
     1170                } else {
     1171                    if (yych <= ',') {
     1172                        if (yych <= '\'') { gotoCase = 48; continue; };
     1173                    } else {
     1174                        if (yych != '.') { gotoCase = 48; continue; };
     1175                    }
     1176                }
     1177            } else {
     1178                if (yych <= '\\') {
     1179                    if (yych <= '=') {
     1180                        if (yych >= '=') { gotoCase = 48; continue; };
     1181                    } else {
     1182                        if (yych <= '?') { gotoCase = 115; continue; };
     1183                        if (yych <= '[') { gotoCase = 48; continue; };
     1184                    }
     1185                } else {
     1186                    if (yych <= '_') {
     1187                        if (yych != '^') { gotoCase = 48; continue; };
     1188                    } else {
     1189                        if (yych <= '`') { gotoCase = 115; continue; };
     1190                        if (yych <= 'z') { gotoCase = 48; continue; };
     1191                    }
     1192                }
     1193            }
     1194case 115:
     1195            { return this._stringToken(cursor, true); }
     1196case 116:
     1197            ++cursor;
     1198            yych = this._charAt(cursor);
    9901199            if (yych <= '\r') {
    9911200                if (yych == '\n') { gotoCase = 66; continue; };
    992                 if (yych <= '\f') { gotoCase = 112; continue; };
     1201                if (yych <= '\f') { gotoCase = 116; continue; };
    9931202                { gotoCase = 66; continue; };
    9941203            } else {
    9951204                if (yych <= '\'') {
    996                     if (yych <= '&') { gotoCase = 112; continue; };
    997                     { gotoCase = 115; continue; };
    998                 } else {
    999                     if (yych != '\\') { gotoCase = 112; continue; };
    1000                 }
    1001             }
     1205                    if (yych <= '&') { gotoCase = 116; continue; };
     1206                    { gotoCase = 121; continue; };
     1207                } else {
     1208                    if (yych != '\\') { gotoCase = 116; continue; };
     1209                }
     1210            }
     1211case 118:
    10021212            ++cursor;
    10031213            yych = this._charAt(cursor);
     
    10061216                    if (yych <= '\n') {
    10071217                        if (yych <= '\t') { gotoCase = 66; continue; };
    1008                         { gotoCase = 117; continue; };
    1009                     } else {
    1010                         if (yych == '\r') { gotoCase = 117; continue; };
    1011                         { gotoCase = 66; continue; };
     1218                    } else {
     1219                        if (yych != '\r') { gotoCase = 66; continue; };
    10121220                    }
    10131221                } else {
    10141222                    if (yych <= '\'') {
    1015                         if (yych <= '"') { gotoCase = 112; continue; };
     1223                        if (yych <= '"') { gotoCase = 116; continue; };
    10161224                        if (yych <= '&') { gotoCase = 66; continue; };
    1017                         { gotoCase = 112; continue; };
    1018                     } else {
    1019                         if (yych == '\\') { gotoCase = 112; continue; };
     1225                        { gotoCase = 116; continue; };
     1226                    } else {
     1227                        if (yych == '\\') { gotoCase = 116; continue; };
    10201228                        { gotoCase = 66; continue; };
    10211229                    }
     
    10241232                if (yych <= 'q') {
    10251233                    if (yych <= 'f') {
    1026                         if (yych <= 'b') { gotoCase = 112; continue; };
     1234                        if (yych <= 'b') { gotoCase = 116; continue; };
    10271235                        if (yych <= 'e') { gotoCase = 66; continue; };
    1028                         { gotoCase = 112; continue; };
    1029                     } else {
    1030                         if (yych == 'n') { gotoCase = 112; continue; };
     1236                        { gotoCase = 116; continue; };
     1237                    } else {
     1238                        if (yych == 'n') { gotoCase = 116; continue; };
    10311239                        { gotoCase = 66; continue; };
    10321240                    }
     
    10341242                    if (yych <= 't') {
    10351243                        if (yych == 's') { gotoCase = 66; continue; };
    1036                         { gotoCase = 112; continue; };
    1037                     } else {
    1038                         if (yych == 'v') { gotoCase = 112; continue; };
     1244                        { gotoCase = 116; continue; };
     1245                    } else {
     1246                        if (yych == 'v') { gotoCase = 116; continue; };
    10391247                        { gotoCase = 66; continue; };
    10401248                    }
    10411249                }
    10421250            }
    1043 case 115:
    1044             ++cursor;
    1045             { return this._stringToken(cursor, true); }
    1046 case 117:
    10471251            ++cursor;
    10481252            this.setLexCondition(this._lexConditions.SSTRING);
    10491253            { return this._stringToken(cursor); }
    1050 case 119:
    1051             ++cursor;
    1052             yych = this._charAt(cursor);
    1053 case 120:
     1254case 121:
     1255            yych = this._charAt(++cursor);
     1256            { gotoCase = 115; continue; };
     1257case 122:
     1258            yyaccept = 0;
     1259            YYMARKER = ++cursor;
     1260            yych = this._charAt(cursor);
     1261            if (yych <= '-') {
     1262                if (yych <= '!') {
     1263                    if (yych <= '\f') {
     1264                        if (yych == '\n') { gotoCase = 32; continue; };
     1265                    } else {
     1266                        if (yych <= '\r') { gotoCase = 32; continue; };
     1267                        if (yych >= '!') { gotoCase = 122; continue; };
     1268                    }
     1269                } else {
     1270                    if (yych <= '$') {
     1271                        if (yych <= '"') { gotoCase = 114; continue; };
     1272                        if (yych >= '$') { gotoCase = 122; continue; };
     1273                    } else {
     1274                        if (yych == '\'') { gotoCase = 122; continue; };
     1275                        if (yych >= '-') { gotoCase = 122; continue; };
     1276                    }
     1277                }
     1278            } else {
     1279                if (yych <= '[') {
     1280                    if (yych <= '<') {
     1281                        if (yych <= '.') { gotoCase = 124; continue; };
     1282                        if (yych <= '9') { gotoCase = 122; continue; };
     1283                    } else {
     1284                        if (yych <= '=') { gotoCase = 122; continue; };
     1285                        if (yych >= '@') { gotoCase = 122; continue; };
     1286                    }
     1287                } else {
     1288                    if (yych <= '^') {
     1289                        if (yych <= '\\') { gotoCase = 126; continue; };
     1290                        if (yych <= ']') { gotoCase = 122; continue; };
     1291                    } else {
     1292                        if (yych == '`') { gotoCase = 124; continue; };
     1293                        if (yych <= 'z') { gotoCase = 122; continue; };
     1294                    }
     1295                }
     1296            }
     1297case 124:
     1298            ++cursor;
     1299            yych = this._charAt(cursor);
    10541300            if (yych <= '\r') {
    10551301                if (yych == '\n') { gotoCase = 66; continue; };
    1056                 if (yych <= '\f') { gotoCase = 119; continue; };
     1302                if (yych <= '\f') { gotoCase = 124; continue; };
    10571303                { gotoCase = 66; continue; };
    10581304            } else {
    10591305                if (yych <= '"') {
    1060                     if (yych <= '!') { gotoCase = 119; continue; };
    1061                     { gotoCase = 115; continue; };
    1062                 } else {
    1063                     if (yych != '\\') { gotoCase = 119; continue; };
    1064                 }
    1065             }
     1306                    if (yych <= '!') { gotoCase = 124; continue; };
     1307                    { gotoCase = 121; continue; };
     1308                } else {
     1309                    if (yych != '\\') { gotoCase = 124; continue; };
     1310                }
     1311            }
     1312case 126:
    10661313            ++cursor;
    10671314            yych = this._charAt(cursor);
     
    10751322                } else {
    10761323                    if (yych <= '\'') {
    1077                         if (yych <= '"') { gotoCase = 119; continue; };
     1324                        if (yych <= '"') { gotoCase = 124; continue; };
    10781325                        if (yych <= '&') { gotoCase = 66; continue; };
    1079                         { gotoCase = 119; continue; };
    1080                     } else {
    1081                         if (yych == '\\') { gotoCase = 119; continue; };
     1326                        { gotoCase = 124; continue; };
     1327                    } else {
     1328                        if (yych == '\\') { gotoCase = 124; continue; };
    10821329                        { gotoCase = 66; continue; };
    10831330                    }
     
    10861333                if (yych <= 'q') {
    10871334                    if (yych <= 'f') {
    1088                         if (yych <= 'b') { gotoCase = 119; continue; };
     1335                        if (yych <= 'b') { gotoCase = 124; continue; };
    10891336                        if (yych <= 'e') { gotoCase = 66; continue; };
    1090                         { gotoCase = 119; continue; };
    1091                     } else {
    1092                         if (yych == 'n') { gotoCase = 119; continue; };
     1337                        { gotoCase = 124; continue; };
     1338                    } else {
     1339                        if (yych == 'n') { gotoCase = 124; continue; };
    10931340                        { gotoCase = 66; continue; };
    10941341                    }
     
    10961343                    if (yych <= 't') {
    10971344                        if (yych == 's') { gotoCase = 66; continue; };
    1098                         { gotoCase = 119; continue; };
    1099                     } else {
    1100                         if (yych == 'v') { gotoCase = 119; continue; };
     1345                        { gotoCase = 124; continue; };
     1346                    } else {
     1347                        if (yych == 'v') { gotoCase = 124; continue; };
    11011348                        { gotoCase = 66; continue; };
    11021349                    }
     
    11101357            yych = this._charAt(cursor);
    11111358            if (yych <= '\r') {
    1112                 if (yych == '\n') { gotoCase = 128; continue; };
    1113                 if (yych <= '\f') { gotoCase = 127; continue; };
    1114                 { gotoCase = 128; continue; };
     1359                if (yych == '\n') { gotoCase = 133; continue; };
     1360                if (yych <= '\f') { gotoCase = 132; continue; };
     1361                { gotoCase = 133; continue; };
    11151362            } else {
    11161363                if (yych <= '\'') {
    1117                     if (yych <= '&') { gotoCase = 127; continue; };
    1118                     { gotoCase = 130; continue; };
    1119                 } else {
    1120                     if (yych == '\\') { gotoCase = 132; continue; };
    1121                     { gotoCase = 127; continue; };
    1122                 }
    1123             }
    1124 case 126:
     1364                    if (yych <= '&') { gotoCase = 132; continue; };
     1365                    { gotoCase = 135; continue; };
     1366                } else {
     1367                    if (yych == '\\') { gotoCase = 137; continue; };
     1368                    { gotoCase = 132; continue; };
     1369                }
     1370            }
     1371case 131:
    11251372            { return this._stringToken(cursor); }
    1126 case 127:
     1373case 132:
    11271374            yyaccept = 0;
    11281375            yych = this._charAt(YYMARKER = ++cursor);
    1129             { gotoCase = 134; continue; };
    1130 case 128:
    1131             ++cursor;
    1132 case 129:
     1376            { gotoCase = 139; continue; };
     1377case 133:
     1378            ++cursor;
     1379case 134:
    11331380            { this.tokenType = null; return cursor; }
    1134 case 130:
    1135             ++cursor;
    1136 case 131:
     1381case 135:
     1382            ++cursor;
     1383case 136:
    11371384            this.setLexCondition(this._lexConditions.INITIAL);
    11381385            { return this._stringToken(cursor, true); }
    1139 case 132:
     1386case 137:
    11401387            yych = this._charAt(++cursor);
    11411388            if (yych <= 'e') {
    11421389                if (yych <= '\'') {
    1143                     if (yych == '"') { gotoCase = 133; continue; };
    1144                     if (yych <= '&') { gotoCase = 129; continue; };
     1390                    if (yych == '"') { gotoCase = 138; continue; };
     1391                    if (yych <= '&') { gotoCase = 134; continue; };
    11451392                } else {
    11461393                    if (yych <= '\\') {
    1147                         if (yych <= '[') { gotoCase = 129; continue; };
    1148                     } else {
    1149                         if (yych != 'b') { gotoCase = 129; continue; };
     1394                        if (yych <= '[') { gotoCase = 134; continue; };
     1395                    } else {
     1396                        if (yych != 'b') { gotoCase = 134; continue; };
    11501397                    }
    11511398                }
     
    11531400                if (yych <= 'r') {
    11541401                    if (yych <= 'm') {
    1155                         if (yych >= 'g') { gotoCase = 129; continue; };
    1156                     } else {
    1157                         if (yych <= 'n') { gotoCase = 133; continue; };
    1158                         if (yych <= 'q') { gotoCase = 129; continue; };
     1402                        if (yych >= 'g') { gotoCase = 134; continue; };
     1403                    } else {
     1404                        if (yych <= 'n') { gotoCase = 138; continue; };
     1405                        if (yych <= 'q') { gotoCase = 134; continue; };
    11591406                    }
    11601407                } else {
    11611408                    if (yych <= 't') {
    1162                         if (yych <= 's') { gotoCase = 129; continue; };
    1163                     } else {
    1164                         if (yych != 'v') { gotoCase = 129; continue; };
    1165                     }
    1166                 }
    1167             }
    1168 case 133:
     1409                        if (yych <= 's') { gotoCase = 134; continue; };
     1410                    } else {
     1411                        if (yych != 'v') { gotoCase = 134; continue; };
     1412                    }
     1413                }
     1414            }
     1415case 138:
    11691416            yyaccept = 0;
    11701417            YYMARKER = ++cursor;
    11711418            yych = this._charAt(cursor);
    1172 case 134:
     1419case 139:
    11731420            if (yych <= '\r') {
    1174                 if (yych == '\n') { gotoCase = 126; continue; };
    1175                 if (yych <= '\f') { gotoCase = 133; continue; };
    1176                 { gotoCase = 126; continue; };
     1421                if (yych == '\n') { gotoCase = 131; continue; };
     1422                if (yych <= '\f') { gotoCase = 138; continue; };
     1423                { gotoCase = 131; continue; };
    11771424            } else {
    11781425                if (yych <= '\'') {
    1179                     if (yych <= '&') { gotoCase = 133; continue; };
    1180                     { gotoCase = 137; continue; };
    1181                 } else {
    1182                     if (yych != '\\') { gotoCase = 133; continue; };
     1426                    if (yych <= '&') { gotoCase = 138; continue; };
     1427                    { gotoCase = 142; continue; };
     1428                } else {
     1429                    if (yych != '\\') { gotoCase = 138; continue; };
    11831430                }
    11841431            }
     
    11871434            if (yych <= 'e') {
    11881435                if (yych <= '\'') {
    1189                     if (yych == '"') { gotoCase = 133; continue; };
    1190                     if (yych >= '\'') { gotoCase = 133; continue; };
     1436                    if (yych == '"') { gotoCase = 138; continue; };
     1437                    if (yych >= '\'') { gotoCase = 138; continue; };
    11911438                } else {
    11921439                    if (yych <= '\\') {
    1193                         if (yych >= '\\') { gotoCase = 133; continue; };
    1194                     } else {
    1195                         if (yych == 'b') { gotoCase = 133; continue; };
     1440                        if (yych >= '\\') { gotoCase = 138; continue; };
     1441                    } else {
     1442                        if (yych == 'b') { gotoCase = 138; continue; };
    11961443                    }
    11971444                }
     
    11991446                if (yych <= 'r') {
    12001447                    if (yych <= 'm') {
    1201                         if (yych <= 'f') { gotoCase = 133; continue; };
    1202                     } else {
    1203                         if (yych <= 'n') { gotoCase = 133; continue; };
    1204                         if (yych >= 'r') { gotoCase = 133; continue; };
     1448                        if (yych <= 'f') { gotoCase = 138; continue; };
     1449                    } else {
     1450                        if (yych <= 'n') { gotoCase = 138; continue; };
     1451                        if (yych >= 'r') { gotoCase = 138; continue; };
    12051452                    }
    12061453                } else {
    12071454                    if (yych <= 't') {
    1208                         if (yych >= 't') { gotoCase = 133; continue; };
    1209                     } else {
    1210                         if (yych == 'v') { gotoCase = 133; continue; };
     1455                        if (yych >= 't') { gotoCase = 138; continue; };
     1456                    } else {
     1457                        if (yych == 'v') { gotoCase = 138; continue; };
    12111458                    }
    12121459                }
    12131460            }
    12141461            cursor = YYMARKER;
    1215             { gotoCase = 126; continue; };
    1216 case 137:
    1217             ++cursor;
    1218             yych = this._charAt(cursor);
    12191462            { gotoCase = 131; continue; };
     1463case 142:
     1464            ++cursor;
     1465            yych = this._charAt(cursor);
     1466            { gotoCase = 136; continue; };
    12201467        }
    12211468
     
    12241471}
    12251472
    1226 WebInspector.SourceCSSTokenizer.prototype.__proto__ = WebInspector.TextEditorHighlighter.Tokenizer.prototype;
     1473WebInspector.SourceCSSTokenizer.prototype.__proto__ = WebInspector.SourceTokenizer.prototype;
  • trunk/WebCore/inspector/front-end/SourceCSSTokenizer.re2js

    r53846 r54053  
    4343WebInspector.SourceCSSTokenizer = function()
    4444{
    45     WebInspector.TextEditorHighlighter.Tokenizer.call(this);
     45    WebInspector.SourceTokenizer.call(this);
    4646
    4747    this._propertyKeywords = [
     
    213213                CloseCurlyBracket = "}";
    214214
    215                 OpenBracket = "(";
    216                 CloseBracket = ")";
    217 
    218215                Colon = ":";
    219216                Semicolon = ";";
     
    222219                    "mm" | "in" | "pt" | "pc" | "deg" | "rad" | "grad" | "turn" | "ms" | "s" | "Hz" | "kHz" | "%")?;
    223220
    224                 Identifier = [@!_\-$0-9a-zA-Z]+;
     221                Identifier = [@!_\-$0-9a-zA-Z\[\]='"/]+;
    225222
    226223                DoubleStringContent = ([^\r\n\"\\] | "\\" ['"\\bfnrtv])*;
     
    296293                            this.tokenType = "css-at-rule";
    297294                            this._parseCondition = this._parseConditions.AT_RULE;
    298                         } else
     295                        } else if (token.indexOf("@") === 0)
     296                            this.tokenType = "css-at-rule";
     297                        else
    299298                            this.tokenType = "css-selector";
    300299                    }
     
    317316}
    318317
    319 WebInspector.SourceCSSTokenizer.prototype.__proto__ = WebInspector.TextEditorHighlighter.Tokenizer.prototype;
     318WebInspector.SourceCSSTokenizer.prototype.__proto__ = WebInspector.SourceTokenizer.prototype;
  • trunk/WebCore/inspector/front-end/SourceHTMLTokenizer.js

    r53916 r54053  
    1 /* Generated by re2c 0.13.5 on Tue Jan 26 23:10:38 2010 */
     1/* Generated by re2c 0.13.5 on Thu Jan 28 20:49:22 2010 */
    22/*
    33 * Copyright (C) 2009 Google Inc. All rights reserved.
     
    4444WebInspector.SourceHTMLTokenizer = function()
    4545{
    46     WebInspector.TextEditorHighlighter.Tokenizer.call(this);
     46    WebInspector.SourceTokenizer.call(this);
    4747
    4848    this._lexConditions = {
     
    235235case this.case_INITIAL:
    236236            yych = this._charAt(cursor);
    237             if (yych <= '>') {
     237            if (yych <= '=') {
    238238                if (yych <= '\'') {
    239239                    if (yych == '"') { gotoCase = 29; continue; };
    240240                    if (yych >= '\'') { gotoCase = 30; continue; };
    241241                } else {
    242                     if (yych <= ';') { gotoCase = 27; continue; };
    243                     if (yych <= '<') { gotoCase = 31; continue; };
    244                     if (yych <= '=') { gotoCase = 33; continue; };
    245                     { gotoCase = 35; continue; };
    246                 }
    247             } else {
    248                 if (yych <= '_') {
     242                    if (yych <= '9') {
     243                        if (yych >= '0') { gotoCase = 31; continue; };
     244                    } else {
     245                        if (yych <= ';') { gotoCase = 27; continue; };
     246                        if (yych <= '<') { gotoCase = 33; continue; };
     247                        { gotoCase = 35; continue; };
     248                    }
     249                }
     250            } else {
     251                if (yych <= '^') {
     252                    if (yych <= '>') { gotoCase = 37; continue; };
    249253                    if (yych <= '@') { gotoCase = 27; continue; };
    250                     if (yych <= 'Z') { gotoCase = 37; continue; };
    251                     if (yych >= '_') { gotoCase = 37; continue; };
    252                 } else {
    253                     if (yych <= '`') { gotoCase = 27; continue; };
    254                     if (yych <= 'z') { gotoCase = 37; continue; };
    255                     if (yych >= 0x80) { gotoCase = 37; continue; };
     254                    if (yych <= 'Z') { gotoCase = 31; continue; };
     255                } else {
     256                    if (yych <= '`') {
     257                        if (yych <= '_') { gotoCase = 31; continue; };
     258                    } else {
     259                        if (yych <= 'z') { gotoCase = 31; continue; };
     260                        if (yych >= 0x80) { gotoCase = 31; continue; };
     261                    }
    256262                }
    257263            }
     
    269275            { gotoCase = 76; continue; };
    270276case 31:
    271             yyaccept = 1;
    272             yych = this._charAt(YYMARKER = ++cursor);
    273             if (yych <= '/') {
    274                 if (yych == '!') { gotoCase = 44; continue; };
    275                 if (yych >= '/') { gotoCase = 41; continue; };
    276             } else {
    277                 if (yych <= 'S') {
    278                     if (yych >= 'S') { gotoCase = 42; continue; };
    279                 } else {
    280                     if (yych == 's') { gotoCase = 42; continue; };
    281                 }
    282             }
     277            ++cursor;
     278            yych = this._charAt(cursor);
     279            { gotoCase = 74; continue; };
    283280case 32:
    284             {
    285                     if (this._parseCondition === this._parseConditions.SCRIPT) {
    286                         this.tokenType = null;
    287                         return cursor;
    288                     }
    289 
    290                     this.tokenType = "html-tag";
    291                     this._parseCondition = this._parseConditions.TAG;
    292                     return cursor;
    293                 }
    294 case 33:
    295             ++cursor;
    296             {
    297                     if (this._isAttribute()) {
    298                         this.tokenType = null;
    299                         this._setAttributeValue();
    300                     } else if (this._parseCondition === this._parseConditions.DOCTYPE)
    301                         this.tokenType = "html-doctype";
    302                     else
    303                         this.tokenType = null;
    304                     return cursor;
    305                 }
    306 case 35:
    307             ++cursor;
    308             {
    309                     if (this._parseCondition === this._parseConditions.SCRIPT) {
    310                         this.tokenType = null;
    311                         return cursor;
    312                     }
    313 
    314                     if (this._parseCondition === this._parseConditions.DOCTYPE)
    315                         this.tokenType = "html-doctype";
    316                     else
    317                         this.tokenType = "html-tag";
    318 
    319                     if (this._parseCondition === this._parseConditions.SCRIPT_ATTRIBUTE)
    320                         this._parseCondition = this._parseConditions.SCRIPT;
    321                     else
    322                         this._parseCondition = this._parseConditions.INITIAL;
    323                     return cursor;
    324                 }
    325 case 37:
    326             ++cursor;
    327             yych = this._charAt(cursor);
    328             { gotoCase = 40; continue; };
    329 case 38:
    330281            {
    331282                    if (this._parseCondition === this._parseConditions.SCRIPT) {
     
    347298                    return cursor;
    348299                }
    349 case 39:
    350             ++cursor;
    351             yych = this._charAt(cursor);
    352 case 40:
    353             if (yych <= '_') {
    354                 if (yych <= '@') { gotoCase = 38; continue; };
    355                 if (yych <= 'Z') { gotoCase = 39; continue; };
    356                 if (yych <= '^') { gotoCase = 38; continue; };
    357                 { gotoCase = 39; continue; };
    358             } else {
    359                 if (yych <= '`') { gotoCase = 38; continue; };
    360                 if (yych <= 'z') { gotoCase = 39; continue; };
    361                 if (yych <= 0x7F) { gotoCase = 38; continue; };
    362                 { gotoCase = 39; continue; };
    363             }
    364 case 41:
     300case 33:
    365301            yyaccept = 1;
    366302            yych = this._charAt(YYMARKER = ++cursor);
    367             if (yych == 'S') { gotoCase = 68; continue; };
    368             if (yych == 's') { gotoCase = 68; continue; };
    369             { gotoCase = 32; continue; };
    370 case 42:
    371             yych = this._charAt(++cursor);
    372             if (yych == 'C') { gotoCase = 62; continue; };
    373             if (yych == 'c') { gotoCase = 62; continue; };
    374 case 43:
     303            if (yych <= '/') {
     304                if (yych == '!') { gotoCase = 42; continue; };
     305                if (yych >= '/') { gotoCase = 39; continue; };
     306            } else {
     307                if (yych <= 'S') {
     308                    if (yych >= 'S') { gotoCase = 40; continue; };
     309                } else {
     310                    if (yych == 's') { gotoCase = 40; continue; };
     311                }
     312            }
     313case 34:
     314            {
     315                    if (this._parseCondition === this._parseConditions.SCRIPT) {
     316                        this.tokenType = null;
     317                        return cursor;
     318                    }
     319
     320                    this.tokenType = "html-tag";
     321                    this._parseCondition = this._parseConditions.TAG;
     322                    return cursor;
     323                }
     324case 35:
     325            ++cursor;
     326            {
     327                    if (this._isAttribute()) {
     328                        this.tokenType = null;
     329                        this._setAttributeValue();
     330                    } else if (this._parseCondition === this._parseConditions.DOCTYPE)
     331                        this.tokenType = "html-doctype";
     332                    else
     333                        this.tokenType = null;
     334                    return cursor;
     335                }
     336case 37:
     337            ++cursor;
     338            {
     339                    if (this._parseCondition === this._parseConditions.SCRIPT) {
     340                        this.tokenType = null;
     341                        return cursor;
     342                    }
     343
     344                    if (this._parseCondition === this._parseConditions.DOCTYPE)
     345                        this.tokenType = "html-doctype";
     346                    else
     347                        this.tokenType = "html-tag";
     348
     349                    if (this._parseCondition === this._parseConditions.SCRIPT_ATTRIBUTE)
     350                        this._parseCondition = this._parseConditions.SCRIPT;
     351                    else
     352                        this._parseCondition = this._parseConditions.INITIAL;
     353                    return cursor;
     354                }
     355case 39:
     356            yyaccept = 1;
     357            yych = this._charAt(YYMARKER = ++cursor);
     358            if (yych == 'S') { gotoCase = 66; continue; };
     359            if (yych == 's') { gotoCase = 66; continue; };
     360            { gotoCase = 34; continue; };
     361case 40:
     362            yych = this._charAt(++cursor);
     363            if (yych == 'C') { gotoCase = 60; continue; };
     364            if (yych == 'c') { gotoCase = 60; continue; };
     365case 41:
    375366            cursor = YYMARKER;
    376367            if (yyaccept <= 0) {
    377368                { gotoCase = 28; continue; };
    378369            } else {
    379                 { gotoCase = 32; continue; };
    380             }
     370                { gotoCase = 34; continue; };
     371            }
     372case 42:
     373            yych = this._charAt(++cursor);
     374            if (yych <= 'C') {
     375                if (yych != '-') { gotoCase = 41; continue; };
     376            } else {
     377                if (yych <= 'D') { gotoCase = 44; continue; };
     378                if (yych == 'd') { gotoCase = 44; continue; };
     379                { gotoCase = 41; continue; };
     380            }
     381            yych = this._charAt(++cursor);
     382            if (yych == '-') { gotoCase = 52; continue; };
     383            { gotoCase = 41; continue; };
    381384case 44:
    382385            yych = this._charAt(++cursor);
    383             if (yych <= 'C') {
    384                 if (yych != '-') { gotoCase = 43; continue; };
    385             } else {
    386                 if (yych <= 'D') { gotoCase = 46; continue; };
    387                 if (yych == 'd') { gotoCase = 46; continue; };
    388                 { gotoCase = 43; continue; };
    389             }
    390             yych = this._charAt(++cursor);
    391             if (yych == '-') { gotoCase = 54; continue; };
    392             { gotoCase = 43; continue; };
     386            if (yych == 'O') { gotoCase = 45; continue; };
     387            if (yych != 'o') { gotoCase = 41; continue; };
     388case 45:
     389            yych = this._charAt(++cursor);
     390            if (yych == 'C') { gotoCase = 46; continue; };
     391            if (yych != 'c') { gotoCase = 41; continue; };
    393392case 46:
    394393            yych = this._charAt(++cursor);
    395             if (yych == 'O') { gotoCase = 47; continue; };
    396             if (yych != 'o') { gotoCase = 43; continue; };
     394            if (yych == 'T') { gotoCase = 47; continue; };
     395            if (yych != 't') { gotoCase = 41; continue; };
    397396case 47:
    398397            yych = this._charAt(++cursor);
    399             if (yych == 'C') { gotoCase = 48; continue; };
    400             if (yych != 'c') { gotoCase = 43; continue; };
     398            if (yych == 'Y') { gotoCase = 48; continue; };
     399            if (yych != 'y') { gotoCase = 41; continue; };
    401400case 48:
    402401            yych = this._charAt(++cursor);
    403             if (yych == 'T') { gotoCase = 49; continue; };
    404             if (yych != 't') { gotoCase = 43; continue; };
     402            if (yych == 'P') { gotoCase = 49; continue; };
     403            if (yych != 'p') { gotoCase = 41; continue; };
    405404case 49:
    406405            yych = this._charAt(++cursor);
    407             if (yych == 'Y') { gotoCase = 50; continue; };
    408             if (yych != 'y') { gotoCase = 43; continue; };
     406            if (yych == 'E') { gotoCase = 50; continue; };
     407            if (yych != 'e') { gotoCase = 41; continue; };
    409408case 50:
    410             yych = this._charAt(++cursor);
    411             if (yych == 'P') { gotoCase = 51; continue; };
    412             if (yych != 'p') { gotoCase = 43; continue; };
    413 case 51:
    414             yych = this._charAt(++cursor);
    415             if (yych == 'E') { gotoCase = 52; continue; };
    416             if (yych != 'e') { gotoCase = 43; continue; };
    417 case 52:
    418409            ++cursor;
    419410            {
     
    422413                    return cursor;
    423414                }
    424 case 54:
    425             ++cursor;
    426             yych = this._charAt(cursor);
    427             if (yych <= '\f') {
    428                 if (yych == '\n') { gotoCase = 57; continue; };
    429                 { gotoCase = 54; continue; };
    430             } else {
    431                 if (yych <= '\r') { gotoCase = 57; continue; };
    432                 if (yych != '-') { gotoCase = 54; continue; };
    433             }
    434             ++cursor;
    435             yych = this._charAt(cursor);
    436             if (yych == '-') { gotoCase = 59; continue; };
    437             { gotoCase = 43; continue; };
    438 case 57:
     415case 52:
     416            ++cursor;
     417            yych = this._charAt(cursor);
     418            if (yych <= '\f') {
     419                if (yych == '\n') { gotoCase = 55; continue; };
     420                { gotoCase = 52; continue; };
     421            } else {
     422                if (yych <= '\r') { gotoCase = 55; continue; };
     423                if (yych != '-') { gotoCase = 52; continue; };
     424            }
     425            ++cursor;
     426            yych = this._charAt(cursor);
     427            if (yych == '-') { gotoCase = 57; continue; };
     428            { gotoCase = 41; continue; };
     429case 55:
    439430            ++cursor;
    440431            this.setLexCondition(this._lexConditions.COMMENT);
    441432            { this.tokenType = "html-comment"; return cursor; }
    442 case 59:
    443             ++cursor;
    444             yych = this._charAt(cursor);
    445             if (yych != '>') { gotoCase = 54; continue; };
     433case 57:
     434            ++cursor;
     435            yych = this._charAt(cursor);
     436            if (yych != '>') { gotoCase = 52; continue; };
    446437            ++cursor;
    447438            { this.tokenType = "html-comment"; return cursor; }
     439case 60:
     440            yych = this._charAt(++cursor);
     441            if (yych == 'R') { gotoCase = 61; continue; };
     442            if (yych != 'r') { gotoCase = 41; continue; };
     443case 61:
     444            yych = this._charAt(++cursor);
     445            if (yych == 'I') { gotoCase = 62; continue; };
     446            if (yych != 'i') { gotoCase = 41; continue; };
    448447case 62:
    449448            yych = this._charAt(++cursor);
    450             if (yych == 'R') { gotoCase = 63; continue; };
    451             if (yych != 'r') { gotoCase = 43; continue; };
     449            if (yych == 'P') { gotoCase = 63; continue; };
     450            if (yych != 'p') { gotoCase = 41; continue; };
    452451case 63:
    453452            yych = this._charAt(++cursor);
    454             if (yych == 'I') { gotoCase = 64; continue; };
    455             if (yych != 'i') { gotoCase = 43; continue; };
     453            if (yych == 'T') { gotoCase = 64; continue; };
     454            if (yych != 't') { gotoCase = 41; continue; };
    456455case 64:
    457             yych = this._charAt(++cursor);
    458             if (yych == 'P') { gotoCase = 65; continue; };
    459             if (yych != 'p') { gotoCase = 43; continue; };
    460 case 65:
    461             yych = this._charAt(++cursor);
    462             if (yych == 'T') { gotoCase = 66; continue; };
    463             if (yych != 't') { gotoCase = 43; continue; };
    464 case 66:
    465456            ++cursor;
    466457            {
     
    469460                    return cursor;
    470461                }
     462case 66:
     463            yych = this._charAt(++cursor);
     464            if (yych == 'C') { gotoCase = 67; continue; };
     465            if (yych != 'c') { gotoCase = 41; continue; };
     466case 67:
     467            yych = this._charAt(++cursor);
     468            if (yych == 'R') { gotoCase = 68; continue; };
     469            if (yych != 'r') { gotoCase = 41; continue; };
    471470case 68:
    472471            yych = this._charAt(++cursor);
    473             if (yych == 'C') { gotoCase = 69; continue; };
    474             if (yych != 'c') { gotoCase = 43; continue; };
     472            if (yych == 'I') { gotoCase = 69; continue; };
     473            if (yych != 'i') { gotoCase = 41; continue; };
    475474case 69:
    476475            yych = this._charAt(++cursor);
    477             if (yych == 'R') { gotoCase = 70; continue; };
    478             if (yych != 'r') { gotoCase = 43; continue; };
     476            if (yych == 'P') { gotoCase = 70; continue; };
     477            if (yych != 'p') { gotoCase = 41; continue; };
    479478case 70:
    480479            yych = this._charAt(++cursor);
    481             if (yych == 'I') { gotoCase = 71; continue; };
    482             if (yych != 'i') { gotoCase = 43; continue; };
     480            if (yych == 'T') { gotoCase = 71; continue; };
     481            if (yych != 't') { gotoCase = 41; continue; };
    483482case 71:
    484             yych = this._charAt(++cursor);
    485             if (yych == 'P') { gotoCase = 72; continue; };
    486             if (yych != 'p') { gotoCase = 43; continue; };
    487 case 72:
    488             yych = this._charAt(++cursor);
    489             if (yych == 'T') { gotoCase = 73; continue; };
    490             if (yych != 't') { gotoCase = 43; continue; };
    491 case 73:
    492483            ++cursor;
    493484            {
     
    496487                    return cursor;
    497488                }
     489case 73:
     490            ++cursor;
     491            yych = this._charAt(cursor);
     492case 74:
     493            if (yych <= '^') {
     494                if (yych <= '9') {
     495                    if (yych <= '/') { gotoCase = 32; continue; };
     496                    { gotoCase = 73; continue; };
     497                } else {
     498                    if (yych <= '@') { gotoCase = 32; continue; };
     499                    if (yych <= 'Z') { gotoCase = 73; continue; };
     500                    { gotoCase = 32; continue; };
     501                }
     502            } else {
     503                if (yych <= '`') {
     504                    if (yych <= '_') { gotoCase = 73; continue; };
     505                    { gotoCase = 32; continue; };
     506                } else {
     507                    if (yych <= 'z') { gotoCase = 73; continue; };
     508                    if (yych <= 0x7F) { gotoCase = 32; continue; };
     509                    { gotoCase = 73; continue; };
     510                }
     511            }
    498512case 75:
    499513            ++cursor;
     
    574588}
    575589
    576 WebInspector.SourceHTMLTokenizer.prototype.__proto__ = WebInspector.TextEditorHighlighter.Tokenizer.prototype;
     590WebInspector.SourceHTMLTokenizer.prototype.__proto__ = WebInspector.SourceTokenizer.prototype;
  • trunk/WebCore/inspector/front-end/SourceHTMLTokenizer.re2js

    r53916 r54053  
    4343WebInspector.SourceHTMLTokenizer = function()
    4444{
    45     WebInspector.TextEditorHighlighter.Tokenizer.call(this);
     45    WebInspector.SourceTokenizer.call(this);
    4646
    4747    this._lexConditions = {
     
    151151                SingleStringEnd = SingleStringContent "'";
    152152
    153                 Identifier = [_a-zA-Z\x80-\xFF]+;
     153                Identifier = [_a-zA-Z0-9\x80-\xFF]+;
    154154
    155155                <INITIAL> Comment { this.tokenType = "html-comment"; return cursor; }
     
    256256}
    257257
    258 WebInspector.SourceHTMLTokenizer.prototype.__proto__ = WebInspector.TextEditorHighlighter.Tokenizer.prototype;
     258WebInspector.SourceHTMLTokenizer.prototype.__proto__ = WebInspector.SourceTokenizer.prototype;
  • trunk/WebCore/inspector/front-end/SourceJavaScriptTokenizer.js

    r53846 r54053  
    1 /* Generated by re2c 0.13.5 on Tue Jan 26 01:16:33 2010 */
     1/* Generated by re2c 0.13.5 on Thu Jan 28 20:49:23 2010 */
    22/*
    33 * Copyright (C) 2009 Google Inc. All rights reserved.
     
    4444WebInspector.SourceJavaScriptTokenizer = function()
    4545{
    46     WebInspector.TextEditorHighlighter.Tokenizer.call(this);
     46    WebInspector.SourceTokenizer.call(this);
    4747
    4848    this._keywords = [
     
    118118            }
    119119case 2:
    120             { this.tokenType = "js-comment"; return cursor; }
     120            { this.tokenType = "javascript-comment"; return cursor; }
    121121case 3:
    122122            yyaccept = 0;
     
    134134            ++cursor;
    135135            this.setLexCondition(this._lexConditions.NODIV);
    136             { this.tokenType = "js-comment"; return cursor; }
     136            { this.tokenType = "javascript-comment"; return cursor; }
    137137case 9:
    138138            ++cursor;
     
    248248                    var token = this._line.substring(cursorOnEnter, cursor);
    249249                    if (token in this._keywords)
    250                         this.tokenType = "js-keyword";
     250                        this.tokenType = "javascript-keyword";
    251251                    else
    252                         this.tokenType = null;
     252                        this.tokenType = "javascript-ident";
    253253                    return cursor;
    254254                }
     
    324324            }
    325325case 35:
    326             { this.tokenType = "js-number"; return cursor; }
     326            { this.tokenType = "javascript-number"; return cursor; }
    327327case 36:
    328328            yyaccept = 3;
     
    637637            if (yych != '\r') { gotoCase = 80; continue; };
    638638case 82:
    639             { this.tokenType = "js-comment"; return cursor; }
     639            { this.tokenType = "javascript-comment"; return cursor; }
    640640case 83:
    641641            ++cursor;
     
    647647            ++cursor;
    648648            this.setLexCondition(this._lexConditions.COMMENT);
    649             { this.tokenType = "js-comment"; return cursor; }
     649            { this.tokenType = "javascript-comment"; return cursor; }
    650650case 87:
    651651            ++cursor;
    652             { this.tokenType = "js-comment"; return cursor; }
     652            { this.tokenType = "javascript-comment"; return cursor; }
    653653case 89:
    654654            yyaccept = 3;
     
    743743case 98:
    744744            ++cursor;
    745             { this.tokenType = "js-string"; return cursor; }
     745            { this.tokenType = "javascript-string"; return cursor; }
    746746case 100:
    747747            ++cursor;
     
    760760            ++cursor;
    761761            this.setLexCondition(this._lexConditions.SSTRING);
    762             { this.tokenType = "js-string"; return cursor; }
     762            { this.tokenType = "javascript-string"; return cursor; }
    763763case 103:
    764764            ++cursor;
     
    870870            ++cursor;
    871871            this.setLexCondition(this._lexConditions.DSTRING);
    872             { this.tokenType = "js-string"; return cursor; }
     872            { this.tokenType = "javascript-string"; return cursor; }
    873873case 112:
    874874            ++cursor;
     
    927927            }
    928928case 118:
    929             { this.tokenType = "js-string"; return cursor; }
     929            { this.tokenType = "javascript-string"; return cursor; }
    930930case 119:
    931931            yyaccept = 0;
     
    940940case 123:
    941941            this.setLexCondition(this._lexConditions.NODIV);
    942             { this.tokenType = "js-string"; return cursor; }
     942            { this.tokenType = "javascript-string"; return cursor; }
    943943case 124:
    944944            yyaccept = 1;
     
    11801180                    var token = this._line.substring(cursorOnEnter, cursor);
    11811181                    if (token in this._keywords)
    1182                         this.tokenType = "js-keyword";
     1182                        this.tokenType = "javascript-keyword";
    11831183                    else
    1184                         this.tokenType = null;
     1184                        this.tokenType = "javascript-ident";
    11851185                    return cursor;
    11861186                }
     
    12691269case 155:
    12701270            this.setLexCondition(this._lexConditions.DIV);
    1271             { this.tokenType = "js-number"; return cursor; }
     1271            { this.tokenType = "javascript-number"; return cursor; }
    12721272case 156:
    12731273            yyaccept = 2;
     
    16281628            if (yych != '\r') { gotoCase = 204; continue; };
    16291629case 206:
    1630             { this.tokenType = "js-comment"; return cursor; }
     1630            { this.tokenType = "javascript-comment"; return cursor; }
    16311631case 207:
    16321632            ++cursor;
     
    16381638            ++cursor;
    16391639            this.setLexCondition(this._lexConditions.COMMENT);
    1640             { this.tokenType = "js-comment"; return cursor; }
     1640            { this.tokenType = "javascript-comment"; return cursor; }
    16411641case 211:
    16421642            ++cursor;
    1643             { this.tokenType = "js-comment"; return cursor; }
     1643            { this.tokenType = "javascript-comment"; return cursor; }
    16441644case 213:
    16451645            ++cursor;
     
    16781678case 217:
    16791679            this.setLexCondition(this._lexConditions.REGEX);
    1680             { this.tokenType = "js-regex"; return cursor; }
     1680            { this.tokenType = "javascript-regexp"; return cursor; }
    16811681case 218:
    16821682            ++cursor;
     
    17101710                if (yych == 'm') { gotoCase = 220; continue; };
    17111711            }
    1712             { this.tokenType = "js-regex"; return cursor; }
     1712            { this.tokenType = "javascript-regexp"; return cursor; }
    17131713case 223:
    17141714            ++cursor;
     
    19011901case 243:
    19021902            ++cursor;
    1903             { this.tokenType = "js-string"; return cursor; }
     1903            { this.tokenType = "javascript-string"; return cursor; }
    19041904case 245:
    19051905            ++cursor;
     
    19181918            ++cursor;
    19191919            this.setLexCondition(this._lexConditions.SSTRING);
    1920             { this.tokenType = "js-string"; return cursor; }
     1920            { this.tokenType = "javascript-string"; return cursor; }
    19211921case 248:
    19221922            ++cursor;
     
    20282028            ++cursor;
    20292029            this.setLexCondition(this._lexConditions.DSTRING);
    2030             { this.tokenType = "js-string"; return cursor; }
     2030            { this.tokenType = "javascript-string"; return cursor; }
    20312031case 257:
    20322032            ++cursor;
     
    20912091            }
    20922092case 263:
    2093             { this.tokenType = "js-regex"; return cursor; }
     2093            { this.tokenType = "javascript-regexp"; return cursor; }
    20942094case 264:
    20952095            yyaccept = 0;
     
    21062106case 268:
    21072107            this.setLexCondition(this._lexConditions.NODIV);
    2108             { this.tokenType = "js-regex"; return cursor; }
     2108            { this.tokenType = "javascript-regexp"; return cursor; }
    21092109case 269:
    21102110            yyaccept = 1;
     
    22502250            }
    22512251case 285:
    2252             { this.tokenType = "js-string"; return cursor; }
     2252            { this.tokenType = "javascript-string"; return cursor; }
    22532253case 286:
    22542254            yyaccept = 0;
     
    22632263case 290:
    22642264            this.setLexCondition(this._lexConditions.NODIV);
    2265             { this.tokenType = "js-string"; return cursor; }
     2265            { this.tokenType = "javascript-string"; return cursor; }
    22662266case 291:
    22672267            yyaccept = 1;
     
    24142414}
    24152415
    2416 WebInspector.SourceJavaScriptTokenizer.prototype.__proto__ = WebInspector.TextEditorHighlighter.Tokenizer.prototype;
     2416WebInspector.SourceJavaScriptTokenizer.prototype.__proto__ = WebInspector.SourceTokenizer.prototype;
  • trunk/WebCore/inspector/front-end/SourceJavaScriptTokenizer.re2js

    r53846 r54053  
    4343WebInspector.SourceJavaScriptTokenizer = function()
    4444{
    45     WebInspector.TextEditorHighlighter.Tokenizer.call(this);
     45    WebInspector.SourceTokenizer.call(this);
    4646
    4747    this._keywords = [
     
    137137                RegexEnd = RegexContent "/" [igm]*;
    138138
    139                 <DIV,NODIV> LineComment { this.tokenType = "js-comment"; return cursor; }
    140                 <DIV,NODIV> Comment { this.tokenType = "js-comment"; return cursor; }
    141                 <DIV,NODIV> CommentStart => COMMENT { this.tokenType = "js-comment"; return cursor; }
    142                 <COMMENT> CommentContent => COMMENT { this.tokenType = "js-comment"; return cursor; }
    143                 <COMMENT> CommentEnd => NODIV { this.tokenType = "js-comment"; return cursor; }
     139                <DIV,NODIV> LineComment { this.tokenType = "javascript-comment"; return cursor; }
     140                <DIV,NODIV> Comment { this.tokenType = "javascript-comment"; return cursor; }
     141                <DIV,NODIV> CommentStart => COMMENT { this.tokenType = "javascript-comment"; return cursor; }
     142                <COMMENT> CommentContent => COMMENT { this.tokenType = "javascript-comment"; return cursor; }
     143                <COMMENT> CommentEnd => NODIV { this.tokenType = "javascript-comment"; return cursor; }
    144144
    145                 <DIV,NODIV> StringLiteral { this.tokenType = "js-string"; return cursor; }
    146                 <DIV,NODIV> DoubleStringStart => DSTRING { this.tokenType = "js-string"; return cursor; }
    147                 <DSTRING> DoubleStringContent => DSTRING { this.tokenType = "js-string"; return cursor; }
    148                 <DSTRING> DoubleStringEnd => NODIV { this.tokenType = "js-string"; return cursor; }
    149                 <DIV,NODIV> SingleStringStart => SSTRING { this.tokenType = "js-string"; return cursor; }
    150                 <SSTRING> SingleStringContent => SSTRING { this.tokenType = "js-string"; return cursor; }
    151                 <SSTRING> SingleStringEnd => NODIV { this.tokenType = "js-string"; return cursor; }
     145                <DIV,NODIV> StringLiteral { this.tokenType = "javascript-string"; return cursor; }
     146                <DIV,NODIV> DoubleStringStart => DSTRING { this.tokenType = "javascript-string"; return cursor; }
     147                <DSTRING> DoubleStringContent => DSTRING { this.tokenType = "javascript-string"; return cursor; }
     148                <DSTRING> DoubleStringEnd => NODIV { this.tokenType = "javascript-string"; return cursor; }
     149                <DIV,NODIV> SingleStringStart => SSTRING { this.tokenType = "javascript-string"; return cursor; }
     150                <SSTRING> SingleStringContent => SSTRING { this.tokenType = "javascript-string"; return cursor; }
     151                <SSTRING> SingleStringEnd => NODIV { this.tokenType = "javascript-string"; return cursor; }
    152152
    153                 <NODIV> Regex { this.tokenType = "js-regex"; return cursor; }
    154                 <NODIV> RegexStart => REGEX { this.tokenType = "js-regex"; return cursor; }
    155                 <REGEX> RegexContent => REGEX { this.tokenType = "js-regex"; return cursor; }
    156                 <REGEX> RegexEnd => NODIV { this.tokenType = "js-regex"; return cursor; }
     153                <NODIV> Regex { this.tokenType = "javascript-regexp"; return cursor; }
     154                <NODIV> RegexStart => REGEX { this.tokenType = "javascript-regexp"; return cursor; }
     155                <REGEX> RegexContent => REGEX { this.tokenType = "javascript-regexp"; return cursor; }
     156                <REGEX> RegexEnd => NODIV { this.tokenType = "javascript-regexp"; return cursor; }
    157157
    158                 <DIV,NODIV> NumericLiteral => DIV { this.tokenType = "js-number"; return cursor; }
     158                <DIV,NODIV> NumericLiteral => DIV { this.tokenType = "javascript-number"; return cursor; }
    159159                <DIV,NODIV> Identifier => DIV
    160160                {
    161161                    var token = this._line.substring(cursorOnEnter, cursor);
    162162                    if (token in this._keywords)
    163                         this.tokenType = "js-keyword";
     163                        this.tokenType = "javascript-keyword";
    164164                    else
    165                         this.tokenType = null;
     165                        this.tokenType = "javascript-ident";
    166166                    return cursor;
    167167                }
     
    175175}
    176176
    177 WebInspector.SourceJavaScriptTokenizer.prototype.__proto__ = WebInspector.TextEditorHighlighter.Tokenizer.prototype;
     177WebInspector.SourceJavaScriptTokenizer.prototype.__proto__ = WebInspector.SourceTokenizer.prototype;
  • trunk/WebCore/inspector/front-end/TextEditorHighlighter.js

    r54052 r54053  
    5353    this._styles["html-doctype"] = "rgb(192, 192, 192)";
    5454
    55     this._styles["js-comment"] = "rgb(0, 116, 0)";
    56     this._styles["js-string"] = "rgb(196, 26, 22)";
    57     this._styles["js-regex"] = "rgb(196, 26, 22)";
    58     this._styles["js-keyword"] = "rgb(170, 13, 145)";
    59     this._styles["js-number"] = "rgb(28, 0, 207)";
    60 
    61     this._tokenizers = {};
    62     this._tokenizerConstructors = {
    63         "text/css": WebInspector.SourceCSSTokenizer,
    64         "text/html": WebInspector.SourceHTMLTokenizer,
    65         "text/javascript": WebInspector.SourceJavaScriptTokenizer,
    66         "application/x-javascript": WebInspector.SourceJavaScriptTokenizer
    67     };
     55    this._styles["javascript-comment"] = "rgb(0, 116, 0)";
     56    this._styles["javascript-string"] = "rgb(196, 26, 22)";
     57    this._styles["javascript-regexp"] = "rgb(196, 26, 22)";
     58    this._styles["javascript-keyword"] = "rgb(170, 13, 145)";
     59    this._styles["javascript-number"] = "rgb(28, 0, 207)";
    6860
    6961    this.mimeType = "text/html";
     
    7466    set mimeType(mimeType)
    7567    {
    76         if (!this._tokenizerConstructors[mimeType])
    77             return;
    78         this._tokenizer = this._tokenizers[mimeType];
    79         if (!this._tokenizer) {
    80             this._tokenizer = new this._tokenizerConstructors[mimeType]();
    81             this._tokenizers[mimeType] = this._tokenizer;
    82         }
     68        var tokenizer = WebInspector.SourceTokenizer.Registry.getInstance().getTokenizer(mimeType);
     69        if (tokenizer)
     70            this._tokenizer = tokenizer;
    8371    },
    8472
     
    206194    }
    207195}
    208 
    209 WebInspector.TextEditorHighlighter.Tokenizer = function()
    210 {
    211 }
    212 
    213 WebInspector.TextEditorHighlighter.Tokenizer.prototype = {
    214     set line(line) {
    215         this._line = line;
    216     },
    217 
    218     set condition(condition)
    219     {
    220         this._lexCondition = condition.lexCondition;
    221         this._parseCondition = condition.parseCondition;
    222     },
    223 
    224     get condition()
    225     {
    226         return { lexCondition: this._lexCondition, parseCondition: this._parseCondition };
    227     },
    228 
    229     hasCondition: function(condition)
    230     {
    231         return this._lexCondition === condition.lexCondition && this._parseCondition === condition.parseCondition;
    232     },
    233 
    234     getLexCondition: function()
    235     {
    236         return this._lexCondition;
    237     },
    238 
    239     setLexCondition: function(lexCondition)
    240     {
    241         this._lexCondition = lexCondition;
    242     },
    243 
    244     _charAt: function(cursor)
    245     {
    246         return cursor < this._line.length ? this._line.charAt(cursor) : "\n";
    247     }
    248 }
  • trunk/WebCore/inspector/front-end/WebKit.qrc

    r53941 r54053  
    1717    <file>ContextMenu.js</file>
    1818    <file>CookieItemsView.js</file>
    19     <file>CSSSourceSyntaxHighlighter.js</file>
    2019    <file>Database.js</file>
    2120    <file>DatabaseQueryView.js</file>
     
    2524    <file>DOMStorage.js</file>
    2625    <file>DOMStorageItemsView.js</file>
     26    <file>DOMSyntaxHighlighter.js</file>
    2727    <file>Drawer.js</file>
    2828    <file>ElementsPanel.js</file>
     
    3636    <file>InspectorBackendStub.js</file>
    3737    <file>InspectorFrontendHostStub.js</file>
    38     <file>JavaScriptSourceSyntaxHighlighter.js</file>
    3938    <file>KeyboardShortcut.js</file>
    4039    <file>MetricsSidebarPane.js</file>
     
    6766    <file>SourceHTMLTokenizer.js</file>
    6867    <file>SourceJavaScriptTokenizer.js</file>
    69     <file>SourceSyntaxHighlighter.js</file>
     68    <file>SourceTokenizer.js</file>
    7069    <file>SourceView.js</file>
    7170    <file>StatusBarButton.js</file>
  • trunk/WebCore/inspector/front-end/inspector.html

    r54001 r54053  
    9494    <script type="text/javascript" src="ResourceView.js"></script>
    9595    <script type="text/javascript" src="SourceFrame.js"></script>
    96     <script type="text/javascript" src="SourceSyntaxHighlighter.js"></script>
    97     <script type="text/javascript" src="CSSSourceSyntaxHighlighter.js"></script>
    98     <script type="text/javascript" src="JavaScriptSourceSyntaxHighlighter.js"></script>
     96    <script type="text/javascript" src="DOMSyntaxHighlighter.js"></script>
    9997    <script type="text/javascript" src="TextEditorModel.js"></script>
    10098    <script type="text/javascript" src="TextEditor.js"></script>
    10199    <script type="text/javascript" src="TextEditorHighlighter.js"></script>
     100    <script type="text/javascript" src="SourceTokenizer.js"></script>
    102101    <script type="text/javascript" src="SourceCSSTokenizer.js"></script>
    103102    <script type="text/javascript" src="SourceHTMLTokenizer.js"></script>
Note: See TracChangeset for help on using the changeset viewer.