Changeset 53916 in webkit


Ignore:
Timestamp:
Jan 27, 2010 3:18:55 AM (14 years ago)
Author:
pfeldman@chromium.org
Message:

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

Reviewed by Timothy Hatcher.

Web Inspector: Improve SourceHTMLTokenizer so that it treats script tag well.

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

  • inspector/front-end/SourceHTMLTokenizer.js: (WebInspector.SourceHTMLTokenizer): (WebInspector.SourceHTMLTokenizer.prototype._isAttribute): (WebInspector.SourceHTMLTokenizer.prototype._isAttributeValue): (WebInspector.SourceHTMLTokenizer.prototype._setAttributeValue): (WebInspector.SourceHTMLTokenizer.prototype._setAttribute): (WebInspector.SourceHTMLTokenizer.prototype._stringToken): (WebInspector.SourceHTMLTokenizer.prototype.nextToken):
  • inspector/front-end/SourceHTMLTokenizer.re2js:
Location:
trunk/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r53915 r53916  
    112010-01-27  Pavel Feldman  <pfeldman@chromium.org>
     2
     3        Reviewed by Timothy Hatcher.
     4
     5        Web Inspector: Improve SourceHTMLTokenizer so that it treats script tag well.
     6
     7        https://bugs.webkit.org/show_bug.cgi?id=34177
     8
     9        * inspector/front-end/SourceHTMLTokenizer.js:
     10        (WebInspector.SourceHTMLTokenizer):
     11        (WebInspector.SourceHTMLTokenizer.prototype._isAttribute):
     12        (WebInspector.SourceHTMLTokenizer.prototype._isAttributeValue):
     13        (WebInspector.SourceHTMLTokenizer.prototype._setAttributeValue):
     14        (WebInspector.SourceHTMLTokenizer.prototype._setAttribute):
     15        (WebInspector.SourceHTMLTokenizer.prototype._stringToken):
     16        (WebInspector.SourceHTMLTokenizer.prototype.nextToken):
     17        * inspector/front-end/SourceHTMLTokenizer.re2js:
     18
     192010-01-26  Pavel Feldman  <pfeldman@chromium.org>
    220
    321        Reviewed by Timothy Hatcher.
  • trunk/WebCore/inspector/front-end/SourceHTMLTokenizer.js

    r53846 r53916  
    1 /* Generated by re2c 0.13.5 on Tue Jan 26 01:16:33 2010 */
     1/* Generated by re2c 0.13.5 on Tue Jan 26 23:10:38 2010 */
    22/*
    33 * Copyright (C) 2009 Google Inc. All rights reserved.
     
    5858        ATTRIBUTE: 2,
    5959        ATTRIBUTE_VALUE: 3,
    60         DOCTYPE: 4
     60        SCRIPT: 4,
     61        SCRIPT_ATTRIBUTE: 5,
     62        SCRIPT_ATTRIBUTE_VALUE: 6,
     63        DOCTYPE: 7
    6164    };
    6265
     
    7073
    7174WebInspector.SourceHTMLTokenizer.prototype = {
     75    _isAttribute: function()
     76    {
     77        return this._parseCondition === this._parseConditions.ATTRIBUTE || this._parseCondition === this._parseConditions.SCRIPT_ATTRIBUTE;
     78    },
     79
     80    _isAttributeValue: function()
     81    {
     82        return this._parseCondition === this._parseConditions.ATTRIBUTE_VALUE || this._parseCondition === this._parseConditions.SCRIPT_ATTRIBUTE_VALUE;
     83    },
     84
     85    _setAttributeValue: function()
     86    {
     87        if (this._parseCondition === this._parseConditions.ATTRIBUTE)
     88            this._parseCondition = this._parseConditions.ATTRIBUTE_VALUE;
     89        else if (this._parseCondition === this._parseConditions.SCRIPT_ATTRIBUTE)
     90            this._parseCondition = this._parseConditions.SCRIPT_ATTRIBUTE_VALUE;
     91    },
     92
     93    _setAttribute: function()
     94    {
     95        if (this._parseCondition === this._parseConditions.ATTRIBUTE_VALUE)
     96            this._parseCondition = this._parseConditions.ATTRIBUTE;
     97        else if (this._parseCondition === this._parseConditions.SCRIPT_ATTRIBUTE_VALUE)
     98            this._parseCondition = this._parseConditions.SCRIPT_ATTRIBUTE;
     99    },
     100
    72101    _stringToken: function(cursor, stringEnds)
    73102    {
    74         if (this._parseCondition === this._parseConditions.ATTRIBUTE_VALUE) {
     103        if (this._isAttributeValue()) {
    75104            this.tokenType = "html-attr-value";
    76105            if (stringEnds)
    77                 this._parseCondition = this._parseConditions.ATTRIBUTE;
     106                this._setAttribute();
    78107        } else if (this._parseCondition === this._parseConditions.DOCTYPE)
    79108            this.tokenType = "html-doctype";
     
    234263            yyaccept = 0;
    235264            yych = this._charAt(YYMARKER = ++cursor);
    236             { gotoCase = 68; continue; };
     265            { gotoCase = 82; continue; };
    237266case 30:
    238267            yyaccept = 0;
    239268            yych = this._charAt(YYMARKER = ++cursor);
    240             { gotoCase = 62; continue; };
     269            { gotoCase = 76; continue; };
    241270case 31:
    242271            yyaccept = 1;
    243272            yych = this._charAt(YYMARKER = ++cursor);
    244             if (yych == '!') { gotoCase = 42; continue; };
    245             if (yych == '/') { gotoCase = 41; continue; };
     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            }
    246283case 32:
    247284            {
     285                    if (this._parseCondition === this._parseConditions.SCRIPT) {
     286                        this.tokenType = null;
     287                        return cursor;
     288                    }
     289
    248290                    this.tokenType = "html-tag";
    249291                    this._parseCondition = this._parseConditions.TAG;
     
    253295            ++cursor;
    254296            {
    255                     if (this._parseCondition === this._parseConditions.ATTRIBUTE) {
     297                    if (this._isAttribute()) {
    256298                        this.tokenType = null;
    257                         this._parseCondition = this._parseConditions.ATTRIBUTE_VALUE;
     299                        this._setAttributeValue();
    258300                    } else if (this._parseCondition === this._parseConditions.DOCTYPE)
    259301                        this.tokenType = "html-doctype";
     
    265307            ++cursor;
    266308            {
     309                    if (this._parseCondition === this._parseConditions.SCRIPT) {
     310                        this.tokenType = null;
     311                        return cursor;
     312                    }
     313
    267314                    if (this._parseCondition === this._parseConditions.DOCTYPE)
    268315                        this.tokenType = "html-doctype";
    269316                    else
    270317                        this.tokenType = "html-tag";
    271                     this._parseCondition = this._parseConditions.INITIAL;
     318
     319                    if (this._parseCondition === this._parseConditions.SCRIPT_ATTRIBUTE)
     320                        this._parseCondition = this._parseConditions.SCRIPT;
     321                    else
     322                        this._parseCondition = this._parseConditions.INITIAL;
    272323                    return cursor;
    273324                }
     
    278329case 38:
    279330            {
     331                    if (this._parseCondition === this._parseConditions.SCRIPT) {
     332                        this.tokenType = null;
     333                        return cursor;
     334                    }
     335
    280336                    if (this._parseCondition === this._parseConditions.TAG) {
    281337                        this.tokenType = "html-tag";
    282338                        this._parseCondition = this._parseConditions.ATTRIBUTE;
    283                     } else if (this._parseCondition === this._parseConditions.ATTRIBUTE) {
     339                    } else if (this._isAttribute())
    284340                        this.tokenType = "html-attr-name";
    285                         this._parseCondition = this._parseConditions.ATTRIBUTE;
    286                     } else if (this._parseCondition === this._parseConditions.ATTRIBUTE_VALUE) {
     341                    else if (this._isAttributeValue())
    287342                        this.tokenType = "html-attr-value";
    288                         this._parseCondition = this._parseConditions.ATTRIBUTE;
    289                     } else if (this._parseCondition === this._parseConditions.DOCTYPE)
     343                    else if (this._parseCondition === this._parseConditions.DOCTYPE)
    290344                        this.tokenType = "html-doctype";
    291345                    else
     
    309363            }
    310364case 41:
    311             yych = this._charAt(++cursor);
     365            yyaccept = 1;
     366            yych = this._charAt(YYMARKER = ++cursor);
     367            if (yych == 'S') { gotoCase = 68; continue; };
     368            if (yych == 's') { gotoCase = 68; continue; };
    312369            { gotoCase = 32; continue; };
    313370case 42:
    314371            yych = this._charAt(++cursor);
    315             if (yych <= 'C') {
    316                 if (yych == '-') { gotoCase = 44; continue; };
    317             } else {
    318                 if (yych <= 'D') { gotoCase = 45; continue; };
    319                 if (yych == 'd') { gotoCase = 45; continue; };
    320             }
     372            if (yych == 'C') { gotoCase = 62; continue; };
     373            if (yych == 'c') { gotoCase = 62; continue; };
    321374case 43:
    322375            cursor = YYMARKER;
     
    328381case 44:
    329382            yych = this._charAt(++cursor);
    330             if (yych == '-') { gotoCase = 53; continue; };
     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; };
    331392            { gotoCase = 43; continue; };
    332 case 45:
    333             yych = this._charAt(++cursor);
    334             if (yych == 'O') { gotoCase = 46; continue; };
     393case 46:
     394            yych = this._charAt(++cursor);
     395            if (yych == 'O') { gotoCase = 47; continue; };
    335396            if (yych != 'o') { gotoCase = 43; continue; };
    336 case 46:
    337             yych = this._charAt(++cursor);
    338             if (yych == 'C') { gotoCase = 47; continue; };
     397case 47:
     398            yych = this._charAt(++cursor);
     399            if (yych == 'C') { gotoCase = 48; continue; };
    339400            if (yych != 'c') { gotoCase = 43; continue; };
    340 case 47:
    341             yych = this._charAt(++cursor);
    342             if (yych == 'T') { gotoCase = 48; continue; };
     401case 48:
     402            yych = this._charAt(++cursor);
     403            if (yych == 'T') { gotoCase = 49; continue; };
    343404            if (yych != 't') { gotoCase = 43; continue; };
    344 case 48:
    345             yych = this._charAt(++cursor);
    346             if (yych == 'Y') { gotoCase = 49; continue; };
     405case 49:
     406            yych = this._charAt(++cursor);
     407            if (yych == 'Y') { gotoCase = 50; continue; };
    347408            if (yych != 'y') { gotoCase = 43; continue; };
    348 case 49:
    349             yych = this._charAt(++cursor);
    350             if (yych == 'P') { gotoCase = 50; continue; };
     409case 50:
     410            yych = this._charAt(++cursor);
     411            if (yych == 'P') { gotoCase = 51; continue; };
    351412            if (yych != 'p') { gotoCase = 43; continue; };
    352 case 50:
    353             yych = this._charAt(++cursor);
    354             if (yych == 'E') { gotoCase = 51; continue; };
     413case 51:
     414            yych = this._charAt(++cursor);
     415            if (yych == 'E') { gotoCase = 52; continue; };
    355416            if (yych != 'e') { gotoCase = 43; continue; };
    356 case 51:
    357             ++cursor;
    358             {
    359                     var token = this._line.substring(cursorOnEnter, cursor);
     417case 52:
     418            ++cursor;
     419            {
    360420                    this.tokenType = "html-doctype";
    361421                    this._parseCondition = this._parseConditions.DOCTYPE;
    362422                    return cursor;
    363423                }
    364 case 53:
    365             ++cursor;
    366             yych = this._charAt(cursor);
    367             if (yych <= '\f') {
    368                 if (yych == '\n') { gotoCase = 56; continue; };
    369                 { gotoCase = 53; continue; };
    370             } else {
    371                 if (yych <= '\r') { gotoCase = 56; continue; };
    372                 if (yych != '-') { gotoCase = 53; continue; };
    373             }
    374             ++cursor;
    375             yych = this._charAt(cursor);
    376             if (yych == '-') { gotoCase = 58; continue; };
     424case 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; };
    377437            { gotoCase = 43; continue; };
    378 case 56:
     438case 57:
    379439            ++cursor;
    380440            this.setLexCondition(this._lexConditions.COMMENT);
    381441            { this.tokenType = "html-comment"; return cursor; }
    382 case 58:
    383             ++cursor;
    384             yych = this._charAt(cursor);
    385             if (yych != '>') { gotoCase = 53; continue; };
     442case 59:
     443            ++cursor;
     444            yych = this._charAt(cursor);
     445            if (yych != '>') { gotoCase = 54; continue; };
    386446            ++cursor;
    387447            { this.tokenType = "html-comment"; return cursor; }
    388 case 61:
    389             ++cursor;
    390             yych = this._charAt(cursor);
    391448case 62:
    392             if (yych <= '\f') {
    393                 if (yych != '\n') { gotoCase = 61; continue; };
    394             } else {
    395                 if (yych <= '\r') { gotoCase = 63; continue; };
    396                 if (yych == '\'') { gotoCase = 65; continue; };
    397                 { gotoCase = 61; continue; };
    398             }
     449            yych = this._charAt(++cursor);
     450            if (yych == 'R') { gotoCase = 63; continue; };
     451            if (yych != 'r') { gotoCase = 43; continue; };
    399452case 63:
     453            yych = this._charAt(++cursor);
     454            if (yych == 'I') { gotoCase = 64; continue; };
     455            if (yych != 'i') { gotoCase = 43; continue; };
     456case 64:
     457            yych = this._charAt(++cursor);
     458            if (yych == 'P') { gotoCase = 65; continue; };
     459            if (yych != 'p') { gotoCase = 43; continue; };
     460case 65:
     461            yych = this._charAt(++cursor);
     462            if (yych == 'T') { gotoCase = 66; continue; };
     463            if (yych != 't') { gotoCase = 43; continue; };
     464case 66:
     465            ++cursor;
     466            {
     467                    this.tokenType = "html-tag";
     468                    this._parseCondition = this._parseConditions.SCRIPT_ATTRIBUTE;
     469                    return cursor;
     470                }
     471case 68:
     472            yych = this._charAt(++cursor);
     473            if (yych == 'C') { gotoCase = 69; continue; };
     474            if (yych != 'c') { gotoCase = 43; continue; };
     475case 69:
     476            yych = this._charAt(++cursor);
     477            if (yych == 'R') { gotoCase = 70; continue; };
     478            if (yych != 'r') { gotoCase = 43; continue; };
     479case 70:
     480            yych = this._charAt(++cursor);
     481            if (yych == 'I') { gotoCase = 71; continue; };
     482            if (yych != 'i') { gotoCase = 43; continue; };
     483case 71:
     484            yych = this._charAt(++cursor);
     485            if (yych == 'P') { gotoCase = 72; continue; };
     486            if (yych != 'p') { gotoCase = 43; continue; };
     487case 72:
     488            yych = this._charAt(++cursor);
     489            if (yych == 'T') { gotoCase = 73; continue; };
     490            if (yych != 't') { gotoCase = 43; continue; };
     491case 73:
     492            ++cursor;
     493            {
     494                    this.tokenType = "html-tag";
     495                    this._parseCondition = this._parseConditions.INITIAL;
     496                    return cursor;
     497                }
     498case 75:
     499            ++cursor;
     500            yych = this._charAt(cursor);
     501case 76:
     502            if (yych <= '\f') {
     503                if (yych != '\n') { gotoCase = 75; continue; };
     504            } else {
     505                if (yych <= '\r') { gotoCase = 77; continue; };
     506                if (yych == '\'') { gotoCase = 79; continue; };
     507                { gotoCase = 75; continue; };
     508            }
     509case 77:
    400510            ++cursor;
    401511            this.setLexCondition(this._lexConditions.SSTRING);
    402512            { return this._stringToken(cursor); }
    403 case 65:
     513case 79:
    404514            ++cursor;
    405515            { return this._stringToken(cursor, true); }
    406 case 67:
    407             ++cursor;
    408             yych = this._charAt(cursor);
    409 case 68:
    410             if (yych <= '\f') {
    411                 if (yych != '\n') { gotoCase = 67; continue; };
    412             } else {
    413                 if (yych <= '\r') { gotoCase = 69; continue; };
    414                 if (yych == '"') { gotoCase = 65; continue; };
    415                 { gotoCase = 67; continue; };
    416             }
    417 case 69:
     516case 81:
     517            ++cursor;
     518            yych = this._charAt(cursor);
     519case 82:
     520            if (yych <= '\f') {
     521                if (yych != '\n') { gotoCase = 81; continue; };
     522            } else {
     523                if (yych <= '\r') { gotoCase = 83; continue; };
     524                if (yych == '"') { gotoCase = 79; continue; };
     525                { gotoCase = 81; continue; };
     526            }
     527case 83:
    418528            ++cursor;
    419529            this.setLexCondition(this._lexConditions.DSTRING);
     
    423533            yych = this._charAt(cursor);
    424534            if (yych <= '\f') {
    425                 if (yych == '\n') { gotoCase = 75; continue; };
    426                 { gotoCase = 74; continue; };
    427             } else {
    428                 if (yych <= '\r') { gotoCase = 75; continue; };
    429                 if (yych == '\'') { gotoCase = 77; continue; };
    430                 { gotoCase = 74; continue; };
    431             }
    432 case 73:
     535                if (yych == '\n') { gotoCase = 89; continue; };
     536                { gotoCase = 88; continue; };
     537            } else {
     538                if (yych <= '\r') { gotoCase = 89; continue; };
     539                if (yych == '\'') { gotoCase = 91; continue; };
     540                { gotoCase = 88; continue; };
     541            }
     542case 87:
    433543            { return this._stringToken(cursor); }
    434 case 74:
    435             yych = this._charAt(++cursor);
    436             { gotoCase = 81; continue; };
    437 case 75:
     544case 88:
     545            yych = this._charAt(++cursor);
     546            { gotoCase = 95; continue; };
     547case 89:
    438548            ++cursor;
    439549            { this.tokenType = null; return cursor; }
    440 case 77:
    441             ++cursor;
    442 case 78:
     550case 91:
     551            ++cursor;
     552case 92:
    443553            this.setLexCondition(this._lexConditions.INITIAL);
    444554            { return this._stringToken(cursor, true); }
    445 case 79:
    446             yych = this._charAt(++cursor);
    447             { gotoCase = 78; continue; };
    448 case 80:
    449             ++cursor;
    450             yych = this._charAt(cursor);
    451 case 81:
    452             if (yych <= '\f') {
    453                 if (yych == '\n') { gotoCase = 73; continue; };
    454                 { gotoCase = 80; continue; };
    455             } else {
    456                 if (yych <= '\r') { gotoCase = 73; continue; };
    457                 if (yych == '\'') { gotoCase = 79; continue; };
    458                 { gotoCase = 80; continue; };
     555case 93:
     556            yych = this._charAt(++cursor);
     557            { gotoCase = 92; continue; };
     558case 94:
     559            ++cursor;
     560            yych = this._charAt(cursor);
     561case 95:
     562            if (yych <= '\f') {
     563                if (yych == '\n') { gotoCase = 87; continue; };
     564                { gotoCase = 94; continue; };
     565            } else {
     566                if (yych <= '\r') { gotoCase = 87; continue; };
     567                if (yych == '\'') { gotoCase = 93; continue; };
     568                { gotoCase = 94; continue; };
    459569            }
    460570        }
  • trunk/WebCore/inspector/front-end/SourceHTMLTokenizer.re2js

    r53846 r53916  
    5757        ATTRIBUTE: 2,
    5858        ATTRIBUTE_VALUE: 3,
    59         DOCTYPE: 4
     59        SCRIPT: 4,
     60        SCRIPT_ATTRIBUTE: 5,
     61        SCRIPT_ATTRIBUTE_VALUE: 6,
     62        DOCTYPE: 7
    6063    };
    6164
     
    6972
    7073WebInspector.SourceHTMLTokenizer.prototype = {
     74    _isAttribute: function()
     75    {
     76        return this._parseCondition === this._parseConditions.ATTRIBUTE || this._parseCondition === this._parseConditions.SCRIPT_ATTRIBUTE;
     77    },
     78
     79    _isAttributeValue: function()
     80    {
     81        return this._parseCondition === this._parseConditions.ATTRIBUTE_VALUE || this._parseCondition === this._parseConditions.SCRIPT_ATTRIBUTE_VALUE;
     82    },
     83
     84    _setAttributeValue: function()
     85    {
     86        if (this._parseCondition === this._parseConditions.ATTRIBUTE)
     87            this._parseCondition = this._parseConditions.ATTRIBUTE_VALUE;
     88        else if (this._parseCondition === this._parseConditions.SCRIPT_ATTRIBUTE)
     89            this._parseCondition = this._parseConditions.SCRIPT_ATTRIBUTE_VALUE;
     90    },
     91
     92    _setAttribute: function()
     93    {
     94        if (this._parseCondition === this._parseConditions.ATTRIBUTE_VALUE)
     95            this._parseCondition = this._parseConditions.ATTRIBUTE;
     96        else if (this._parseCondition === this._parseConditions.SCRIPT_ATTRIBUTE_VALUE)
     97            this._parseCondition = this._parseConditions.SCRIPT_ATTRIBUTE;
     98    },
     99
    71100    _stringToken: function(cursor, stringEnds)
    72101    {
    73         if (this._parseCondition === this._parseConditions.ATTRIBUTE_VALUE) {
     102        if (this._isAttributeValue()) {
    74103            this.tokenType = "html-attr-value";
    75104            if (stringEnds)
    76                 this._parseCondition = this._parseConditions.ATTRIBUTE;
     105                this._setAttribute();
    77106        } else if (this._parseCondition === this._parseConditions.DOCTYPE)
    78107            this.tokenType = "html-doctype";
     
    106135                CommentEnd = CommentContent "-->";
    107136
     137                DocTypeLT = "<!" [Dd] [Oo] [Cc] [Tt] [Yy] [Pp] [Ee];
     138                ScriptStart = "<" [Ss] [Cc] [Rr] [Ii] [Pp] [Tt];
     139                ScriptEnd = "</" [Ss] [Cc] [Rr] [Ii] [Pp] [Tt];
     140
    108141                LT = "<" | "</";
    109                 DocTypeLT = "<!" [Dd] [Oo] [Cc] [Tt] [Yy] [Pp] [Ee];
    110142                GT = ">";
    111143                EqualSign = "=";
    112 
    113                 Letter = [_a-zA-Z\x80-\xFF];
    114144
    115145                DoubleStringContent = [^\r\n\"]*;
     
    121151                SingleStringEnd = SingleStringContent "'";
    122152
    123                 Identifier = Letter+;
     153                Identifier = [_a-zA-Z\x80-\xFF]+;
    124154
    125155                <INITIAL> Comment { this.tokenType = "html-comment"; return cursor; }
     
    130160                <INITIAL> DocTypeLT => INITIAL
    131161                {
    132                     var token = this._line.substring(cursorOnEnter, cursor);
    133162                    this.tokenType = "html-doctype";
    134163                    this._parseCondition = this._parseConditions.DOCTYPE;
     
    136165                }
    137166
     167                <INITIAL> ScriptStart => INITIAL
     168                {
     169                    this.tokenType = "html-tag";
     170                    this._parseCondition = this._parseConditions.SCRIPT_ATTRIBUTE;
     171                    return cursor;
     172                }
     173
     174                <INITIAL> ScriptEnd => INITIAL
     175                {
     176                    this.tokenType = "html-tag";
     177                    this._parseCondition = this._parseConditions.INITIAL;
     178                    return cursor;
     179                }
     180
    138181                <INITIAL> LT => INITIAL
    139182                {
     183                    if (this._parseCondition === this._parseConditions.SCRIPT) {
     184                        this.tokenType = null;
     185                        return cursor;
     186                    }
     187
    140188                    this.tokenType = "html-tag";
    141189                    this._parseCondition = this._parseConditions.TAG;
     
    145193                <INITIAL> GT => INITIAL
    146194                {
     195                    if (this._parseCondition === this._parseConditions.SCRIPT) {
     196                        this.tokenType = null;
     197                        return cursor;
     198                    }
     199
    147200                    if (this._parseCondition === this._parseConditions.DOCTYPE)
    148201                        this.tokenType = "html-doctype";
    149202                    else
    150203                        this.tokenType = "html-tag";
    151                     this._parseCondition = this._parseConditions.INITIAL;
     204
     205                    if (this._parseCondition === this._parseConditions.SCRIPT_ATTRIBUTE)
     206                        this._parseCondition = this._parseConditions.SCRIPT;
     207                    else
     208                        this._parseCondition = this._parseConditions.INITIAL;
    152209                    return cursor;
    153210                }
     
    163220                <INITIAL> EqualSign => INITIAL
    164221                {
    165                     if (this._parseCondition === this._parseConditions.ATTRIBUTE) {
    166                         this.tokenType = null;
    167                         this._parseCondition = this._parseConditions.ATTRIBUTE_VALUE;
     222                    if (this._isAttribute()) {
     223                        this.tokenType = null;
     224                        this._setAttributeValue();
    168225                    } else if (this._parseCondition === this._parseConditions.DOCTYPE)
    169226                        this.tokenType = "html-doctype";
     
    175232                <INITIAL> Identifier
    176233                {
     234                    if (this._parseCondition === this._parseConditions.SCRIPT) {
     235                        this.tokenType = null;
     236                        return cursor;
     237                    }
     238
    177239                    if (this._parseCondition === this._parseConditions.TAG) {
    178240                        this.tokenType = "html-tag";
    179241                        this._parseCondition = this._parseConditions.ATTRIBUTE;
    180                     } else if (this._parseCondition === this._parseConditions.ATTRIBUTE) {
     242                    } else if (this._isAttribute())
    181243                        this.tokenType = "html-attr-name";
    182                         this._parseCondition = this._parseConditions.ATTRIBUTE;
    183                     } else if (this._parseCondition === this._parseConditions.ATTRIBUTE_VALUE) {
     244                    else if (this._isAttributeValue())
    184245                        this.tokenType = "html-attr-value";
    185                         this._parseCondition = this._parseConditions.ATTRIBUTE;
    186                     } else if (this._parseCondition === this._parseConditions.DOCTYPE)
     246                    else if (this._parseCondition === this._parseConditions.DOCTYPE)
    187247                        this.tokenType = "html-doctype";
    188248                    else
Note: See TracChangeset for help on using the changeset viewer.