summaryrefslogtreecommitdiffstats
path: root/WebCore/inspector/front-end/SourceHTMLTokenizer.js
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/inspector/front-end/SourceHTMLTokenizer.js')
-rw-r--r--WebCore/inspector/front-end/SourceHTMLTokenizer.js648
1 files changed, 355 insertions, 293 deletions
diff --git a/WebCore/inspector/front-end/SourceHTMLTokenizer.js b/WebCore/inspector/front-end/SourceHTMLTokenizer.js
index 1212ffe..8856ff5 100644
--- a/WebCore/inspector/front-end/SourceHTMLTokenizer.js
+++ b/WebCore/inspector/front-end/SourceHTMLTokenizer.js
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.13.5 on Thu Jan 28 20:49:22 2010 */
+/* Generated by re2c 0.13.5 on Tue Feb 2 00:44:38 2010 */
/*
* Copyright (C) 2009 Google Inc. All rights reserved.
*
@@ -45,72 +45,81 @@ WebInspector.SourceHTMLTokenizer = function()
{
WebInspector.SourceTokenizer.call(this);
+ // The order is determined by the generated code.
this._lexConditions = {
INITIAL: 0,
COMMENT: 1,
- DSTRING: 2,
- SSTRING: 3
+ DOCTYPE: 2,
+ TAG: 3,
+ DSTRING: 4,
+ SSTRING: 5
};
+ this.case_INITIAL = 1000;
+ this.case_COMMENT = 1001;
+ this.case_DOCTYPE = 1002;
+ this.case_TAG = 1003;
+ this.case_DSTRING = 1004;
+ this.case_SSTRING = 1005;
this._parseConditions = {
INITIAL: 0,
- TAG: 1,
- ATTRIBUTE: 2,
- ATTRIBUTE_VALUE: 3,
- SCRIPT: 4,
- SCRIPT_ATTRIBUTE: 5,
- SCRIPT_ATTRIBUTE_VALUE: 6,
- DOCTYPE: 7
+ ATTRIBUTE: 1,
+ ATTRIBUTE_VALUE: 2,
+ LINKIFY: 4,
+ A_NODE: 8,
+ SCRIPT: 16
};
- this.case_INITIAL = 1000;
- this.case_COMMENT = 1001;
- this.case_DSTRING = 1002;
- this.case_SSTRING = 1003;
-
this.initialCondition = { lexCondition: this._lexConditions.INITIAL, parseCondition: this._parseConditions.INITIAL };
}
WebInspector.SourceHTMLTokenizer.prototype = {
- _isAttribute: function()
+ _isExpectingAttribute: function()
{
- return this._parseCondition === this._parseConditions.ATTRIBUTE || this._parseCondition === this._parseConditions.SCRIPT_ATTRIBUTE;
+ return this._parseCondition & this._parseConditions.ATTRIBUTE;
},
- _isAttributeValue: function()
+ _isExpectingAttributeValue: function()
{
- return this._parseCondition === this._parseConditions.ATTRIBUTE_VALUE || this._parseCondition === this._parseConditions.SCRIPT_ATTRIBUTE_VALUE;
+ return this._parseCondition & this._parseConditions.ATTRIBUTE_VALUE;
},
- _setAttributeValue: function()
+ _setExpectingAttribute: function()
{
- if (this._parseCondition === this._parseConditions.ATTRIBUTE)
- this._parseCondition = this._parseConditions.ATTRIBUTE_VALUE;
- else if (this._parseCondition === this._parseConditions.SCRIPT_ATTRIBUTE)
- this._parseCondition = this._parseConditions.SCRIPT_ATTRIBUTE_VALUE;
+ if (this._isExpectingAttributeValue())
+ this._parseCondition ^= this._parseConditions.ATTRIBUTE_VALUE;
+ this._parseCondition |= this._parseConditions.ATTRIBUTE;
},
- _setAttribute: function()
+ _setExpectingAttributeValue: function()
{
- if (this._parseCondition === this._parseConditions.ATTRIBUTE_VALUE)
- this._parseCondition = this._parseConditions.ATTRIBUTE;
- else if (this._parseCondition === this._parseConditions.SCRIPT_ATTRIBUTE_VALUE)
- this._parseCondition = this._parseConditions.SCRIPT_ATTRIBUTE;
+ if (this._isExpectingAttribute())
+ this._parseCondition ^= this._parseConditions.ATTRIBUTE;
+ this._parseCondition |= this._parseConditions.ATTRIBUTE_VALUE;
},
_stringToken: function(cursor, stringEnds)
{
- if (this._isAttributeValue()) {
- this.tokenType = "html-attr-value";
- if (stringEnds)
- this._setAttribute();
- } else if (this._parseCondition === this._parseConditions.DOCTYPE)
- this.tokenType = "html-doctype";
- else
+ if (!this._isExpectingAttributeValue()) {
this.tokenType = null;
+ return cursor;
+ }
+ this.tokenType = this._attrValueTokenType();
+ if (stringEnds)
+ this._setExpectingAttribute();
return cursor;
},
+ _attrValueTokenType: function()
+ {
+ if (this._parseCondition & this._parseConditions.LINKIFY) {
+ if (this._parseCondition & this._parseConditions.A_NODE)
+ return "html-external-link";
+ return "html-resource-link";
+ }
+ return "html-attribute-value";
+ },
+
nextToken: function(cursor)
{
var cursorOnEnter = cursor;
@@ -122,17 +131,25 @@ WebInspector.SourceHTMLTokenizer.prototype = {
{
case 1: var yych;
var yyaccept = 0;
- if (this.getLexCondition() < 2) {
+ if (this.getLexCondition() < 3) {
if (this.getLexCondition() < 1) {
{ gotoCase = this.case_INITIAL; continue; };
} else {
- { gotoCase = this.case_COMMENT; continue; };
+ if (this.getLexCondition() < 2) {
+ { gotoCase = this.case_COMMENT; continue; };
+ } else {
+ { gotoCase = this.case_DOCTYPE; continue; };
+ }
}
} else {
- if (this.getLexCondition() < 3) {
- { gotoCase = this.case_DSTRING; continue; };
+ if (this.getLexCondition() < 4) {
+ { gotoCase = this.case_TAG; continue; };
} else {
- { gotoCase = this.case_SSTRING; continue; };
+ if (this.getLexCondition() < 5) {
+ { gotoCase = this.case_DSTRING; continue; };
+ } else {
+ { gotoCase = this.case_SSTRING; continue; };
+ }
}
}
/* *********************************** */
@@ -193,393 +210,438 @@ case 12:
{ gotoCase = 5; continue; };
}
/* *********************************** */
-case this.case_DSTRING:
+case this.case_DOCTYPE:
yych = this._charAt(cursor);
if (yych <= '\f') {
if (yych == '\n') { gotoCase = 18; continue; };
{ gotoCase = 17; continue; };
} else {
if (yych <= '\r') { gotoCase = 18; continue; };
- if (yych == '"') { gotoCase = 20; continue; };
+ if (yych == '>') { gotoCase = 20; continue; };
{ gotoCase = 17; continue; };
}
case 16:
- { return this._stringToken(cursor); }
+ { this.tokenType = "html-doctype"; return cursor; }
case 17:
yych = this._charAt(++cursor);
- { gotoCase = 24; continue; };
+ { gotoCase = 23; continue; };
case 18:
++cursor;
{ this.tokenType = null; return cursor; }
case 20:
++cursor;
-case 21:
this.setLexCondition(this._lexConditions.INITIAL);
- { return this._stringToken(cursor, true); }
+ { this.tokenType = "html-doctype"; return cursor; }
case 22:
- yych = this._charAt(++cursor);
- { gotoCase = 21; continue; };
-case 23:
++cursor;
yych = this._charAt(cursor);
-case 24:
+case 23:
if (yych <= '\f') {
if (yych == '\n') { gotoCase = 16; continue; };
- { gotoCase = 23; continue; };
+ { gotoCase = 22; continue; };
} else {
if (yych <= '\r') { gotoCase = 16; continue; };
- if (yych == '"') { gotoCase = 22; continue; };
- { gotoCase = 23; continue; };
+ if (yych == '>') { gotoCase = 16; continue; };
+ { gotoCase = 22; continue; };
}
/* *********************************** */
-case this.case_INITIAL:
+case this.case_DSTRING:
yych = this._charAt(cursor);
- if (yych <= '=') {
- if (yych <= '\'') {
- if (yych == '"') { gotoCase = 29; continue; };
- if (yych >= '\'') { gotoCase = 30; continue; };
- } else {
- if (yych <= '9') {
- if (yych >= '0') { gotoCase = 31; continue; };
- } else {
- if (yych <= ';') { gotoCase = 27; continue; };
- if (yych <= '<') { gotoCase = 33; continue; };
- { gotoCase = 35; continue; };
- }
- }
+ if (yych <= '\f') {
+ if (yych == '\n') { gotoCase = 28; continue; };
+ { gotoCase = 27; continue; };
} else {
- if (yych <= '^') {
- if (yych <= '>') { gotoCase = 37; continue; };
- if (yych <= '@') { gotoCase = 27; continue; };
- if (yych <= 'Z') { gotoCase = 31; continue; };
- } else {
- if (yych <= '`') {
- if (yych <= '_') { gotoCase = 31; continue; };
- } else {
- if (yych <= 'z') { gotoCase = 31; continue; };
- if (yych >= 0x80) { gotoCase = 31; continue; };
- }
- }
+ if (yych <= '\r') { gotoCase = 28; continue; };
+ if (yych == '"') { gotoCase = 30; continue; };
+ { gotoCase = 27; continue; };
}
+case 26:
+ { return this._stringToken(cursor); }
case 27:
- ++cursor;
+ yych = this._charAt(++cursor);
+ { gotoCase = 34; continue; };
case 28:
+ ++cursor;
{ this.tokenType = null; return cursor; }
-case 29:
- yyaccept = 0;
- yych = this._charAt(YYMARKER = ++cursor);
- { gotoCase = 82; continue; };
case 30:
- yyaccept = 0;
- yych = this._charAt(YYMARKER = ++cursor);
- { gotoCase = 76; continue; };
-case 31:
++cursor;
- yych = this._charAt(cursor);
- { gotoCase = 74; continue; };
+case 31:
+ this.setLexCondition(this._lexConditions.TAG);
+ { return this._stringToken(cursor, true); }
case 32:
- {
- if (this._parseCondition === this._parseConditions.SCRIPT) {
- this.tokenType = null;
- return cursor;
- }
-
- if (this._parseCondition === this._parseConditions.TAG) {
- this.tokenType = "html-tag";
- this._parseCondition = this._parseConditions.ATTRIBUTE;
- } else if (this._isAttribute())
- this.tokenType = "html-attr-name";
- else if (this._isAttributeValue())
- this.tokenType = "html-attr-value";
- else if (this._parseCondition === this._parseConditions.DOCTYPE)
- this.tokenType = "html-doctype";
- else
- this.tokenType = null;
- return cursor;
- }
+ yych = this._charAt(++cursor);
+ { gotoCase = 31; continue; };
case 33:
- yyaccept = 1;
+ ++cursor;
+ yych = this._charAt(cursor);
+case 34:
+ if (yych <= '\f') {
+ if (yych == '\n') { gotoCase = 26; continue; };
+ { gotoCase = 33; continue; };
+ } else {
+ if (yych <= '\r') { gotoCase = 26; continue; };
+ if (yych == '"') { gotoCase = 32; continue; };
+ { gotoCase = 33; continue; };
+ }
+/* *********************************** */
+case this.case_INITIAL:
+ yych = this._charAt(cursor);
+ if (yych == '<') { gotoCase = 39; continue; };
+ ++cursor;
+ { this.tokenType = null; return cursor; }
+case 39:
+ yyaccept = 0;
yych = this._charAt(YYMARKER = ++cursor);
if (yych <= '/') {
- if (yych == '!') { gotoCase = 42; continue; };
- if (yych >= '/') { gotoCase = 39; continue; };
+ if (yych == '!') { gotoCase = 44; continue; };
+ if (yych >= '/') { gotoCase = 41; continue; };
} else {
if (yych <= 'S') {
- if (yych >= 'S') { gotoCase = 40; continue; };
+ if (yych >= 'S') { gotoCase = 42; continue; };
} else {
- if (yych == 's') { gotoCase = 40; continue; };
+ if (yych == 's') { gotoCase = 42; continue; };
}
}
-case 34:
+case 40:
+ this.setLexCondition(this._lexConditions.TAG);
{
- if (this._parseCondition === this._parseConditions.SCRIPT) {
+ if (this._parseCondition & this._parseConditions.SCRIPT) {
+ // Do not tokenize script tag contents, keep lexer state although processing "<".
+ this.setLexCondition(this._lexConditions.INITIAL);
this.tokenType = null;
return cursor;
}
+ this._parseCondition = this._parseConditions.INITIAL;
this.tokenType = "html-tag";
- this._parseCondition = this._parseConditions.TAG;
- return cursor;
- }
-case 35:
- ++cursor;
- {
- if (this._isAttribute()) {
- this.tokenType = null;
- this._setAttributeValue();
- } else if (this._parseCondition === this._parseConditions.DOCTYPE)
- this.tokenType = "html-doctype";
- else
- this.tokenType = null;
- return cursor;
- }
-case 37:
- ++cursor;
- {
- if (this._parseCondition === this._parseConditions.SCRIPT) {
- this.tokenType = null;
- return cursor;
- }
-
- if (this._parseCondition === this._parseConditions.DOCTYPE)
- this.tokenType = "html-doctype";
- else
- this.tokenType = "html-tag";
-
- if (this._parseCondition === this._parseConditions.SCRIPT_ATTRIBUTE)
- this._parseCondition = this._parseConditions.SCRIPT;
- else
- this._parseCondition = this._parseConditions.INITIAL;
return cursor;
}
-case 39:
- yyaccept = 1;
+case 41:
+ yyaccept = 0;
yych = this._charAt(YYMARKER = ++cursor);
- if (yych == 'S') { gotoCase = 66; continue; };
- if (yych == 's') { gotoCase = 66; continue; };
- { gotoCase = 34; continue; };
-case 40:
+ if (yych == 'S') { gotoCase = 68; continue; };
+ if (yych == 's') { gotoCase = 68; continue; };
+ { gotoCase = 40; continue; };
+case 42:
yych = this._charAt(++cursor);
- if (yych == 'C') { gotoCase = 60; continue; };
- if (yych == 'c') { gotoCase = 60; continue; };
-case 41:
+ if (yych == 'C') { gotoCase = 62; continue; };
+ if (yych == 'c') { gotoCase = 62; continue; };
+case 43:
cursor = YYMARKER;
- if (yyaccept <= 0) {
- { gotoCase = 28; continue; };
- } else {
- { gotoCase = 34; continue; };
- }
-case 42:
+ { gotoCase = 40; continue; };
+case 44:
yych = this._charAt(++cursor);
if (yych <= 'C') {
- if (yych != '-') { gotoCase = 41; continue; };
+ if (yych != '-') { gotoCase = 43; continue; };
} else {
- if (yych <= 'D') { gotoCase = 44; continue; };
- if (yych == 'd') { gotoCase = 44; continue; };
- { gotoCase = 41; continue; };
+ if (yych <= 'D') { gotoCase = 46; continue; };
+ if (yych == 'd') { gotoCase = 46; continue; };
+ { gotoCase = 43; continue; };
}
yych = this._charAt(++cursor);
- if (yych == '-') { gotoCase = 52; continue; };
- { gotoCase = 41; continue; };
-case 44:
- yych = this._charAt(++cursor);
- if (yych == 'O') { gotoCase = 45; continue; };
- if (yych != 'o') { gotoCase = 41; continue; };
-case 45:
- yych = this._charAt(++cursor);
- if (yych == 'C') { gotoCase = 46; continue; };
- if (yych != 'c') { gotoCase = 41; continue; };
+ if (yych == '-') { gotoCase = 54; continue; };
+ { gotoCase = 43; continue; };
case 46:
yych = this._charAt(++cursor);
- if (yych == 'T') { gotoCase = 47; continue; };
- if (yych != 't') { gotoCase = 41; continue; };
+ if (yych == 'O') { gotoCase = 47; continue; };
+ if (yych != 'o') { gotoCase = 43; continue; };
case 47:
yych = this._charAt(++cursor);
- if (yych == 'Y') { gotoCase = 48; continue; };
- if (yych != 'y') { gotoCase = 41; continue; };
+ if (yych == 'C') { gotoCase = 48; continue; };
+ if (yych != 'c') { gotoCase = 43; continue; };
case 48:
yych = this._charAt(++cursor);
- if (yych == 'P') { gotoCase = 49; continue; };
- if (yych != 'p') { gotoCase = 41; continue; };
+ if (yych == 'T') { gotoCase = 49; continue; };
+ if (yych != 't') { gotoCase = 43; continue; };
case 49:
yych = this._charAt(++cursor);
- if (yych == 'E') { gotoCase = 50; continue; };
- if (yych != 'e') { gotoCase = 41; continue; };
+ if (yych == 'Y') { gotoCase = 50; continue; };
+ if (yych != 'y') { gotoCase = 43; continue; };
case 50:
- ++cursor;
- {
- this.tokenType = "html-doctype";
- this._parseCondition = this._parseConditions.DOCTYPE;
- return cursor;
- }
+ yych = this._charAt(++cursor);
+ if (yych == 'P') { gotoCase = 51; continue; };
+ if (yych != 'p') { gotoCase = 43; continue; };
+case 51:
+ yych = this._charAt(++cursor);
+ if (yych == 'E') { gotoCase = 52; continue; };
+ if (yych != 'e') { gotoCase = 43; continue; };
case 52:
++cursor;
+ this.setLexCondition(this._lexConditions.DOCTYPE);
+ { this.tokenType = "html-doctype"; return cursor; }
+case 54:
+ ++cursor;
yych = this._charAt(cursor);
if (yych <= '\f') {
- if (yych == '\n') { gotoCase = 55; continue; };
- { gotoCase = 52; continue; };
+ if (yych == '\n') { gotoCase = 57; continue; };
+ { gotoCase = 54; continue; };
} else {
- if (yych <= '\r') { gotoCase = 55; continue; };
- if (yych != '-') { gotoCase = 52; continue; };
+ if (yych <= '\r') { gotoCase = 57; continue; };
+ if (yych != '-') { gotoCase = 54; continue; };
}
++cursor;
yych = this._charAt(cursor);
- if (yych == '-') { gotoCase = 57; continue; };
- { gotoCase = 41; continue; };
-case 55:
+ if (yych == '-') { gotoCase = 59; continue; };
+ { gotoCase = 43; continue; };
+case 57:
++cursor;
this.setLexCondition(this._lexConditions.COMMENT);
{ this.tokenType = "html-comment"; return cursor; }
-case 57:
+case 59:
++cursor;
yych = this._charAt(cursor);
- if (yych != '>') { gotoCase = 52; continue; };
+ if (yych != '>') { gotoCase = 54; continue; };
++cursor;
{ this.tokenType = "html-comment"; return cursor; }
-case 60:
- yych = this._charAt(++cursor);
- if (yych == 'R') { gotoCase = 61; continue; };
- if (yych != 'r') { gotoCase = 41; continue; };
-case 61:
- yych = this._charAt(++cursor);
- if (yych == 'I') { gotoCase = 62; continue; };
- if (yych != 'i') { gotoCase = 41; continue; };
case 62:
yych = this._charAt(++cursor);
- if (yych == 'P') { gotoCase = 63; continue; };
- if (yych != 'p') { gotoCase = 41; continue; };
+ if (yych == 'R') { gotoCase = 63; continue; };
+ if (yych != 'r') { gotoCase = 43; continue; };
case 63:
yych = this._charAt(++cursor);
- if (yych == 'T') { gotoCase = 64; continue; };
- if (yych != 't') { gotoCase = 41; continue; };
+ if (yych == 'I') { gotoCase = 64; continue; };
+ if (yych != 'i') { gotoCase = 43; continue; };
case 64:
+ yych = this._charAt(++cursor);
+ if (yych == 'P') { gotoCase = 65; continue; };
+ if (yych != 'p') { gotoCase = 43; continue; };
+case 65:
+ yych = this._charAt(++cursor);
+ if (yych == 'T') { gotoCase = 66; continue; };
+ if (yych != 't') { gotoCase = 43; continue; };
+case 66:
++cursor;
+ this.setLexCondition(this._lexConditions.TAG);
{
this.tokenType = "html-tag";
- this._parseCondition = this._parseConditions.SCRIPT_ATTRIBUTE;
+ this._parseCondition = this._parseConditions.SCRIPT;
+ this._setExpectingAttribute();
return cursor;
}
-case 66:
- yych = this._charAt(++cursor);
- if (yych == 'C') { gotoCase = 67; continue; };
- if (yych != 'c') { gotoCase = 41; continue; };
-case 67:
- yych = this._charAt(++cursor);
- if (yych == 'R') { gotoCase = 68; continue; };
- if (yych != 'r') { gotoCase = 41; continue; };
case 68:
yych = this._charAt(++cursor);
- if (yych == 'I') { gotoCase = 69; continue; };
- if (yych != 'i') { gotoCase = 41; continue; };
+ if (yych == 'C') { gotoCase = 69; continue; };
+ if (yych != 'c') { gotoCase = 43; continue; };
case 69:
yych = this._charAt(++cursor);
- if (yych == 'P') { gotoCase = 70; continue; };
- if (yych != 'p') { gotoCase = 41; continue; };
+ if (yych == 'R') { gotoCase = 70; continue; };
+ if (yych != 'r') { gotoCase = 43; continue; };
case 70:
yych = this._charAt(++cursor);
- if (yych == 'T') { gotoCase = 71; continue; };
- if (yych != 't') { gotoCase = 41; continue; };
+ if (yych == 'I') { gotoCase = 71; continue; };
+ if (yych != 'i') { gotoCase = 43; continue; };
case 71:
+ yych = this._charAt(++cursor);
+ if (yych == 'P') { gotoCase = 72; continue; };
+ if (yych != 'p') { gotoCase = 43; continue; };
+case 72:
+ yych = this._charAt(++cursor);
+ if (yych == 'T') { gotoCase = 73; continue; };
+ if (yych != 't') { gotoCase = 43; continue; };
+case 73:
++cursor;
+ this.setLexCondition(this._lexConditions.TAG);
{
this.tokenType = "html-tag";
this._parseCondition = this._parseConditions.INITIAL;
return cursor;
}
-case 73:
+/* *********************************** */
+case this.case_SSTRING:
+ yych = this._charAt(cursor);
+ if (yych <= '\f') {
+ if (yych == '\n') { gotoCase = 79; continue; };
+ { gotoCase = 78; continue; };
+ } else {
+ if (yych <= '\r') { gotoCase = 79; continue; };
+ if (yych == '\'') { gotoCase = 81; continue; };
+ { gotoCase = 78; continue; };
+ }
+case 77:
+ { return this._stringToken(cursor); }
+case 78:
+ yych = this._charAt(++cursor);
+ { gotoCase = 85; continue; };
+case 79:
+ ++cursor;
+ { this.tokenType = null; return cursor; }
+case 81:
+ ++cursor;
+case 82:
+ this.setLexCondition(this._lexConditions.TAG);
+ { return this._stringToken(cursor, true); }
+case 83:
+ yych = this._charAt(++cursor);
+ { gotoCase = 82; continue; };
+case 84:
++cursor;
yych = this._charAt(cursor);
-case 74:
- if (yych <= '^') {
- if (yych <= '9') {
- if (yych <= '/') { gotoCase = 32; continue; };
- { gotoCase = 73; continue; };
+case 85:
+ if (yych <= '\f') {
+ if (yych == '\n') { gotoCase = 77; continue; };
+ { gotoCase = 84; continue; };
+ } else {
+ if (yych <= '\r') { gotoCase = 77; continue; };
+ if (yych == '\'') { gotoCase = 83; continue; };
+ { gotoCase = 84; continue; };
+ }
+/* *********************************** */
+case this.case_TAG:
+ yych = this._charAt(cursor);
+ if (yych <= '&') {
+ if (yych <= '\r') {
+ if (yych == '\n') { gotoCase = 90; continue; };
+ if (yych >= '\r') { gotoCase = 90; continue; };
} else {
- if (yych <= '@') { gotoCase = 32; continue; };
- if (yych <= 'Z') { gotoCase = 73; continue; };
- { gotoCase = 32; continue; };
+ if (yych <= ' ') {
+ if (yych >= ' ') { gotoCase = 90; continue; };
+ } else {
+ if (yych == '"') { gotoCase = 92; continue; };
+ }
}
} else {
- if (yych <= '`') {
- if (yych <= '_') { gotoCase = 73; continue; };
- { gotoCase = 32; continue; };
+ if (yych <= '>') {
+ if (yych <= ';') {
+ if (yych <= '\'') { gotoCase = 93; continue; };
+ } else {
+ if (yych <= '<') { gotoCase = 90; continue; };
+ if (yych <= '=') { gotoCase = 94; continue; };
+ { gotoCase = 96; continue; };
+ }
} else {
- if (yych <= 'z') { gotoCase = 73; continue; };
- if (yych <= 0x7F) { gotoCase = 32; continue; };
- { gotoCase = 73; continue; };
+ if (yych <= '[') {
+ if (yych >= '[') { gotoCase = 90; continue; };
+ } else {
+ if (yych == ']') { gotoCase = 90; continue; };
+ }
}
}
-case 75:
++cursor;
yych = this._charAt(cursor);
-case 76:
+ { gotoCase = 109; continue; };
+case 89:
+ {
+ if (this._parseCondition === this._parseConditions.SCRIPT) {
+ // Fall through if expecting attributes.
+ this.tokenType = null;
+ return cursor;
+ }
+
+ if (this._parseCondition === this._parseConditions.INITIAL) {
+ this.tokenType = "html-tag";
+ this._setExpectingAttribute();
+ var token = this._line.substring(cursorOnEnter, cursor);
+ if (token === "a")
+ this._parseCondition |= this._parseConditions.A_NODE;
+ else if (this._parseCondition & this._parseConditions.A_NODE)
+ this._parseCondition ^= this._parseConditions.A_NODE;
+ } else if (this._isExpectingAttribute()) {
+ var token = this._line.substring(cursorOnEnter, cursor);
+ if (token === "href" || token === "src")
+ this._parseCondition |= this._parseConditions.LINKIFY;
+ else if (this._parseCondition |= this._parseConditions.LINKIFY)
+ this._parseCondition ^= this._parseConditions.LINKIFY;
+ this.tokenType = "html-attribute-name";
+ } else if (this._isExpectingAttributeValue())
+ this.tokenType = this._attrValueTokenType();
+ else
+ this.tokenType = null;
+ return cursor;
+ }
+case 90:
+ ++cursor;
+ { this.tokenType = null; return cursor; }
+case 92:
+ yyaccept = 0;
+ yych = this._charAt(YYMARKER = ++cursor);
+ { gotoCase = 105; continue; };
+case 93:
+ yyaccept = 0;
+ yych = this._charAt(YYMARKER = ++cursor);
+ { gotoCase = 99; continue; };
+case 94:
+ ++cursor;
+ {
+ if (this._isExpectingAttribute())
+ this._setExpectingAttributeValue();
+ this.tokenType = null;
+ return cursor;
+ }
+case 96:
+ ++cursor;
+ this.setLexCondition(this._lexConditions.INITIAL);
+ {
+ if (this._parseCondition & this._parseConditions.SCRIPT) {
+ // Do not tokenize script tag contents.
+ this.tokenType = null;
+ return cursor;
+ }
+
+ this._parseCondition = this._parseConditions.INITIAL;
+ this.tokenType = "html-tag";
+ return cursor;
+ }
+case 98:
+ ++cursor;
+ yych = this._charAt(cursor);
+case 99:
if (yych <= '\f') {
- if (yych != '\n') { gotoCase = 75; continue; };
+ if (yych != '\n') { gotoCase = 98; continue; };
} else {
- if (yych <= '\r') { gotoCase = 77; continue; };
- if (yych == '\'') { gotoCase = 79; continue; };
- { gotoCase = 75; continue; };
+ if (yych <= '\r') { gotoCase = 100; continue; };
+ if (yych == '\'') { gotoCase = 102; continue; };
+ { gotoCase = 98; continue; };
}
-case 77:
+case 100:
++cursor;
this.setLexCondition(this._lexConditions.SSTRING);
{ return this._stringToken(cursor); }
-case 79:
+case 102:
++cursor;
{ return this._stringToken(cursor, true); }
-case 81:
+case 104:
++cursor;
yych = this._charAt(cursor);
-case 82:
+case 105:
if (yych <= '\f') {
- if (yych != '\n') { gotoCase = 81; continue; };
+ if (yych != '\n') { gotoCase = 104; continue; };
} else {
- if (yych <= '\r') { gotoCase = 83; continue; };
- if (yych == '"') { gotoCase = 79; continue; };
- { gotoCase = 81; continue; };
+ if (yych <= '\r') { gotoCase = 106; continue; };
+ if (yych == '"') { gotoCase = 102; continue; };
+ { gotoCase = 104; continue; };
}
-case 83:
+case 106:
++cursor;
this.setLexCondition(this._lexConditions.DSTRING);
{ return this._stringToken(cursor); }
-/* *********************************** */
-case this.case_SSTRING:
- yych = this._charAt(cursor);
- if (yych <= '\f') {
- if (yych == '\n') { gotoCase = 89; continue; };
- { gotoCase = 88; continue; };
- } else {
- if (yych <= '\r') { gotoCase = 89; continue; };
- if (yych == '\'') { gotoCase = 91; continue; };
- { gotoCase = 88; continue; };
- }
-case 87:
- { return this._stringToken(cursor); }
-case 88:
- yych = this._charAt(++cursor);
- { gotoCase = 95; continue; };
-case 89:
- ++cursor;
- { this.tokenType = null; return cursor; }
-case 91:
- ++cursor;
-case 92:
- this.setLexCondition(this._lexConditions.INITIAL);
- { return this._stringToken(cursor, true); }
-case 93:
- yych = this._charAt(++cursor);
- { gotoCase = 92; continue; };
-case 94:
+case 108:
++cursor;
yych = this._charAt(cursor);
-case 95:
- if (yych <= '\f') {
- if (yych == '\n') { gotoCase = 87; continue; };
- { gotoCase = 94; continue; };
+case 109:
+ if (yych <= '"') {
+ if (yych <= '\r') {
+ if (yych == '\n') { gotoCase = 89; continue; };
+ if (yych <= '\f') { gotoCase = 108; continue; };
+ { gotoCase = 89; continue; };
+ } else {
+ if (yych == ' ') { gotoCase = 89; continue; };
+ if (yych <= '!') { gotoCase = 108; continue; };
+ { gotoCase = 89; continue; };
+ }
} else {
- if (yych <= '\r') { gotoCase = 87; continue; };
- if (yych == '\'') { gotoCase = 93; continue; };
- { gotoCase = 94; continue; };
+ if (yych <= '>') {
+ if (yych == '\'') { gotoCase = 89; continue; };
+ if (yych <= ';') { gotoCase = 108; continue; };
+ { gotoCase = 89; continue; };
+ } else {
+ if (yych <= '[') {
+ if (yych <= 'Z') { gotoCase = 108; continue; };
+ { gotoCase = 89; continue; };
+ } else {
+ if (yych == ']') { gotoCase = 89; continue; };
+ { gotoCase = 108; continue; };
+ }
+ }
}
}