| Index: dart/lib/compiler/implementation/tree/nodes.dart
|
| diff --git a/dart/lib/compiler/implementation/tree/nodes.dart b/dart/lib/compiler/implementation/tree/nodes.dart
|
| index 1b073565099cf59cfdd477a1a24276f403ef6be0..595ca0bf4f22e331f36392b4a3d76f9950004c86 100644
|
| --- a/dart/lib/compiler/implementation/tree/nodes.dart
|
| +++ b/dart/lib/compiler/implementation/tree/nodes.dart
|
| @@ -211,9 +211,9 @@ class ClassNode extends Node {
|
| if (body !== null) body.accept(visitor);
|
| }
|
|
|
| - bool get isInterface() => beginToken.stringValue === 'interface';
|
| + bool get isInterface => beginToken.stringValue === 'interface';
|
|
|
| - bool get isClass() => !isInterface;
|
| + bool get isClass => !isInterface;
|
|
|
| Token getBeginToken() => beginToken;
|
|
|
| @@ -251,7 +251,7 @@ class Send extends Expression {
|
| final Node receiver;
|
| final Node selector;
|
| final NodeList argumentsNode;
|
| - Link<Node> get arguments() => argumentsNode.nodes;
|
| + Link<Node> get arguments => argumentsNode.nodes;
|
|
|
| Send([this.receiver, this.selector, this.argumentsNode]);
|
| Send.postfix(this.receiver, this.selector, [Node argument = null])
|
| @@ -275,22 +275,22 @@ class Send extends Expression {
|
|
|
| int argumentCount() => (argumentsNode === null) ? -1 : argumentsNode.length();
|
|
|
| - bool get isSuperCall() {
|
| + bool get isSuperCall {
|
| return receiver !== null &&
|
| receiver.asIdentifier() !== null &&
|
| receiver.asIdentifier().isSuper();
|
| }
|
| - bool get isOperator() => selector is Operator;
|
| - bool get isPropertyAccess() => argumentsNode === null;
|
| - bool get isFunctionObjectInvocation() => selector === null;
|
| - bool get isPrefix() => argumentsNode is Prefix;
|
| - bool get isPostfix() => argumentsNode is Postfix;
|
| - bool get isCall() => !isOperator && !isPropertyAccess;
|
| - bool get isIndex() =>
|
| + bool get isOperator => selector is Operator;
|
| + bool get isPropertyAccess => argumentsNode === null;
|
| + bool get isFunctionObjectInvocation => selector === null;
|
| + bool get isPrefix => argumentsNode is Prefix;
|
| + bool get isPostfix => argumentsNode is Postfix;
|
| + bool get isCall => !isOperator && !isPropertyAccess;
|
| + bool get isIndex =>
|
| isOperator && selector.asOperator().source.stringValue === '[]';
|
| - bool get isLogicalAnd() =>
|
| + bool get isLogicalAnd =>
|
| isOperator && selector.asOperator().source.stringValue === '&&';
|
| - bool get isLogicalOr() =>
|
| + bool get isLogicalOr =>
|
| isOperator && selector.asOperator().source.stringValue === '||';
|
|
|
| Token getBeginToken() {
|
| @@ -482,7 +482,7 @@ class If extends Statement {
|
|
|
| If asIf() => this;
|
|
|
| - bool get hasElsePart() => elsePart !== null;
|
| + bool get hasElsePart => elsePart !== null;
|
|
|
| void validate() {
|
| // TODO(ahe): Check that condition has size one.
|
| @@ -544,7 +544,7 @@ class For extends Loop {
|
|
|
| For asFor() => this;
|
|
|
| - Expression get condition() {
|
| + Expression get condition {
|
| if (conditionStatement is ExpressionStatement) {
|
| return conditionStatement.asExpressionStatement().expression;
|
| } else {
|
| @@ -660,7 +660,7 @@ class LiteralInt extends Literal<int> {
|
|
|
| LiteralInt asLiteralInt() => this;
|
|
|
| - int get value() {
|
| + int get value {
|
| try {
|
| Token valueToken = token;
|
| if (valueToken.kind === PLUS_TOKEN) valueToken = valueToken.next;
|
| @@ -679,7 +679,7 @@ class LiteralDouble extends Literal<double> {
|
|
|
| LiteralDouble asLiteralDouble() => this;
|
|
|
| - double get value() {
|
| + double get value {
|
| try {
|
| Token valueToken = token;
|
| if (valueToken.kind === PLUS_TOKEN) valueToken = valueToken.next;
|
| @@ -697,7 +697,7 @@ class LiteralBool extends Literal<bool> {
|
|
|
| LiteralBool asLiteralBool() => this;
|
|
|
| - bool get value() {
|
| + bool get value {
|
| if (token.value == Keyword.TRUE) return true;
|
| if (token.value == Keyword.FALSE) return false;
|
| (this.handler)(token, "not a bool ${token.value}");
|
| @@ -765,10 +765,10 @@ class StringQuoting {
|
| final int quote;
|
| const StringQuoting(this.quote, [bool raw, int leftQuoteLength])
|
| : this.raw = raw, this.leftQuoteCharCount = leftQuoteLength;
|
| - String get quoteChar() => quote === $DQ ? '"' : "'";
|
| + String get quoteChar => quote === $DQ ? '"' : "'";
|
|
|
| - int get leftQuoteLength() => (raw ? 1 : 0) + leftQuoteCharCount;
|
| - int get rightQuoteLength() => (leftQuoteCharCount > 2) ? 3 : 1;
|
| + int get leftQuoteLength => (raw ? 1 : 0) + leftQuoteCharCount;
|
| + int get rightQuoteLength => (leftQuoteCharCount > 2) ? 3 : 1;
|
| static StringQuoting getQuoting(int quote, bool raw, int quoteLength) {
|
| int index = quoteLength - 1;
|
| if (quoteLength > 2) index -= 1;
|
| @@ -797,7 +797,7 @@ class LiteralString extends StringNode {
|
|
|
| void visitChildren(Visitor visitor) {}
|
|
|
| - bool get isInterpolation() => false;
|
| + bool get isInterpolation => false;
|
| bool isValidated() => dartString !== null;
|
|
|
| Token getBeginToken() => token;
|
| @@ -811,7 +811,7 @@ class LiteralNull extends Literal<SourceString> {
|
|
|
| LiteralNull asLiteralNull() => this;
|
|
|
| - SourceString get value() => null;
|
| + SourceString get value => null;
|
|
|
| accept(Visitor visitor) => visitor.visitLiteralNull(this);
|
| }
|
| @@ -845,7 +845,7 @@ class LiteralList extends Expression {
|
| class Identifier extends Expression {
|
| final Token token;
|
|
|
| - SourceString get source() => token.value;
|
| + SourceString get source => token.value;
|
|
|
| Identifier(Token this.token);
|
|
|
| @@ -881,7 +881,7 @@ class Return extends Statement {
|
|
|
| Return asReturn() => this;
|
|
|
| - bool get hasExpression() => expression !== null;
|
| + bool get hasExpression => expression !== null;
|
|
|
| accept(Visitor visitor) => visitor.visitReturn(this);
|
|
|
| @@ -1163,8 +1163,8 @@ class StringInterpolation extends StringNode {
|
|
|
| StringInterpolation asStringInterpolation() => this;
|
|
|
| - DartString get dartString() => null;
|
| - bool get isInterpolation() => true;
|
| + DartString get dartString => null;
|
| + bool get isInterpolation => true;
|
|
|
| accept(Visitor visitor) => visitor.visitStringInterpolation(this);
|
|
|
| @@ -1222,7 +1222,7 @@ class StringJuxtaposition extends StringNode {
|
|
|
| StringJuxtaposition asStringJuxtaposition() => this;
|
|
|
| - bool get isInterpolation() {
|
| + bool get isInterpolation {
|
| if (isInterpolationCache === null) {
|
| isInterpolationCache = (first.accept(const IsInterpolationVisitor()) ||
|
| second.accept(const IsInterpolationVisitor()));
|
| @@ -1235,7 +1235,7 @@ class StringJuxtaposition extends StringNode {
|
| * of string literals.
|
| * Should only be called if [isInterpolation] returns false.
|
| */
|
| - DartString get dartString() {
|
| + DartString get dartString {
|
| if (isInterpolation) {
|
| throw new NodeAssertionFailure(this,
|
| "Getting dartString on interpolation;");
|
| @@ -1361,7 +1361,7 @@ class SwitchStatement extends Statement {
|
|
|
| SwitchStatement asSwitchStatement() => this;
|
|
|
| - Expression get expression() => parenthesizedExpression.expression;
|
| + Expression get expression => parenthesizedExpression.expression;
|
|
|
| accept(Visitor visitor) => visitor.visitSwitchStatement(this);
|
|
|
| @@ -1411,7 +1411,7 @@ class SwitchCase extends Node {
|
|
|
| SwitchCase asSwitchCase() => this;
|
|
|
| - bool get isDefaultCase() => defaultKeyword !== null;
|
| + bool get isDefaultCase => defaultKeyword !== null;
|
|
|
| bool isValidContinueTarget() => true;
|
|
|
| @@ -1488,7 +1488,7 @@ class ForIn extends Loop {
|
| ForIn(this.declaredIdentifier, this.expression,
|
| Statement body, this.forToken, this.inToken) : super(body);
|
|
|
| - Expression get condition() => null;
|
| + Expression get condition => null;
|
|
|
| ForIn asForIn() => this;
|
|
|
| @@ -1688,13 +1688,13 @@ class CatchBlock extends Node {
|
|
|
| accept(Visitor visitor) => visitor.visitCatchBlock(this);
|
|
|
| - Node get exception() {
|
| + Node get exception {
|
| if (formals.nodes.isEmpty()) return null;
|
| VariableDefinitions declarations = formals.nodes.head;
|
| return declarations.definitions.nodes.head;
|
| }
|
|
|
| - Node get trace() {
|
| + Node get trace {
|
| if (formals.nodes.isEmpty()) return null;
|
| Link<Node> declarations = formals.nodes.tail;
|
| if (declarations.isEmpty()) return null;
|
|
|