| Index: pkg/analyzer/lib/src/generated/html.dart
|
| diff --git a/pkg/analyzer/lib/src/generated/html.dart b/pkg/analyzer/lib/src/generated/html.dart
|
| index 3924cec7b601338337d8e92761cbeaebb508667e..d373bbccb7fbc46c88e1800f078bef716212f4c2 100644
|
| --- a/pkg/analyzer/lib/src/generated/html.dart
|
| +++ b/pkg/analyzer/lib/src/generated/html.dart
|
| @@ -24,7 +24,7 @@ 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.
|
| @@ -34,17 +34,17 @@ class Token {
|
| /**
|
| * 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 lexeme;
|
| + String _value;
|
|
|
| /**
|
| * Initialize a newly created token.
|
| @@ -62,9 +62,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.lexeme = StringUtilities.intern(value);
|
| - this.offset = offset;
|
| + this._type = type;
|
| + this._value = StringUtilities.intern(value);
|
| + this._offset = offset;
|
| }
|
|
|
| /**
|
| @@ -74,7 +74,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.
|
| @@ -84,6 +84,34 @@ 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;
|
| +
|
| + /**
|
| + * 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`).
|
| @@ -100,7 +128,7 @@ class Token {
|
| * @return the token that was passed in
|
| */
|
| Token setNext(Token token) {
|
| - next = token;
|
| + _next = token;
|
| token.previous = this;
|
| return token;
|
| }
|
| @@ -116,17 +144,17 @@ class EmbeddedExpression {
|
| /**
|
| * The offset of the first character of the opening delimiter.
|
| */
|
| - int openingOffset = 0;
|
| + final int openingOffset;
|
|
|
| /**
|
| * The expression that is enclosed between the delimiters.
|
| */
|
| - Expression expression;
|
| + final Expression expression;
|
|
|
| /**
|
| * The offset of the first character of the closing delimiter.
|
| */
|
| - int closingOffset = 0;
|
| + final int closingOffset;
|
|
|
| /**
|
| * An empty array of embedded expressions.
|
| @@ -140,11 +168,7 @@ class EmbeddedExpression {
|
| * @param expression the expression that is enclosed between the delimiters
|
| * @param closingOffset the offset of the first character of the closing delimiter
|
| */
|
| - EmbeddedExpression(int openingOffset, Expression expression, int closingOffset) {
|
| - this.openingOffset = openingOffset;
|
| - this.expression = expression;
|
| - this.closingOffset = closingOffset;
|
| - }
|
| + EmbeddedExpression(this.openingOffset, this.expression, this.closingOffset);
|
| }
|
|
|
| /**
|
| @@ -156,11 +180,18 @@ class HtmlParseResult extends HtmlScanResult {
|
| /**
|
| * The unit containing the parsed information (not `null`).
|
| */
|
| - HtmlUnit htmlUnit;
|
| + HtmlUnit _unit;
|
|
|
| HtmlParseResult(int modificationTime, Token token, List<int> lineStarts, HtmlUnit unit) : super(modificationTime, token, lineStarts) {
|
| - this.htmlUnit = unit;
|
| + this._unit = unit;
|
| }
|
| +
|
| + /**
|
| + * Answer the unit generated by parsing the source
|
| + *
|
| + * @return the unit (not `null`)
|
| + */
|
| + HtmlUnit get htmlUnit => _unit;
|
| }
|
|
|
| /**
|
| @@ -171,7 +202,7 @@ class TagWithEmbeddedExpressions extends XmlTagNode {
|
| /**
|
| * The expressions that are embedded in the tag's content.
|
| */
|
| - List<EmbeddedExpression> _expressions;
|
| + final List<EmbeddedExpression> expressions;
|
|
|
| /**
|
| * Initialize a newly created tag whose text content contains one or more embedded expressions.
|
| @@ -186,11 +217,7 @@ class TagWithEmbeddedExpressions extends XmlTagNode {
|
| * @param nodeEnd the last token in the tag
|
| * @param expressions the expressions that are embedded in the value
|
| */
|
| - TagWithEmbeddedExpressions(Token nodeStart, Token tag, List<XmlAttributeNode> attributes, Token attributeEnd, List<XmlTagNode> tagNodes, Token contentEnd, Token closingTag, Token nodeEnd, List<EmbeddedExpression> expressions) : super(nodeStart, tag, attributes, attributeEnd, tagNodes, contentEnd, closingTag, nodeEnd) {
|
| - this._expressions = expressions;
|
| - }
|
| -
|
| - List<EmbeddedExpression> get expressions => _expressions;
|
| + TagWithEmbeddedExpressions(Token nodeStart, Token tag, List<XmlAttributeNode> attributes, Token attributeEnd, List<XmlTagNode> tagNodes, Token contentEnd, Token closingTag, Token nodeEnd, this.expressions) : super(nodeStart, tag, attributes, attributeEnd, tagNodes, contentEnd, closingTag, nodeEnd);
|
| }
|
|
|
| /**
|
| @@ -465,7 +492,7 @@ class AttributeWithEmbeddedExpressions extends XmlAttributeNode {
|
| /**
|
| * The expressions that are embedded in the attribute's value.
|
| */
|
| - List<EmbeddedExpression> _expressions;
|
| + final List<EmbeddedExpression> expressions;
|
|
|
| /**
|
| * Initialize a newly created attribute whose value contains one or more embedded expressions.
|
| @@ -475,11 +502,7 @@ class AttributeWithEmbeddedExpressions extends XmlAttributeNode {
|
| * @param value the value of the attribute
|
| * @param expressions the expressions that are embedded in the value
|
| */
|
| - AttributeWithEmbeddedExpressions(Token name, Token equals, Token value, List<EmbeddedExpression> expressions) : super(name, equals, value) {
|
| - this._expressions = expressions;
|
| - }
|
| -
|
| - List<EmbeddedExpression> get expressions => _expressions;
|
| + AttributeWithEmbeddedExpressions(Token name, Token equals, Token value, this.expressions) : super(name, equals, value);
|
| }
|
|
|
| /**
|
| @@ -510,7 +533,7 @@ abstract class AbstractScanner {
|
| /**
|
| * The source being scanned.
|
| */
|
| - Source source;
|
| + final Source source;
|
|
|
| /**
|
| * The token pointing to the head of the linked list of tokens.
|
| @@ -537,8 +560,7 @@ abstract class AbstractScanner {
|
| *
|
| * @param source the source being scanned
|
| */
|
| - AbstractScanner(Source source) {
|
| - this.source = source;
|
| + AbstractScanner(this.source) {
|
| _tokens = new Token.con1(TokenType.EOF, -1);
|
| _tokens.setNext(_tokens);
|
| _tail = _tokens;
|
| @@ -816,23 +838,19 @@ class HtmlScanResult {
|
| /**
|
| * The time at which the contents of the source were last set.
|
| */
|
| - int modificationTime = 0;
|
| + final int modificationTime;
|
|
|
| /**
|
| * The first token in the token stream (not `null`).
|
| */
|
| - Token token;
|
| + final Token token;
|
|
|
| /**
|
| * The line start information that was produced.
|
| */
|
| - List<int> lineStarts;
|
| + final List<int> lineStarts;
|
|
|
| - HtmlScanResult(int modificationTime, Token token, List<int> lineStarts) {
|
| - this.modificationTime = modificationTime;
|
| - this.token = token;
|
| - this.lineStarts = lineStarts;
|
| - }
|
| + HtmlScanResult(this.modificationTime, this.token, this.lineStarts);
|
| }
|
|
|
| /**
|
| @@ -1079,11 +1097,9 @@ 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;
|
| + final String lexeme;
|
|
|
| - TokenType(String name, int ordinal, String lexeme) : super(name, ordinal) {
|
| - this.lexeme = lexeme;
|
| - }
|
| + TokenType(String name, int ordinal, this.lexeme) : super(name, ordinal);
|
| }
|
|
|
| class TokenType_EOF extends TokenType {
|
| @@ -1098,11 +1114,11 @@ class TokenType_EOF extends TokenType {
|
| * @coverage dart.engine.html
|
| */
|
| class XmlAttributeNode extends XmlNode {
|
| - Token name;
|
| + final Token name;
|
|
|
| - Token equals;
|
| + final Token equals;
|
|
|
| - Token value;
|
| + final Token value;
|
|
|
| /**
|
| * Construct a new instance representing an XML attribute.
|
| @@ -1112,11 +1128,7 @@ class XmlAttributeNode extends XmlNode {
|
| * @param equals the equals sign or `null` if none
|
| * @param value the value token (not `null`)
|
| */
|
| - XmlAttributeNode(Token name, Token equals, Token value) {
|
| - this.name = name;
|
| - this.equals = equals;
|
| - this.value = value;
|
| - }
|
| + XmlAttributeNode(this.name, this.equals, this.value);
|
|
|
| accept(XmlVisitor visitor) => visitor.visitXmlAttributeNode(this);
|
|
|
| @@ -1307,21 +1319,19 @@ class XmlParser {
|
| /**
|
| * The source being parsed.
|
| */
|
| - Source source;
|
| + final Source source;
|
|
|
| /**
|
| * The next token to be parsed.
|
| */
|
| - Token currentToken;
|
| + Token _currentToken;
|
|
|
| /**
|
| * Construct a parser for the specified source.
|
| *
|
| * @param source the source being parsed
|
| */
|
| - XmlParser(Source source) {
|
| - this.source = source;
|
| - }
|
| + XmlParser(this.source);
|
|
|
| /**
|
| * Create a node representing an attribute.
|
| @@ -1364,19 +1374,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;
|
| }
|
| @@ -1384,15 +1394,22 @@ 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;
|
| }
|
|
|
| @@ -1403,20 +1420,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);
|
| @@ -1431,20 +1448,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;
|
| }
|
| @@ -1458,22 +1475,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;
|
| }
|
| @@ -1487,49 +1504,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 createTagNode(nodeStart, tag, attributes, attributeEnd, XmlTagNode.NO_TAG_NODES, currentToken, null, attributeEnd);
|
| + return createTagNode(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);
|
| @@ -1564,29 +1581,29 @@ class XmlTagNode extends XmlNode {
|
| /**
|
| * The starting [TokenType#LT] token (not `null`).
|
| */
|
| - Token nodeStart;
|
| + final Token nodeStart;
|
|
|
| /**
|
| * The [TokenType#TAG] token after the starting '<' (not `null`).
|
| */
|
| - Token tag;
|
| + final 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;
|
| + final 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
|
| @@ -1599,18 +1616,18 @@ class XmlTagNode extends XmlNode {
|
| * content and the attributes ended with [TokenType#SLASH_GT].
|
| *
|
| */
|
| - Token contentEnd;
|
| + final 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;
|
| + final Token closingTag;
|
|
|
| /**
|
| * The ending [TokenType#GT] or [TokenType#SLASH_GT] token (not `null`).
|
| */
|
| - Token nodeEnd;
|
| + final Token nodeEnd;
|
|
|
| /**
|
| * Construct a new instance representing an XML or HTML element
|
| @@ -1638,15 +1655,9 @@ class XmlTagNode extends XmlNode {
|
| * @param nodeEnd the ending [TokenType#GT] or [TokenType#SLASH_GT] token (not
|
| * `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;
|
| + XmlTagNode(this.nodeStart, this.tag, List<XmlAttributeNode> attributes, this.attributeEnd, List<XmlTagNode> tagNodes, this.contentEnd, this.closingTag, this.nodeEnd) {
|
| + this._attributes = becomeParentOfEmpty(attributes, NO_ATTRIBUTES);
|
| + this._tagNodes = becomeParentOfEmpty(tagNodes, NO_TAG_NODES);
|
| }
|
|
|
| accept(XmlVisitor visitor) => visitor.visitXmlTagNode(this);
|
| @@ -1658,7 +1669,7 @@ class XmlTagNode extends XmlNode {
|
| * @return the attribute or `null` if no matching attribute is found
|
| */
|
| XmlAttributeNode getAttribute(String name) {
|
| - for (XmlAttributeNode attribute in attributes) {
|
| + for (XmlAttributeNode attribute in _attributes) {
|
| if (attribute.name.lexeme == name) {
|
| return attribute;
|
| }
|
| @@ -1667,6 +1678,14 @@ class XmlTagNode extends XmlNode {
|
| }
|
|
|
| /**
|
| + * 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]).
|
| @@ -1716,14 +1735,14 @@ class XmlTagNode extends XmlNode {
|
| 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 (!attributes.isEmpty) {
|
| - return attributes[attributes.length - 1].endToken;
|
| + if (!_attributes.isEmpty) {
|
| + return _attributes[_attributes.length - 1].endToken;
|
| }
|
| return tag;
|
| }
|
| @@ -1735,11 +1754,19 @@ class XmlTagNode extends XmlNode {
|
| */
|
| List<EmbeddedExpression> get expressions => EmbeddedExpression.EMPTY_ARRAY;
|
|
|
| + /**
|
| + * 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);
|
| }
|
| }
|
| @@ -1962,18 +1989,18 @@ class HtmlUnit extends XmlNode {
|
| /**
|
| * The first token in the token stream that was parsed to form this HTML unit.
|
| */
|
| - Token _beginToken;
|
| + final Token beginToken;
|
|
|
| /**
|
| * The last token in the token stream that was parsed to form this compilation unit. This token
|
| * should always have a type of [TokenType.EOF].
|
| */
|
| - Token _endToken;
|
| + final Token endToken;
|
|
|
| /**
|
| * 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.
|
| @@ -1988,20 +2015,22 @@ class HtmlUnit extends XmlNode {
|
| * @param endToken the last token in the token stream which should be of type
|
| * [TokenType.EOF]
|
| */
|
| - HtmlUnit(Token beginToken, List<XmlTagNode> tagNodes, Token endToken) {
|
| - this._beginToken = beginToken;
|
| - this.tagNodes = becomeParentOf(tagNodes);
|
| - this._endToken = endToken;
|
| + HtmlUnit(this.beginToken, List<XmlTagNode> tagNodes, this.endToken) {
|
| + this._tagNodes = becomeParentOf(tagNodes);
|
| }
|
|
|
| accept(XmlVisitor visitor) => visitor.visitHtmlUnit(this);
|
|
|
| - Token get beginToken => _beginToken;
|
| -
|
| - 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;
|
|
|
| void visitChildren(XmlVisitor visitor) {
|
| - for (XmlTagNode node in tagNodes) {
|
| + for (XmlTagNode node in _tagNodes) {
|
| node.accept(visitor);
|
| }
|
| }
|
|
|