| Index: pkg/compiler/lib/src/tree/nodes.dart
|
| diff --git a/pkg/compiler/lib/src/tree/nodes.dart b/pkg/compiler/lib/src/tree/nodes.dart
|
| index 46c54245bcb9c8fb4f4910b41f308826cfb2d89a..8c65fc784c388d3e8adcfe01c6d3329e70f18ceb 100644
|
| --- a/pkg/compiler/lib/src/tree/nodes.dart
|
| +++ b/pkg/compiler/lib/src/tree/nodes.dart
|
| @@ -7,10 +7,12 @@ import 'dart:collection' show IterableMixin;
|
| import '../common.dart';
|
| import '../tokens/precedence_constants.dart' as Precedence show FUNCTION_INFO;
|
| import '../tokens/token.dart' show BeginGroupToken, Token;
|
| -import '../tokens/token_constants.dart' as Tokens show IDENTIFIER_TOKEN, KEYWORD_TOKEN, PLUS_TOKEN;
|
| +import '../tokens/token_constants.dart' as Tokens
|
| + show IDENTIFIER_TOKEN, KEYWORD_TOKEN, PLUS_TOKEN;
|
| import '../util/util.dart';
|
| import '../util/characters.dart';
|
| -import '../resolution/secret_tree_element.dart' show NullTreeElementMixin, StoredTreeElementMixin;
|
| +import '../resolution/secret_tree_element.dart'
|
| + show NullTreeElementMixin, StoredTreeElementMixin;
|
| import '../elements/elements.dart' show MetadataAnnotation;
|
| import 'dartstring.dart';
|
| import 'prettyprint.dart';
|
| @@ -74,12 +76,14 @@ abstract class Visitor<R> {
|
| R visitNamedMixinApplication(NamedMixinApplication node) {
|
| return visitMixinApplication(node);
|
| }
|
| +
|
| R visitNewExpression(NewExpression node) => visitExpression(node);
|
| R visitNodeList(NodeList node) => visitNode(node);
|
| R visitOperator(Operator node) => visitIdentifier(node);
|
| R visitParenthesizedExpression(ParenthesizedExpression node) {
|
| return visitExpression(node);
|
| }
|
| +
|
| R visitPart(Part node) => visitLibraryTag(node);
|
| R visitPartOf(PartOf node) => visitNode(node);
|
| R visitPostfix(Postfix node) => visitNodeList(node);
|
| @@ -87,6 +91,7 @@ abstract class Visitor<R> {
|
| R visitRedirectingFactoryBody(RedirectingFactoryBody node) {
|
| return visitStatement(node);
|
| }
|
| +
|
| R visitRethrow(Rethrow node) => visitStatement(node);
|
| R visitReturn(Return node) => visitStatement(node);
|
| R visitSend(Send node) => visitExpression(node);
|
| @@ -97,6 +102,7 @@ abstract class Visitor<R> {
|
| R visitStringInterpolationPart(StringInterpolationPart node) {
|
| return visitNode(node);
|
| }
|
| +
|
| R visitSwitchCase(SwitchCase node) => visitNode(node);
|
| R visitSwitchStatement(SwitchStatement node) => visitStatement(node);
|
| R visitLiteralSymbol(LiteralSymbol node) => visitExpression(node);
|
| @@ -263,9 +269,16 @@ class ClassNode extends Node {
|
| final Token extendsKeyword;
|
| final Token endToken;
|
|
|
| - ClassNode(this.modifiers, this.name, this.typeParameters, this.superclass,
|
| - this.interfaces, this.beginToken,
|
| - this.extendsKeyword, this.body, this.endToken);
|
| + ClassNode(
|
| + this.modifiers,
|
| + this.name,
|
| + this.typeParameters,
|
| + this.superclass,
|
| + this.interfaces,
|
| + this.beginToken,
|
| + this.extendsKeyword,
|
| + this.body,
|
| + this.endToken);
|
|
|
| ClassNode asClassNode() => this;
|
|
|
| @@ -335,9 +348,8 @@ class NamedMixinApplication extends Node implements MixinApplication {
|
| final Token classKeyword;
|
| final Token endToken;
|
|
|
| - NamedMixinApplication(this.name, this.typeParameters,
|
| - this.modifiers, this.mixinApplication, this.interfaces,
|
| - this.classKeyword, this.endToken);
|
| + NamedMixinApplication(this.name, this.typeParameters, this.modifiers,
|
| + this.mixinApplication, this.interfaces, this.classKeyword, this.endToken);
|
|
|
| TypeAnnotation get superclass => mixinApplication.superclass;
|
| NodeList get mixins => mixinApplication.mixins;
|
| @@ -381,8 +393,7 @@ abstract class Statement extends Node {
|
|
|
| /// Erroneous expression that behaves as a literal null.
|
| class ErrorExpression extends LiteralNull {
|
| - ErrorExpression(token)
|
| - : super(token);
|
| + ErrorExpression(token) : super(token);
|
|
|
| ErrorExpression asErrorExpression() => this;
|
|
|
| @@ -406,18 +417,20 @@ class Send extends Expression with StoredTreeElementMixin {
|
|
|
| Link<Node> get arguments => argumentsNode.nodes;
|
|
|
| - Send([this.receiver, this.selector, this.argumentsNode,
|
| + Send(
|
| + [this.receiver,
|
| + this.selector,
|
| + this.argumentsNode,
|
| this.isConditional = false]);
|
| Send.postfix(this.receiver, this.selector,
|
| [Node argument = null, this.isConditional = false])
|
| : argumentsNode = (argument == null)
|
| - ? new Postfix()
|
| - : new Postfix.singleton(argument);
|
| + ? new Postfix()
|
| + : new Postfix.singleton(argument);
|
| Send.prefix(this.receiver, this.selector,
|
| [Node argument = null, this.isConditional = false])
|
| - : argumentsNode = (argument == null)
|
| - ? new Prefix()
|
| - : new Prefix.singleton(argument);
|
| + : argumentsNode =
|
| + (argument == null) ? new Prefix() : new Prefix.singleton(argument);
|
|
|
| Send asSend() => this;
|
|
|
| @@ -436,6 +449,7 @@ class Send extends Expression with StoredTreeElementMixin {
|
| bool get isSuperCall {
|
| return receiver != null && receiver.isSuper();
|
| }
|
| +
|
| bool get isOperator => selector is Operator;
|
| bool get isPropertyAccess => argumentsNode == null;
|
| bool get isFunctionObjectInvocation => selector == null;
|
| @@ -452,13 +466,11 @@ class Send extends Expression with StoredTreeElementMixin {
|
| isOperator && identical(selector.asOperator().source, '??');
|
|
|
| bool get isTypeCast {
|
| - return isOperator
|
| - && identical(selector.asOperator().source, 'as');
|
| + return isOperator && identical(selector.asOperator().source, 'as');
|
| }
|
|
|
| bool get isTypeTest {
|
| - return isOperator
|
| - && identical(selector.asOperator().source, 'is');
|
| + return isOperator && identical(selector.asOperator().source, 'is');
|
| }
|
|
|
| bool get isIsNotCheck {
|
| @@ -469,9 +481,7 @@ class Send extends Expression with StoredTreeElementMixin {
|
| assert(isOperator);
|
| assert(identical(selector.asOperator().source, 'is') ||
|
| identical(selector.asOperator().source, 'as'));
|
| - return isIsNotCheck
|
| - ? arguments.head.asSend().receiver
|
| - : arguments.head;
|
| + return isIsNotCheck ? arguments.head.asSend().receiver : arguments.head;
|
| }
|
|
|
| Token getBeginToken() {
|
| @@ -513,16 +523,12 @@ class SendSet extends Send {
|
| final Operator assignmentOperator;
|
| SendSet(receiver, selector, this.assignmentOperator, argumentsNode,
|
| [bool isConditional = false])
|
| - : super(receiver, selector, argumentsNode, isConditional);
|
| - SendSet.postfix(receiver,
|
| - selector,
|
| - this.assignmentOperator,
|
| - [Node argument = null, bool isConditional = false])
|
| + : super(receiver, selector, argumentsNode, isConditional);
|
| + SendSet.postfix(receiver, selector, this.assignmentOperator,
|
| + [Node argument = null, bool isConditional = false])
|
| : super.postfix(receiver, selector, argument, isConditional);
|
| - SendSet.prefix(receiver,
|
| - selector,
|
| - this.assignmentOperator,
|
| - [Node argument = null, bool isConditional = false])
|
| + SendSet.prefix(receiver, selector, this.assignmentOperator,
|
| + [Node argument = null, bool isConditional = false])
|
| : super.prefix(receiver, selector, argument, isConditional);
|
|
|
| SendSet asSendSet() => this;
|
| @@ -533,8 +539,7 @@ class SendSet extends Send {
|
| bool get isComplex => !identical(assignmentOperator.source, '=');
|
|
|
| /// Whether this is an if-null assignment of the form `a ??= b`.
|
| - bool get isIfNullAssignment =>
|
| - identical(assignmentOperator.source, '??=');
|
| + bool get isIfNullAssignment => identical(assignmentOperator.source, '??=');
|
|
|
| visitChildren(Visitor visitor) {
|
| super.visitChildren(visitor);
|
| @@ -543,8 +548,8 @@ class SendSet extends Send {
|
|
|
| Send copyWithReceiver(Node newReceiver, bool isConditional) {
|
| assert(receiver == null);
|
| - return new SendSet(newReceiver, selector, assignmentOperator,
|
| - argumentsNode, isConditional);
|
| + return new SendSet(newReceiver, selector, assignmentOperator, argumentsNode,
|
| + isConditional);
|
| }
|
|
|
| Token getBeginToken() {
|
| @@ -626,16 +631,16 @@ class NodeList extends Node with IterableMixin<Node> {
|
|
|
| Token getBeginToken() {
|
| if (beginToken != null) return beginToken;
|
| - if (nodes != null) {
|
| - for (Link<Node> link = nodes; !link.isEmpty; link = link.tail) {
|
| - if (link.head.getBeginToken() != null) {
|
| - return link.head.getBeginToken();
|
| - }
|
| - if (link.head.getEndToken() != null) {
|
| - return link.head.getEndToken();
|
| - }
|
| - }
|
| - }
|
| + if (nodes != null) {
|
| + for (Link<Node> link = nodes; !link.isEmpty; link = link.tail) {
|
| + if (link.head.getBeginToken() != null) {
|
| + return link.head.getBeginToken();
|
| + }
|
| + if (link.head.getEndToken() != null) {
|
| + return link.head.getEndToken();
|
| + }
|
| + }
|
| + }
|
| return endToken;
|
| }
|
|
|
| @@ -681,8 +686,8 @@ class If extends Statement {
|
| final Token ifToken;
|
| final Token elseToken;
|
|
|
| - If(this.condition, this.thenPart, this.elsePart,
|
| - this.ifToken, this.elseToken);
|
| + If(this.condition, this.thenPart, this.elsePart, this.ifToken,
|
| + this.elseToken);
|
|
|
| If asIf() => this;
|
|
|
| @@ -712,8 +717,8 @@ class Conditional extends Expression {
|
| final Token questionToken;
|
| final Token colonToken;
|
|
|
| - Conditional(this.condition, this.thenExpression,
|
| - this.elseExpression, this.questionToken, this.colonToken);
|
| + Conditional(this.condition, this.thenExpression, this.elseExpression,
|
| + this.questionToken, this.colonToken);
|
|
|
| Conditional asConditional() => this;
|
|
|
| @@ -740,7 +745,8 @@ class For extends Loop {
|
| final Token forToken;
|
|
|
| For(this.initializer, this.conditionStatement, this.update, body,
|
| - this.forToken) : super(body);
|
| + this.forToken)
|
| + : super(body);
|
|
|
| For asFor() => this;
|
|
|
| @@ -836,8 +842,7 @@ class FunctionExpression extends Expression with StoredTreeElementMixin {
|
| final AsyncModifier asyncModifier;
|
|
|
| FunctionExpression(this.name, this.parameters, this.body, this.returnType,
|
| - this.modifiers, this.initializers, this.getOrSet,
|
| - this.asyncModifier) {
|
| + this.modifiers, this.initializers, this.getOrSet, this.asyncModifier) {
|
| assert(modifiers != null);
|
| }
|
|
|
| @@ -925,7 +930,7 @@ class LiteralInt extends Literal<int> {
|
|
|
| class LiteralDouble extends Literal<double> {
|
| LiteralDouble(Token token, DecodeErrorHandler handler)
|
| - : super(token, handler);
|
| + : super(token, handler);
|
|
|
| LiteralDouble asLiteralDouble() => this;
|
|
|
| @@ -959,9 +964,7 @@ class LiteralBool extends Literal<bool> {
|
| accept(Visitor visitor) => visitor.visitLiteralBool(this);
|
| }
|
|
|
| -
|
| class StringQuoting {
|
| -
|
| /// Cache of common quotings.
|
| static const List<StringQuoting> _mapping = const <StringQuoting>[
|
| const StringQuoting($SQ, raw: false, leftQuoteLength: 1),
|
| @@ -997,7 +1000,7 @@ class StringQuoting {
|
| final bool raw;
|
| final int leftQuoteCharCount;
|
| final int quote;
|
| - const StringQuoting(this.quote, { this.raw, int leftQuoteLength })
|
| + const StringQuoting(this.quote, {this.raw, int leftQuoteLength})
|
| : this.leftQuoteCharCount = leftQuoteLength;
|
| String get quoteChar => identical(quote, $DQ) ? '"' : "'";
|
|
|
| @@ -1152,9 +1155,22 @@ class DottedName extends Expression {
|
| }
|
|
|
| class Operator extends Identifier {
|
| - static const COMPLEX_OPERATORS =
|
| - const ["--", "++", '+=', "-=", "*=", "/=", "%=", "&=", "|=", "~/=", "^=",
|
| - ">>=", "<<=", "??="];
|
| + static const COMPLEX_OPERATORS = const [
|
| + "--",
|
| + "++",
|
| + '+=',
|
| + "-=",
|
| + "*=",
|
| + "/=",
|
| + "%=",
|
| + "&=",
|
| + "|=",
|
| + "~/=",
|
| + "^=",
|
| + ">>=",
|
| + "<<=",
|
| + "??="
|
| + ];
|
|
|
| static const INCREMENT_OPERATORS = const <String>["++", "--"];
|
|
|
| @@ -1221,8 +1237,8 @@ class RedirectingFactoryBody extends Statement with StoredTreeElementMixin {
|
| final Token beginToken;
|
| final Token endToken;
|
|
|
| - RedirectingFactoryBody(this.beginToken, this.endToken,
|
| - this.constructorReference);
|
| + RedirectingFactoryBody(
|
| + this.beginToken, this.endToken, this.constructorReference);
|
|
|
| RedirectingFactoryBody asRedirectingFactoryBody() => this;
|
|
|
| @@ -1330,7 +1346,7 @@ class Rethrow extends Statement {
|
| Rethrow asRethrow() => this;
|
|
|
| accept(Visitor visitor) => visitor.visitRethrow(this);
|
| - visitChildren(Visitor visitor) { }
|
| + visitChildren(Visitor visitor) {}
|
|
|
| Token getBeginToken() => throwToken;
|
| Token getEndToken() => endToken;
|
| @@ -1388,18 +1404,14 @@ class VariableDefinitions extends Statement {
|
| final Modifiers modifiers;
|
| final NodeList definitions;
|
|
|
| - VariableDefinitions(this.type,
|
| - this.modifiers,
|
| - this.definitions)
|
| + VariableDefinitions(this.type, this.modifiers, this.definitions)
|
| : this.metadata = null {
|
| assert(modifiers != null);
|
| }
|
|
|
| // TODO(johnniwinther): Make this its own node type.
|
| - VariableDefinitions.forParameter(this.metadata,
|
| - this.type,
|
| - this.modifiers,
|
| - this.definitions) {
|
| + VariableDefinitions.forParameter(
|
| + this.metadata, this.type, this.modifiers, this.definitions) {
|
| assert(modifiers != null);
|
| }
|
|
|
| @@ -1440,9 +1452,9 @@ class DoWhile extends Loop {
|
|
|
| final Expression condition;
|
|
|
| - DoWhile(Statement body, Expression this.condition,
|
| - Token this.doKeyword, Token this.whileKeyword, Token this.endToken)
|
| - : super(body);
|
| + DoWhile(Statement body, Expression this.condition, Token this.doKeyword,
|
| + Token this.whileKeyword, Token this.endToken)
|
| + : super(body);
|
|
|
| DoWhile asDoWhile() => this;
|
|
|
| @@ -1462,8 +1474,8 @@ class While extends Loop {
|
| final Token whileKeyword;
|
| final Expression condition;
|
|
|
| - While(Expression this.condition, Statement body,
|
| - Token this.whileKeyword) : super(body);
|
| + While(Expression this.condition, Statement body, Token this.whileKeyword)
|
| + : super(body);
|
|
|
| While asWhile() => this;
|
|
|
| @@ -1483,8 +1495,8 @@ class ParenthesizedExpression extends Expression {
|
| final Expression expression;
|
| final BeginGroupToken beginToken;
|
|
|
| - ParenthesizedExpression(Expression this.expression,
|
| - BeginGroupToken this.beginToken);
|
| + ParenthesizedExpression(
|
| + Expression this.expression, BeginGroupToken this.beginToken);
|
|
|
| ParenthesizedExpression asParenthesizedExpression() => this;
|
|
|
| @@ -1533,14 +1545,22 @@ class Modifiers extends Node {
|
| int flags = 0;
|
| for (; !nodes.isEmpty; nodes = nodes.tail) {
|
| String value = nodes.head.asIdentifier().source;
|
| - if (identical(value, 'static')) flags |= FLAG_STATIC;
|
| - else if (identical(value, 'abstract')) flags |= FLAG_ABSTRACT;
|
| - else if (identical(value, 'final')) flags |= FLAG_FINAL;
|
| - else if (identical(value, 'var')) flags |= FLAG_VAR;
|
| - else if (identical(value, 'const')) flags |= FLAG_CONST;
|
| - else if (identical(value, 'factory')) flags |= FLAG_FACTORY;
|
| - else if (identical(value, 'external')) flags |= FLAG_EXTERNAL;
|
| - else throw 'internal error: ${nodes.head}';
|
| + if (identical(value, 'static'))
|
| + flags |= FLAG_STATIC;
|
| + else if (identical(value, 'abstract'))
|
| + flags |= FLAG_ABSTRACT;
|
| + else if (identical(value, 'final'))
|
| + flags |= FLAG_FINAL;
|
| + else if (identical(value, 'var'))
|
| + flags |= FLAG_VAR;
|
| + else if (identical(value, 'const'))
|
| + flags |= FLAG_CONST;
|
| + else if (identical(value, 'factory'))
|
| + flags |= FLAG_FACTORY;
|
| + else if (identical(value, 'external'))
|
| + flags |= FLAG_EXTERNAL;
|
| + else
|
| + throw 'internal error: ${nodes.head}';
|
| }
|
| return flags;
|
| }
|
| @@ -1549,7 +1569,7 @@ class Modifiers extends Node {
|
| Link<Node> nodeList = nodes.nodes;
|
| for (; !nodeList.isEmpty; nodeList = nodeList.tail) {
|
| String value = nodeList.head.asIdentifier().source;
|
| - if(identical(value, modifier)) {
|
| + if (identical(value, modifier)) {
|
| return nodeList.head;
|
| }
|
| }
|
| @@ -1579,13 +1599,14 @@ class Modifiers extends Node {
|
| bool get isFinalOrConst => isFinal || isConst;
|
|
|
| String toString() {
|
| - return modifiersToString(isStatic: isStatic,
|
| - isAbstract: isAbstract,
|
| - isFinal: isFinal,
|
| - isVar: isVar,
|
| - isConst: isConst,
|
| - isFactory: isFactory,
|
| - isExternal: isExternal);
|
| + return modifiersToString(
|
| + isStatic: isStatic,
|
| + isAbstract: isAbstract,
|
| + isFinal: isFinal,
|
| + isVar: isVar,
|
| + isConst: isConst,
|
| + isFactory: isFactory,
|
| + isExternal: isExternal);
|
| }
|
| }
|
|
|
| @@ -1659,7 +1680,7 @@ class StringJuxtaposition extends StringNode {
|
| bool get isInterpolation {
|
| if (isInterpolationCache == null) {
|
| isInterpolationCache = (first.accept(const IsInterpolationVisitor()) ||
|
| - second.accept(const IsInterpolationVisitor()));
|
| + second.accept(const IsInterpolationVisitor()));
|
| }
|
| return isInterpolationCache;
|
| }
|
| @@ -1790,8 +1811,7 @@ class SwitchStatement extends Statement {
|
|
|
| final Token switchKeyword;
|
|
|
| - SwitchStatement(this.parenthesizedExpression, this.cases,
|
| - this.switchKeyword);
|
| + SwitchStatement(this.parenthesizedExpression, this.cases, this.switchKeyword);
|
|
|
| SwitchStatement asSwitchStatement() => this;
|
|
|
| @@ -1840,8 +1860,8 @@ class SwitchCase extends Node {
|
|
|
| final Token startToken;
|
|
|
| - SwitchCase(this.labelsAndCases, this.defaultKeyword,
|
| - this.statements, this.startToken);
|
| + SwitchCase(this.labelsAndCases, this.defaultKeyword, this.statements,
|
| + this.startToken);
|
|
|
| SwitchCase asSwitchCase() => this;
|
|
|
| @@ -1896,7 +1916,7 @@ abstract class GotoStatement extends Statement {
|
|
|
| class BreakStatement extends GotoStatement {
|
| BreakStatement(Identifier target, Token keywordToken, Token semicolonToken)
|
| - : super(target, keywordToken, semicolonToken);
|
| + : super(target, keywordToken, semicolonToken);
|
|
|
| BreakStatement asBreakStatement() => this;
|
|
|
| @@ -1905,7 +1925,7 @@ class BreakStatement extends GotoStatement {
|
|
|
| class ContinueStatement extends GotoStatement {
|
| ContinueStatement(Identifier target, Token keywordToken, Token semicolonToken)
|
| - : super(target, keywordToken, semicolonToken);
|
| + : super(target, keywordToken, semicolonToken);
|
|
|
| ContinueStatement asContinueStatement() => this;
|
|
|
| @@ -1919,8 +1939,8 @@ abstract class ForIn extends Loop {
|
| final Token forToken;
|
| final Token inToken;
|
|
|
| - ForIn(this.declaredIdentifier, this.expression,
|
| - Statement body, this.forToken, this.inToken)
|
| + ForIn(this.declaredIdentifier, this.expression, Statement body, this.forToken,
|
| + this.inToken)
|
| : super(body);
|
|
|
| Expression get condition => null;
|
| @@ -1950,8 +1970,8 @@ class SyncForIn extends ForIn with StoredTreeElementMixin {
|
| class AsyncForIn extends ForIn with StoredTreeElementMixin {
|
| final Token awaitToken;
|
|
|
| - AsyncForIn(declaredIdentifier, expression,
|
| - Statement body, this.awaitToken, forToken, inToken)
|
| + AsyncForIn(declaredIdentifier, expression, Statement body, this.awaitToken,
|
| + forToken, inToken)
|
| : super(declaredIdentifier, expression, body, forToken, inToken);
|
|
|
| AsyncForIn asAsyncForIn() => this;
|
| @@ -2026,10 +2046,8 @@ class LibraryName extends LibraryTag {
|
|
|
| final Token libraryKeyword;
|
|
|
| - LibraryName(this.libraryKeyword,
|
| - this.name,
|
| - List<MetadataAnnotation> metadata)
|
| - : super(metadata);
|
| + LibraryName(this.libraryKeyword, this.name, List<MetadataAnnotation> metadata)
|
| + : super(metadata);
|
|
|
| bool get isLibraryName => true;
|
|
|
| @@ -2054,11 +2072,9 @@ abstract class LibraryDependency extends LibraryTag {
|
| final NodeList conditionalUris;
|
| final NodeList combinators;
|
|
|
| - LibraryDependency(this.uri,
|
| - this.conditionalUris,
|
| - this.combinators,
|
| - List<MetadataAnnotation> metadata)
|
| - : super(metadata);
|
| + LibraryDependency(this.uri, this.conditionalUris, this.combinators,
|
| + List<MetadataAnnotation> metadata)
|
| + : super(metadata);
|
|
|
| LibraryDependency asLibraryDependency() => this;
|
|
|
| @@ -2078,9 +2094,8 @@ class Import extends LibraryDependency {
|
| final bool isDeferred;
|
|
|
| Import(this.importKeyword, StringNode uri, NodeList conditionalUris,
|
| - this.prefix, NodeList combinators,
|
| - List<MetadataAnnotation> metadata,
|
| - {this.isDeferred})
|
| + this.prefix, NodeList combinators, List<MetadataAnnotation> metadata,
|
| + {this.isDeferred})
|
| : super(uri, conditionalUris, combinators, metadata);
|
|
|
| bool get isImport => true;
|
| @@ -2175,11 +2190,8 @@ class Enum extends Node {
|
| class Export extends LibraryDependency {
|
| final Token exportKeyword;
|
|
|
| - Export(this.exportKeyword,
|
| - StringNode uri,
|
| - NodeList conditionalUris,
|
| - NodeList combinators,
|
| - List<MetadataAnnotation> metadata)
|
| + Export(this.exportKeyword, StringNode uri, NodeList conditionalUris,
|
| + NodeList combinators, List<MetadataAnnotation> metadata)
|
| : super(uri, conditionalUris, combinators, metadata);
|
|
|
| bool get isExport => true;
|
| @@ -2208,7 +2220,7 @@ class Part extends LibraryTag {
|
| final Token partKeyword;
|
|
|
| Part(this.partKeyword, this.uri, List<MetadataAnnotation> metadata)
|
| - : super(metadata);
|
| + : super(metadata);
|
|
|
| bool get isPart => true;
|
|
|
| @@ -2279,7 +2291,7 @@ class Typedef extends Node {
|
| final Token endToken;
|
|
|
| Typedef(this.returnType, this.name, this.typeParameters, this.formals,
|
| - this.typedefKeyword, this.endToken);
|
| + this.typedefKeyword, this.endToken);
|
|
|
| Typedef asTypedef() => this;
|
|
|
| @@ -2306,7 +2318,7 @@ class TryStatement extends Statement {
|
| final Token finallyKeyword;
|
|
|
| TryStatement(this.tryBlock, this.catchBlocks, this.finallyBlock,
|
| - this.tryKeyword, this.finallyKeyword);
|
| + this.tryKeyword, this.finallyKeyword);
|
|
|
| TryStatement asTryStatement() => this;
|
|
|
| @@ -2368,8 +2380,8 @@ class CatchBlock extends Node {
|
| final Token onKeyword;
|
| final Token catchKeyword;
|
|
|
| - CatchBlock(this.type, this.formals, this.block,
|
| - this.onKeyword, this.catchKeyword);
|
| + CatchBlock(
|
| + this.type, this.formals, this.block, this.onKeyword, this.catchKeyword);
|
|
|
| CatchBlock asCatchBlock() => this;
|
|
|
| @@ -2422,7 +2434,7 @@ class Metadata extends Node {
|
| class Initializers {
|
| static bool isSuperConstructorCall(Send node) {
|
| return (node.receiver == null && node.selector.isSuper()) ||
|
| - (node.receiver != null &&
|
| + (node.receiver != null &&
|
| node.receiver.isSuper() &&
|
| !node.isConditional &&
|
| node.selector.asIdentifier() != null);
|
| @@ -2430,7 +2442,7 @@ class Initializers {
|
|
|
| static bool isConstructorRedirect(Send node) {
|
| return (node.receiver == null && node.selector.isThis()) ||
|
| - (node.receiver != null &&
|
| + (node.receiver != null &&
|
| node.receiver.isThis() &&
|
| !node.isConditional &&
|
| node.selector.asIdentifier() != null);
|
| @@ -2440,8 +2452,8 @@ class Initializers {
|
| class GetDartStringVisitor extends Visitor<DartString> {
|
| const GetDartStringVisitor();
|
| DartString visitNode(Node node) => null;
|
| - DartString visitStringJuxtaposition(StringJuxtaposition node)
|
| - => node.dartString;
|
| + DartString visitStringJuxtaposition(StringJuxtaposition node) =>
|
| + node.dartString;
|
| DartString visitLiteralString(LiteralString node) => node.dartString;
|
| }
|
|
|
| @@ -2449,15 +2461,14 @@ class IsInterpolationVisitor extends Visitor<bool> {
|
| const IsInterpolationVisitor();
|
| bool visitNode(Node node) => false;
|
| bool visitStringInterpolation(StringInterpolation node) => true;
|
| - bool visitStringJuxtaposition(StringJuxtaposition node)
|
| - => node.isInterpolation;
|
| + bool visitStringJuxtaposition(StringJuxtaposition node) =>
|
| + node.isInterpolation;
|
| }
|
|
|
| /// Erroneous node used to recover from parser errors. Implements various
|
| /// interfaces and provides bare minimum of implementation to avoid unnecessary
|
| /// messages.
|
| -class ErrorNode
|
| - extends Node
|
| +class ErrorNode extends Node
|
| implements FunctionExpression, VariableDefinitions, Typedef {
|
| final Token token;
|
| final String reason;
|
| @@ -2468,8 +2479,8 @@ class ErrorNode
|
|
|
| factory ErrorNode(Token token, String reason) {
|
| Identifier name = new Identifier(token);
|
| - NodeList definitions = new NodeList(
|
| - null, const Link<Node>().prepend(name), null, null);
|
| + NodeList definitions =
|
| + new NodeList(null, const Link<Node>().prepend(name), null, null);
|
| return new ErrorNode.internal(token, reason, name, definitions);
|
| }
|
|
|
|
|