Index: pkg/analyzer_experimental/lib/src/generated/html.dart |
diff --git a/pkg/analyzer_experimental/lib/src/generated/html.dart b/pkg/analyzer_experimental/lib/src/generated/html.dart |
index d8e191fbce49daac5dbdf291aaef0911d98112b7..a6c4a4e55afed8a8cca8b2b0097bf9a5df8ecde3 100644 |
--- a/pkg/analyzer_experimental/lib/src/generated/html.dart |
+++ b/pkg/analyzer_experimental/lib/src/generated/html.dart |
@@ -18,27 +18,27 @@ class Token { |
/** |
* The offset from the beginning of the file to the first character in the token. |
*/ |
- int _offset = 0; |
+ int offset = 0; |
/** |
* The previous token in the token stream. |
*/ |
- Token _previous; |
+ Token previous; |
/** |
* The next token in the token stream. |
*/ |
- Token _next; |
+ Token next; |
/** |
* The type of the token. |
*/ |
- TokenType _type; |
+ TokenType type; |
/** |
* The lexeme represented by this token. |
*/ |
- String _value; |
+ String lexeme; |
/** |
* Initialize a newly created token. |
@@ -56,9 +56,9 @@ class Token { |
* @param value the lexeme represented by this token (not `null`) |
*/ |
Token.con2(TokenType type, int offset, String value) { |
- this._type = type; |
- this._value = StringUtilities.intern(value); |
- this._offset = offset; |
+ this.type = type; |
+ this.lexeme = StringUtilities.intern(value); |
+ this.offset = offset; |
} |
/** |
@@ -68,7 +68,7 @@ class Token { |
* @return the offset from the beginning of the file to the first character after last character |
* of the token |
*/ |
- int get end => _offset + length; |
+ int get end => offset + length; |
/** |
* Return the number of characters in the node's source range. |
@@ -78,41 +78,6 @@ class Token { |
int get length => lexeme.length; |
/** |
- * Return the lexeme that represents this token. |
- * |
- * @return the lexeme (not `null`) |
- */ |
- String get lexeme => _value; |
- |
- /** |
- * Return the next token in the token stream. |
- * |
- * @return the next token in the token stream |
- */ |
- Token get next => _next; |
- |
- /** |
- * Return the offset from the beginning of the file to the first character in the token. |
- * |
- * @return the offset from the beginning of the file to the first character in the token |
- */ |
- int get offset => _offset; |
- |
- /** |
- * Return the previous token in the token stream. |
- * |
- * @return the previous token in the token stream |
- */ |
- Token get previous => _previous; |
- |
- /** |
- * Answer the token type for the receiver. |
- * |
- * @return the token type (not `null`) |
- */ |
- TokenType get type => _type; |
- |
- /** |
* Return `true` if this token is a synthetic token. A synthetic token is a token that was |
* introduced by the parser in order to recover from an error in the code. Synthetic tokens always |
* have a length of zero (`0`). |
@@ -129,20 +94,11 @@ class Token { |
* @return the token that was passed in |
*/ |
Token setNext(Token token) { |
- _next = token; |
+ next = token; |
token.previous = this; |
return token; |
} |
String toString() => lexeme; |
- |
- /** |
- * Set the previous token in the token stream to the given token. |
- * |
- * @param previous the previous token in the token stream |
- */ |
- void set previous(Token previous2) { |
- this._previous = previous2; |
- } |
} |
/** |
* Instances of `HtmlParseResult` hold the result of parsing an HTML file. |
@@ -154,17 +110,10 @@ class HtmlParseResult extends HtmlScanResult { |
/** |
* The unit containing the parsed information (not `null`). |
*/ |
- HtmlUnit _unit; |
+ HtmlUnit htmlUnit; |
HtmlParseResult(int modificationTime, Token token, List<int> lineStarts, HtmlUnit unit) : super(modificationTime, token, lineStarts) { |
- this._unit = unit; |
+ this.htmlUnit = unit; |
} |
- |
- /** |
- * Answer the unit generated by parsing the source |
- * |
- * @return the unit (not `null`) |
- */ |
- HtmlUnit get htmlUnit => _unit; |
} |
/** |
* Instances of the class `RecursiveXmlVisitor` implement an XML visitor that will recursively |
@@ -394,7 +343,7 @@ abstract class AbstractScanner { |
/** |
* The source being scanned. |
*/ |
- Source _source; |
+ Source source; |
/** |
* The token pointing to the head of the linked list of tokens. |
@@ -422,7 +371,7 @@ abstract class AbstractScanner { |
* @param source the source being scanned |
*/ |
AbstractScanner(Source source) { |
- this._source = source; |
+ this.source = source; |
_tokens = new Token.con1(TokenType.EOF, -1); |
_tokens.setNext(_tokens); |
_tail = _tokens; |
@@ -446,13 +395,6 @@ abstract class AbstractScanner { |
int get offset; |
/** |
- * Answer the source being scanned. |
- * |
- * @return the source or `null` if undefined |
- */ |
- Source get source => _source; |
- |
- /** |
* Set array of element tags for which the content between tags should be consider a single token. |
*/ |
void set passThroughElements(List<String> passThroughElements2) { |
@@ -700,43 +642,22 @@ class HtmlScanResult { |
/** |
* The time at which the contents of the source were last set. |
*/ |
- int _modificationTime = 0; |
+ int modificationTime = 0; |
/** |
* The first token in the token stream (not `null`). |
*/ |
- Token _token; |
+ Token token; |
/** |
* The line start information that was produced. |
*/ |
- List<int> _lineStarts; |
+ List<int> lineStarts; |
HtmlScanResult(int modificationTime, Token token, List<int> lineStarts) { |
- this._modificationTime = modificationTime; |
- this._token = token; |
- this._lineStarts = lineStarts; |
+ this.modificationTime = modificationTime; |
+ this.token = token; |
+ this.lineStarts = lineStarts; |
} |
- |
- /** |
- * Answer the line start information that was produced. |
- * |
- * @return an array of line starts (not `null`) |
- */ |
- List<int> get lineStarts => _lineStarts; |
- |
- /** |
- * Return the time at which the contents of the source were last set. |
- * |
- * @return the time at which the contents of the source were last set |
- */ |
- int get modificationTime => _modificationTime; |
- |
- /** |
- * Answer the first token in the token stream. |
- * |
- * @return the token (not `null`) |
- */ |
- Token get token => _token; |
} |
/** |
* Instances of the class `StringScanner` implement a scanner that reads from a string. The |
@@ -957,18 +878,10 @@ class TokenType extends Enum<TokenType> { |
* The lexeme that defines this type of token, or `null` if there is more than one possible |
* lexeme for this type of token. |
*/ |
- String _lexeme; |
+ String lexeme; |
TokenType(String name, int ordinal, String lexeme) : super(name, ordinal) { |
- this._lexeme = lexeme; |
+ this.lexeme = lexeme; |
} |
- |
- /** |
- * Return the lexeme that defines this type of token, or `null` if there is more than one |
- * possible lexeme for this type of token. |
- * |
- * @return the lexeme that defines this type of token |
- */ |
- String get lexeme => _lexeme; |
} |
class TokenType_EOF extends TokenType { |
TokenType_EOF(String name, int ordinal, String arg0) : super(name, ordinal, arg0); |
@@ -980,9 +893,9 @@ class TokenType_EOF extends TokenType { |
* @coverage dart.engine.html |
*/ |
class XmlAttributeNode extends XmlNode { |
- Token _name; |
- Token _equals; |
- Token _value; |
+ Token name; |
+ Token equals; |
+ Token value; |
/** |
* Construct a new instance representing an XML attribute. |
@@ -993,28 +906,13 @@ class XmlAttributeNode extends XmlNode { |
* @param value the value token (not `null`) |
*/ |
XmlAttributeNode(Token name, Token equals, Token value) { |
- this._name = name; |
- this._equals = equals; |
- this._value = value; |
+ this.name = name; |
+ this.equals = equals; |
+ this.value = value; |
} |
accept(XmlVisitor visitor) => visitor.visitXmlAttributeNode(this); |
- Token get beginToken => _name; |
- Token get endToken => _value; |
- |
- /** |
- * Answer the equals sign token that appears between the name and value tokens. This may be |
- * `null` if the attribute is badly formed. |
- * |
- * @return the token or `null` if there is no equals sign between the name and value |
- */ |
- Token get equals => _equals; |
- |
- /** |
- * Answer the attribute name. This may be a zero length token if the attribute is badly formed. |
- * |
- * @return the name (not `null`) |
- */ |
- Token get name => _name; |
+ Token get beginToken => name; |
+ Token get endToken => value; |
/** |
* Answer the lexeme for the value token without the leading and trailing quotes. |
@@ -1022,10 +920,10 @@ class XmlAttributeNode extends XmlNode { |
* @return the text or `null` if the value is not specified |
*/ |
String get text { |
- if (_value == null) { |
+ if (value == null) { |
return null; |
} |
- String text = _value.lexeme; |
+ String text = value.lexeme; |
int len = text.length; |
if (len > 0) { |
if (text.codeUnitAt(0) == 0x22) { |
@@ -1044,14 +942,6 @@ class XmlAttributeNode extends XmlNode { |
} |
return text; |
} |
- |
- /** |
- * Answer the attribute value. A properly formed value will start and end with matching quote |
- * characters, but the value returned may not be properly formed. |
- * |
- * @return the value or `null` if this represents a badly formed attribute |
- */ |
- Token get value => _value; |
void visitChildren(XmlVisitor visitor) { |
} |
} |
@@ -1140,12 +1030,12 @@ class XmlParser { |
/** |
* The source being parsed. |
*/ |
- Source _source; |
+ Source source; |
/** |
* The next token to be parsed. |
*/ |
- Token _currentToken; |
+ Token currentToken; |
/** |
* Construct a parser for the specified source. |
@@ -1153,17 +1043,10 @@ class XmlParser { |
* @param source the source being parsed |
*/ |
XmlParser(Source source) { |
- this._source = source; |
+ this.source = source; |
} |
/** |
- * Answer the source being parsed. |
- * |
- * @return the source |
- */ |
- Source get source => _source; |
- |
- /** |
* Answer `true` if the specified tag is self closing and thus should never have content or |
* child tag nodes. |
* |
@@ -1179,19 +1062,19 @@ class XmlParser { |
* @return the list of tag nodes found (not `null`, contains no `null`) |
*/ |
List<XmlTagNode> parseTopTagNodes(Token firstToken) { |
- _currentToken = firstToken; |
+ currentToken = firstToken; |
List<XmlTagNode> tagNodes = new List<XmlTagNode>(); |
while (true) { |
while (true) { |
- if (_currentToken.type == TokenType.LT) { |
+ if (currentToken.type == TokenType.LT) { |
tagNodes.add(parseTagNode()); |
- } else if (_currentToken.type == TokenType.DECLARATION || _currentToken.type == TokenType.DIRECTIVE || _currentToken.type == TokenType.COMMENT) { |
- _currentToken = _currentToken.next; |
- } else if (_currentToken.type == TokenType.EOF) { |
+ } else if (currentToken.type == TokenType.DECLARATION || currentToken.type == TokenType.DIRECTIVE || currentToken.type == TokenType.COMMENT) { |
+ currentToken = currentToken.next; |
+ } else if (currentToken.type == TokenType.EOF) { |
return tagNodes; |
} else { |
reportUnexpectedToken(); |
- _currentToken = _currentToken.next; |
+ currentToken = currentToken.next; |
} |
break; |
} |
@@ -1199,22 +1082,15 @@ class XmlParser { |
} |
/** |
- * Answer the current token. |
- * |
- * @return the current token |
- */ |
- Token get currentToken => _currentToken; |
- |
- /** |
* Insert a synthetic token of the specified type before the current token |
* |
* @param type the type of token to be inserted (not `null`) |
* @return the synthetic token that was inserted (not `null`) |
*/ |
Token insertSyntheticToken(TokenType type) { |
- Token token = new Token.con2(type, _currentToken.offset, ""); |
- _currentToken.previous.setNext(token); |
- token.setNext(_currentToken); |
+ Token token = new Token.con2(type, currentToken.offset, ""); |
+ currentToken.previous.setNext(token); |
+ token.setNext(currentToken); |
return token; |
} |
@@ -1225,20 +1101,20 @@ class XmlParser { |
* @return the attribute (not `null`) |
*/ |
XmlAttributeNode parseAttribute() { |
- Token name = _currentToken; |
- _currentToken = _currentToken.next; |
+ Token name = currentToken; |
+ currentToken = currentToken.next; |
Token equals; |
- if (identical(_currentToken.type, TokenType.EQ)) { |
- equals = _currentToken; |
- _currentToken = _currentToken.next; |
+ if (identical(currentToken.type, TokenType.EQ)) { |
+ equals = currentToken; |
+ currentToken = currentToken.next; |
} else { |
reportUnexpectedToken(); |
equals = insertSyntheticToken(TokenType.EQ); |
} |
Token value; |
- if (identical(_currentToken.type, TokenType.STRING)) { |
- value = _currentToken; |
- _currentToken = _currentToken.next; |
+ if (identical(currentToken.type, TokenType.STRING)) { |
+ value = currentToken; |
+ currentToken = currentToken.next; |
} else { |
reportUnexpectedToken(); |
value = insertSyntheticToken(TokenType.STRING); |
@@ -1253,20 +1129,20 @@ class XmlParser { |
* @return a collection of zero or more attributes (not `null`, contains no `null`s) |
*/ |
List<XmlAttributeNode> parseAttributes() { |
- TokenType type = _currentToken.type; |
+ TokenType type = currentToken.type; |
if (identical(type, TokenType.GT) || identical(type, TokenType.SLASH_GT) || identical(type, TokenType.EOF)) { |
return XmlTagNode.NO_ATTRIBUTES; |
} |
List<XmlAttributeNode> attributes = new List<XmlAttributeNode>(); |
while (true) { |
while (true) { |
- if (_currentToken.type == TokenType.GT || _currentToken.type == TokenType.SLASH_GT || _currentToken.type == TokenType.EOF) { |
+ if (currentToken.type == TokenType.GT || currentToken.type == TokenType.SLASH_GT || currentToken.type == TokenType.EOF) { |
return attributes; |
- } else if (_currentToken.type == TokenType.TAG) { |
+ } else if (currentToken.type == TokenType.TAG) { |
attributes.add(parseAttribute()); |
} else { |
reportUnexpectedToken(); |
- _currentToken = _currentToken.next; |
+ currentToken = currentToken.next; |
} |
break; |
} |
@@ -1280,22 +1156,22 @@ class XmlParser { |
* @return a list of nodes (not `null`, contains no `null`s) |
*/ |
List<XmlTagNode> parseChildTagNodes() { |
- TokenType type = _currentToken.type; |
+ TokenType type = currentToken.type; |
if (identical(type, TokenType.LT_SLASH) || identical(type, TokenType.EOF)) { |
return XmlTagNode.NO_TAG_NODES; |
} |
List<XmlTagNode> nodes = new List<XmlTagNode>(); |
while (true) { |
while (true) { |
- if (_currentToken.type == TokenType.LT) { |
+ if (currentToken.type == TokenType.LT) { |
nodes.add(parseTagNode()); |
- } else if (_currentToken.type == TokenType.LT_SLASH || _currentToken.type == TokenType.EOF) { |
+ } else if (currentToken.type == TokenType.LT_SLASH || currentToken.type == TokenType.EOF) { |
return nodes; |
- } else if (_currentToken.type == TokenType.COMMENT) { |
- _currentToken = _currentToken.next; |
+ } else if (currentToken.type == TokenType.COMMENT) { |
+ currentToken = currentToken.next; |
} else { |
reportUnexpectedToken(); |
- _currentToken = _currentToken.next; |
+ currentToken = currentToken.next; |
} |
break; |
} |
@@ -1309,49 +1185,49 @@ class XmlParser { |
* @return the tag node or `null` if none found |
*/ |
XmlTagNode parseTagNode() { |
- Token nodeStart = _currentToken; |
- _currentToken = _currentToken.next; |
+ Token nodeStart = currentToken; |
+ currentToken = currentToken.next; |
Token tag; |
- if (identical(_currentToken.type, TokenType.TAG)) { |
- tag = _currentToken; |
- _currentToken = _currentToken.next; |
+ if (identical(currentToken.type, TokenType.TAG)) { |
+ tag = currentToken; |
+ currentToken = currentToken.next; |
} else { |
reportUnexpectedToken(); |
tag = insertSyntheticToken(TokenType.TAG); |
} |
List<XmlAttributeNode> attributes = parseAttributes(); |
Token attributeEnd; |
- if (identical(_currentToken.type, TokenType.GT) || identical(_currentToken.type, TokenType.SLASH_GT)) { |
- attributeEnd = _currentToken; |
- _currentToken = _currentToken.next; |
+ if (identical(currentToken.type, TokenType.GT) || identical(currentToken.type, TokenType.SLASH_GT)) { |
+ attributeEnd = currentToken; |
+ currentToken = currentToken.next; |
} else { |
reportUnexpectedToken(); |
attributeEnd = insertSyntheticToken(TokenType.SLASH_GT); |
} |
if (identical(attributeEnd.type, TokenType.SLASH_GT) || isSelfClosing(tag)) { |
- return new XmlTagNode(nodeStart, tag, attributes, attributeEnd, XmlTagNode.NO_TAG_NODES, _currentToken, null, attributeEnd); |
+ return new XmlTagNode(nodeStart, tag, attributes, attributeEnd, XmlTagNode.NO_TAG_NODES, currentToken, null, attributeEnd); |
} |
List<XmlTagNode> tagNodes = parseChildTagNodes(); |
Token contentEnd; |
- if (identical(_currentToken.type, TokenType.LT_SLASH)) { |
- contentEnd = _currentToken; |
- _currentToken = _currentToken.next; |
+ if (identical(currentToken.type, TokenType.LT_SLASH)) { |
+ contentEnd = currentToken; |
+ currentToken = currentToken.next; |
} else { |
reportUnexpectedToken(); |
contentEnd = insertSyntheticToken(TokenType.LT_SLASH); |
} |
Token closingTag; |
- if (identical(_currentToken.type, TokenType.TAG)) { |
- closingTag = _currentToken; |
- _currentToken = _currentToken.next; |
+ if (identical(currentToken.type, TokenType.TAG)) { |
+ closingTag = currentToken; |
+ currentToken = currentToken.next; |
} else { |
reportUnexpectedToken(); |
closingTag = insertSyntheticToken(TokenType.TAG); |
} |
Token nodeEnd; |
- if (identical(_currentToken.type, TokenType.GT)) { |
- nodeEnd = _currentToken; |
- _currentToken = _currentToken.next; |
+ if (identical(currentToken.type, TokenType.GT)) { |
+ nodeEnd = currentToken; |
+ currentToken = currentToken.next; |
} else { |
reportUnexpectedToken(); |
nodeEnd = insertSyntheticToken(TokenType.GT); |
@@ -1386,29 +1262,29 @@ class XmlTagNode extends XmlNode { |
/** |
* The starting [TokenType#LT] token (not `null`). |
*/ |
- Token _nodeStart; |
+ Token nodeStart; |
/** |
* The [TokenType#TAG] token after the starting '<' (not `null`). |
*/ |
- Token _tag; |
+ Token tag; |
/** |
* The attributes contained by the receiver (not `null`, contains no `null`s). |
*/ |
- List<XmlAttributeNode> _attributes; |
+ List<XmlAttributeNode> attributes; |
/** |
* The [TokenType#GT] or [TokenType#SLASH_GT] token after the attributes (not |
* `null`). The token may be the same token as [nodeEnd] if there are no child |
* [tagNodes]. |
*/ |
- Token _attributeEnd; |
+ Token attributeEnd; |
/** |
* The tag nodes contained in the receiver (not `null`, contains no `null`s). |
*/ |
- List<XmlTagNode> _tagNodes; |
+ List<XmlTagNode> tagNodes; |
/** |
* The token (not `null`) after the content, which may be |
@@ -1421,18 +1297,18 @@ class XmlTagNode extends XmlNode { |
* content and the attributes ended with [TokenType#SLASH_GT]. |
* |
*/ |
- Token _contentEnd; |
+ Token contentEnd; |
/** |
* The closing [TokenType#TAG] after the child elements or `null` if there is no |
* content and the attributes ended with [TokenType#SLASH_GT] |
*/ |
- Token _closingTag; |
+ Token closingTag; |
/** |
* The ending [TokenType#GT] or [TokenType#SLASH_GT] token (not `null`). |
*/ |
- Token _nodeEnd; |
+ Token nodeEnd; |
/** |
* Construct a new instance representing an XML or HTML element |
@@ -1461,14 +1337,14 @@ class XmlTagNode extends XmlNode { |
* `null`) |
*/ |
XmlTagNode(Token nodeStart, Token tag, List<XmlAttributeNode> attributes, Token attributeEnd, List<XmlTagNode> tagNodes, Token contentEnd, Token closingTag, Token nodeEnd) { |
- this._nodeStart = nodeStart; |
- this._tag = tag; |
- this._attributes = becomeParentOfEmpty(attributes, NO_ATTRIBUTES); |
- this._attributeEnd = attributeEnd; |
- this._tagNodes = becomeParentOfEmpty(tagNodes, NO_TAG_NODES); |
- this._contentEnd = contentEnd; |
- this._closingTag = closingTag; |
- this._nodeEnd = nodeEnd; |
+ this.nodeStart = nodeStart; |
+ this.tag = tag; |
+ this.attributes = becomeParentOfEmpty(attributes, NO_ATTRIBUTES); |
+ this.attributeEnd = attributeEnd; |
+ this.tagNodes = becomeParentOfEmpty(tagNodes, NO_TAG_NODES); |
+ this.contentEnd = contentEnd; |
+ this.closingTag = closingTag; |
+ this.nodeEnd = nodeEnd; |
} |
accept(XmlVisitor visitor) => visitor.visitXmlTagNode(this); |
@@ -1479,7 +1355,7 @@ class XmlTagNode extends XmlNode { |
* @return the attribute or `null` if no matching attribute is found |
*/ |
XmlAttributeNode getAttribute(String name2) { |
- for (XmlAttributeNode attribute in _attributes) { |
+ for (XmlAttributeNode attribute in attributes) { |
if (attribute.name.lexeme == name2) { |
return attribute; |
} |
@@ -1488,23 +1364,6 @@ class XmlTagNode extends XmlNode { |
} |
/** |
- * The [TokenType#GT] or [TokenType#SLASH_GT] token after the attributes (not |
- * `null`). The token may be the same token as [nodeEnd] if there are no child |
- * [tagNodes]. |
- * |
- * @return the token (not `null`) |
- */ |
- Token get attributeEnd => _attributeEnd; |
- |
- /** |
- * Answer the receiver's attributes. Callers should not manipulate the returned list to edit the |
- * AST structure. |
- * |
- * @return the attributes (not `null`, contains no `null`s) |
- */ |
- List<XmlAttributeNode> get attributes => _attributes; |
- |
- /** |
* Find the attribute with the given name (see [getAttribute] and answer the lexeme |
* for the attribute's value token without the leading and trailing quotes (see |
* [XmlAttributeNode#getText]). |
@@ -1516,15 +1375,7 @@ class XmlTagNode extends XmlNode { |
XmlAttributeNode attribute = getAttribute(name); |
return attribute != null ? attribute.text : null; |
} |
- Token get beginToken => _nodeStart; |
- |
- /** |
- * The the closing [TokenType#TAG] after the child elements or `null` if there is no |
- * content and the attributes ended with [TokenType#SLASH_GT] |
- * |
- * @return the closing tag or `null` |
- */ |
- Token get closingTag => _closingTag; |
+ Token get beginToken => nodeStart; |
/** |
* Answer a string representing the content contained in the receiver. This includes the textual |
@@ -1534,92 +1385,48 @@ class XmlTagNode extends XmlNode { |
* @return the content (not `null`) |
*/ |
String get content { |
- Token token = _attributeEnd.next; |
- if (identical(token, _contentEnd)) { |
+ Token token = attributeEnd.next; |
+ if (identical(token, contentEnd)) { |
return ""; |
} |
String content = token.lexeme; |
token = token.next; |
- if (identical(token, _contentEnd)) { |
+ if (identical(token, contentEnd)) { |
return content; |
} |
JavaStringBuilder buffer = new JavaStringBuilder(); |
- while (token != _contentEnd) { |
+ while (token != contentEnd) { |
buffer.append(token.lexeme); |
token = token.next; |
} |
return buffer.toString(); |
} |
- |
- /** |
- * Answer the token (not `null`) after the content, which may be |
- * |
- * * (1) [TokenType#LT_SLASH] for nodes with open and close tags, or |
- * * (2) the [TokenType#LT] nodeStart of the next sibling node if this node is self |
- * closing or the attributeEnd is [TokenType#SLASH_GT], or |
- * * (3) [TokenType#EOF] if the node does not have a closing tag and is the last node in |
- * the stream [TokenType#LT_SLASH] token after the content, or `null` if there is no |
- * content and the attributes ended with [TokenType#SLASH_GT]. |
- * |
- * |
- * @return the token (not `null`) |
- */ |
- Token get contentEnd => _contentEnd; |
Token get endToken { |
- if (_nodeEnd != null) { |
- return _nodeEnd; |
+ if (nodeEnd != null) { |
+ return nodeEnd; |
} |
- if (_closingTag != null) { |
- return _closingTag; |
+ if (closingTag != null) { |
+ return closingTag; |
} |
- if (_contentEnd != null) { |
- return _contentEnd; |
+ if (contentEnd != null) { |
+ return contentEnd; |
} |
- if (!_tagNodes.isEmpty) { |
- return _tagNodes[_tagNodes.length - 1].endToken; |
+ if (!tagNodes.isEmpty) { |
+ return tagNodes[tagNodes.length - 1].endToken; |
} |
- if (_attributeEnd != null) { |
- return _attributeEnd; |
+ if (attributeEnd != null) { |
+ return attributeEnd; |
} |
- if (!_attributes.isEmpty) { |
- return _attributes[_attributes.length - 1].endToken; |
+ if (!attributes.isEmpty) { |
+ return attributes[attributes.length - 1].endToken; |
} |
- return _tag; |
+ return tag; |
} |
- |
- /** |
- * Answer the ending [TokenType#GT] or [TokenType#SLASH_GT] token. |
- * |
- * @return the token (not `null`) |
- */ |
- Token get nodeEnd => _nodeEnd; |
- |
- /** |
- * Answer the starting [TokenType#LT] token. |
- * |
- * @return the token (not `null`) |
- */ |
- Token get nodeStart => _nodeStart; |
- |
- /** |
- * Answer the [TokenType#TAG] token after the starting '<'. |
- * |
- * @return the token (not `null`) |
- */ |
- Token get tag => _tag; |
- |
- /** |
- * Answer the tag nodes contained in the receiver. Callers should not manipulate the returned list |
- * to edit the AST structure. |
- * |
- * @return the children (not `null`, contains no `null`s) |
- */ |
- List<XmlTagNode> get tagNodes => _tagNodes; |
void visitChildren(XmlVisitor visitor) { |
- for (XmlAttributeNode node in _attributes) { |
+ for (XmlAttributeNode node in attributes) { |
node.accept(visitor); |
} |
- for (XmlTagNode node in _tagNodes) { |
+ for (XmlTagNode node in tagNodes) { |
node.accept(visitor); |
} |
} |
@@ -1697,12 +1504,12 @@ class HtmlUnit extends XmlNode { |
/** |
* The tag nodes contained in the receiver (not `null`, contains no `null`s). |
*/ |
- List<XmlTagNode> _tagNodes; |
+ List<XmlTagNode> tagNodes; |
/** |
* The element associated with this HTML unit or `null` if the receiver is not resolved. |
*/ |
- HtmlElementImpl _element; |
+ HtmlElementImpl element; |
/** |
* Construct a new instance representing the content of an HTML file. |
@@ -1714,38 +1521,14 @@ class HtmlUnit extends XmlNode { |
*/ |
HtmlUnit(Token beginToken, List<XmlTagNode> tagNodes, Token endToken) { |
this._beginToken = beginToken; |
- this._tagNodes = becomeParentOf(tagNodes); |
+ this.tagNodes = becomeParentOf(tagNodes); |
this._endToken = endToken; |
} |
accept(XmlVisitor visitor) => visitor.visitHtmlUnit(this); |
Token get beginToken => _beginToken; |
- |
- /** |
- * Return the element associated with this HTML unit. |
- * |
- * @return the element or `null` if the receiver is not resolved |
- */ |
- HtmlElementImpl get element => _element; |
Token get endToken => _endToken; |
- |
- /** |
- * Answer the tag nodes contained in the receiver. Callers should not manipulate the returned list |
- * to edit the AST structure. |
- * |
- * @return the children (not `null`, contains no `null`s) |
- */ |
- List<XmlTagNode> get tagNodes => _tagNodes; |
- |
- /** |
- * Set the element associated with this HTML unit. |
- * |
- * @param element the element |
- */ |
- void set element(HtmlElementImpl element2) { |
- this._element = element2; |
- } |
void visitChildren(XmlVisitor visitor) { |
- for (XmlTagNode node in _tagNodes) { |
+ for (XmlTagNode node in tagNodes) { |
node.accept(visitor); |
} |
} |