| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library fasta.body_builder; | 5 library fasta.body_builder; |
| 6 | 6 |
| 7 import '../parser/parser.dart' show FormalParameterType, optional; | 7 import '../parser/parser.dart' show FormalParameterType, optional; |
| 8 | 8 |
| 9 import '../parser/error_kind.dart' show ErrorKind; | 9 import '../parser/error_kind.dart' show ErrorKind; |
| 10 | 10 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 | 30 |
| 31 import '../errors.dart' show formatUnexpected, internalError; | 31 import '../errors.dart' show formatUnexpected, internalError; |
| 32 | 32 |
| 33 import '../source/scope_listener.dart' | 33 import '../source/scope_listener.dart' |
| 34 show JumpTargetKind, NullValue, ScopeListener; | 34 show JumpTargetKind, NullValue, ScopeListener; |
| 35 | 35 |
| 36 import '../builder/scope.dart' show ProblemBuilder, Scope; | 36 import '../builder/scope.dart' show ProblemBuilder, Scope; |
| 37 | 37 |
| 38 import '../source/outline_builder.dart' show asyncMarkerFromTokens; | 38 import '../source/outline_builder.dart' show asyncMarkerFromTokens; |
| 39 | 39 |
| 40 import 'builder_accessors.dart'; | 40 import 'fasta_accessors.dart'; |
| 41 | 41 |
| 42 import '../quote.dart' | 42 import '../quote.dart' |
| 43 show | 43 show |
| 44 Quote, | 44 Quote, |
| 45 analyzeQuote, | 45 analyzeQuote, |
| 46 unescape, | 46 unescape, |
| 47 unescapeFirstStringPart, | 47 unescapeFirstStringPart, |
| 48 unescapeLastStringPart, | 48 unescapeLastStringPart, |
| 49 unescapeString; | 49 unescapeString; |
| 50 | 50 |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 if (isDartLibrary && | 148 if (isDartLibrary && |
| 149 node.name.name == "main" && | 149 node.name.name == "main" && |
| 150 library.uri.path == "_builtin" && | 150 library.uri.path == "_builtin" && |
| 151 member?.name == "_getMainClosure") { | 151 member?.name == "_getMainClosure") { |
| 152 // TODO(ahe): https://github.com/dart-lang/sdk/issues/28989 | 152 // TODO(ahe): https://github.com/dart-lang/sdk/issues/28989 |
| 153 return new NullLiteral()..fileOffset = node.fileOffset; | 153 return new NullLiteral()..fileOffset = node.fileOffset; |
| 154 } | 154 } |
| 155 return throwNoSuchMethodError( | 155 return throwNoSuchMethodError( |
| 156 node.name.name, new Arguments.empty(), node.fileOffset, | 156 node.name.name, new Arguments.empty(), node.fileOffset, |
| 157 isGetter: true); | 157 isGetter: true); |
| 158 } else if (node is BuilderAccessor) { | 158 } else if (node is FastaAccessor) { |
| 159 return node.buildSimpleRead(); | 159 return node.buildSimpleRead(); |
| 160 } else if (node is TypeVariableBuilder) { | 160 } else if (node is TypeVariableBuilder) { |
| 161 TypeParameterType type = node.buildTypesWithBuiltArguments(library, null); | 161 TypeParameterType type = node.buildTypesWithBuiltArguments(library, null); |
| 162 if (!isInstanceContext && type.parameter.parent is Class) { | 162 if (!isInstanceContext && type.parameter.parent is Class) { |
| 163 return buildCompileTimeError( | 163 return buildCompileTimeError( |
| 164 "Type variables can only be used in instance methods."); | 164 "Type variables can only be used in instance methods."); |
| 165 } else { | 165 } else { |
| 166 if (constantExpressionRequired) { | 166 if (constantExpressionRequired) { |
| 167 addCompileTimeError(-1, | 167 addCompileTimeError(-1, |
| 168 "Type variable can't be used as a constant expression $type."); | 168 "Type variable can't be used as a constant expression $type."); |
| 169 } | 169 } |
| 170 return new TypeLiteral(type); | 170 return new TypeLiteral(type); |
| 171 } | 171 } |
| 172 } else if (node is TypeDeclarationBuilder) { | 172 } else if (node is TypeDeclarationBuilder) { |
| 173 return new TypeLiteral(node.buildTypesWithBuiltArguments(library, null)); | 173 return new TypeLiteral(node.buildTypesWithBuiltArguments(library, null)); |
| 174 } else if (node is KernelTypeBuilder) { | 174 } else if (node is KernelTypeBuilder) { |
| 175 return new TypeLiteral(node.build(library)); | 175 return new TypeLiteral(node.build(library)); |
| 176 } else if (node is Expression) { | 176 } else if (node is Expression) { |
| 177 return node; | 177 return node; |
| 178 } else if (node is PrefixBuilder) { | 178 } else if (node is PrefixBuilder) { |
| 179 return buildCompileTimeError("A library can't be used as an expression."); | 179 return buildCompileTimeError("A library can't be used as an expression."); |
| 180 } else if (node is ProblemBuilder) { | 180 } else if (node is ProblemBuilder) { |
| 181 return buildProblemExpression(node, -1); | 181 return buildProblemExpression(node, -1); |
| 182 } else { | 182 } else { |
| 183 return internalError("Unhandled: ${node.runtimeType}"); | 183 return internalError("Unhandled: ${node.runtimeType}"); |
| 184 } | 184 } |
| 185 } | 185 } |
| 186 | 186 |
| 187 Expression toEffect(Object node) { | 187 Expression toEffect(Object node) { |
| 188 if (node is BuilderAccessor) return node.buildForEffect(); | 188 if (node is FastaAccessor) return node.buildForEffect(); |
| 189 return toValue(node); | 189 return toValue(node); |
| 190 } | 190 } |
| 191 | 191 |
| 192 List<Expression> popListForValue(int n) { | 192 List<Expression> popListForValue(int n) { |
| 193 List<Expression> list = | 193 List<Expression> list = |
| 194 new List<Expression>.filled(n, null, growable: true); | 194 new List<Expression>.filled(n, null, growable: true); |
| 195 for (int i = n - 1; i >= 0; i--) { | 195 for (int i = n - 1; i >= 0; i--) { |
| 196 list[i] = popForValue(); | 196 list[i] = popForValue(); |
| 197 } | 197 } |
| 198 return list; | 198 return list; |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 382 | 382 |
| 383 @override | 383 @override |
| 384 void endInitializer(Token token) { | 384 void endInitializer(Token token) { |
| 385 debugEvent("endInitializer"); | 385 debugEvent("endInitializer"); |
| 386 assert(!inInitializer); | 386 assert(!inInitializer); |
| 387 final member = this.member; | 387 final member = this.member; |
| 388 var node = pop(); | 388 var node = pop(); |
| 389 Initializer initializer; | 389 Initializer initializer; |
| 390 if (node is Initializer) { | 390 if (node is Initializer) { |
| 391 initializer = node; | 391 initializer = node; |
| 392 } else if (node is BuilderAccessor) { | 392 } else if (node is FastaAccessor) { |
| 393 initializer = node.buildFieldInitializer(fieldInitializers); | 393 initializer = node.buildFieldInitializer(fieldInitializers); |
| 394 } else if (node is ConstructorInvocation) { | 394 } else if (node is ConstructorInvocation) { |
| 395 initializer = new SuperInitializer(node.target, node.arguments); | 395 initializer = new SuperInitializer(node.target, node.arguments); |
| 396 } else { | 396 } else { |
| 397 if (node is! Throw) { | 397 if (node is! Throw) { |
| 398 node = wrapInvalid(node); | 398 node = wrapInvalid(node); |
| 399 } | 399 } |
| 400 initializer = | 400 initializer = |
| 401 new LocalInitializer(new VariableDeclaration.forValue(node)); | 401 new LocalInitializer(new VariableDeclaration.forValue(node)); |
| 402 } | 402 } |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 517 } | 517 } |
| 518 | 518 |
| 519 @override | 519 @override |
| 520 finishSend(Object receiver, Arguments arguments, int charOffset) { | 520 finishSend(Object receiver, Arguments arguments, int charOffset) { |
| 521 bool isIdentical(Object receiver) { | 521 bool isIdentical(Object receiver) { |
| 522 return receiver is StaticAccessor && | 522 return receiver is StaticAccessor && |
| 523 receiver.readTarget == | 523 receiver.readTarget == |
| 524 coreTypes.tryGetTopLevelMember("dart:core", null, "identical"); | 524 coreTypes.tryGetTopLevelMember("dart:core", null, "identical"); |
| 525 } | 525 } |
| 526 | 526 |
| 527 if (receiver is BuilderAccessor) { | 527 if (receiver is FastaAccessor) { |
| 528 if (constantExpressionRequired && !isIdentical(receiver)) { | 528 if (constantExpressionRequired && !isIdentical(receiver)) { |
| 529 addCompileTimeError(charOffset, "Not a constant expression."); | 529 addCompileTimeError(charOffset, "Not a constant expression."); |
| 530 } | 530 } |
| 531 return receiver.doInvocation(charOffset, arguments); | 531 return receiver.doInvocation(charOffset, arguments); |
| 532 } else if (receiver is UnresolvedIdentifier) { | 532 } else if (receiver is UnresolvedIdentifier) { |
| 533 return throwNoSuchMethodError( | 533 return throwNoSuchMethodError( |
| 534 receiver.name.name, arguments, receiver.fileOffset); | 534 receiver.name.name, arguments, receiver.fileOffset); |
| 535 } else { | 535 } else { |
| 536 return buildMethodInvocation( | 536 return buildMethodInvocation( |
| 537 toValue(receiver), callName, arguments, charOffset); | 537 toValue(receiver), callName, arguments, charOffset); |
| (...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1029 } | 1029 } |
| 1030 | 1030 |
| 1031 @override | 1031 @override |
| 1032 void handleAssignmentExpression(Token token) { | 1032 void handleAssignmentExpression(Token token) { |
| 1033 debugEvent("AssignmentExpression"); | 1033 debugEvent("AssignmentExpression"); |
| 1034 Expression value = popForValue(); | 1034 Expression value = popForValue(); |
| 1035 var accessor = pop(); | 1035 var accessor = pop(); |
| 1036 if (accessor is TypeDeclarationBuilder) { | 1036 if (accessor is TypeDeclarationBuilder) { |
| 1037 push(wrapInvalid(new TypeLiteral( | 1037 push(wrapInvalid(new TypeLiteral( |
| 1038 accessor.buildTypesWithBuiltArguments(library, null)))); | 1038 accessor.buildTypesWithBuiltArguments(library, null)))); |
| 1039 } else if (accessor is! BuilderAccessor) { | 1039 } else if (accessor is! FastaAccessor) { |
| 1040 push(buildCompileTimeError("Can't assign to this.", token.charOffset)); | 1040 push(buildCompileTimeError("Can't assign to this.", token.charOffset)); |
| 1041 } else { | 1041 } else { |
| 1042 push(new DelayedAssignment( | 1042 push(new DelayedAssignment( |
| 1043 this, token.charOffset, accessor, value, token.stringValue)); | 1043 this, token.charOffset, accessor, value, token.stringValue)); |
| 1044 } | 1044 } |
| 1045 } | 1045 } |
| 1046 | 1046 |
| 1047 @override | 1047 @override |
| 1048 void enterLoop(int charOffset) { | 1048 void enterLoop(int charOffset) { |
| 1049 if (peek() is LabelTarget) { | 1049 if (peek() is LabelTarget) { |
| (...skipping 24 matching lines...) Expand all Loading... |
| 1074 Statement conditionStatement = popStatement(); | 1074 Statement conditionStatement = popStatement(); |
| 1075 Expression condition = null; | 1075 Expression condition = null; |
| 1076 if (conditionStatement is ExpressionStatement) { | 1076 if (conditionStatement is ExpressionStatement) { |
| 1077 condition = conditionStatement.expression; | 1077 condition = conditionStatement.expression; |
| 1078 } else { | 1078 } else { |
| 1079 assert(conditionStatement is EmptyStatement); | 1079 assert(conditionStatement is EmptyStatement); |
| 1080 } | 1080 } |
| 1081 List<VariableDeclaration> variables = <VariableDeclaration>[]; | 1081 List<VariableDeclaration> variables = <VariableDeclaration>[]; |
| 1082 dynamic variableOrExpression = pop(); | 1082 dynamic variableOrExpression = pop(); |
| 1083 Statement begin; | 1083 Statement begin; |
| 1084 if (variableOrExpression is BuilderAccessor) { | 1084 if (variableOrExpression is FastaAccessor) { |
| 1085 variableOrExpression = variableOrExpression.buildForEffect(); | 1085 variableOrExpression = variableOrExpression.buildForEffect(); |
| 1086 } | 1086 } |
| 1087 if (variableOrExpression is VariableDeclaration) { | 1087 if (variableOrExpression is VariableDeclaration) { |
| 1088 variables.add(variableOrExpression); | 1088 variables.add(variableOrExpression); |
| 1089 } else if (variableOrExpression is List) { | 1089 } else if (variableOrExpression is List) { |
| 1090 // TODO(sigmund): remove this assignment (see issue #28651) | 1090 // TODO(sigmund): remove this assignment (see issue #28651) |
| 1091 Iterable vars = variableOrExpression; | 1091 Iterable vars = variableOrExpression; |
| 1092 variables.addAll(vars); | 1092 variables.addAll(vars); |
| 1093 } else if (variableOrExpression == null) { | 1093 } else if (variableOrExpression == null) { |
| 1094 // Do nothing. | 1094 // Do nothing. |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1286 } else { | 1286 } else { |
| 1287 push(const DynamicType()); | 1287 push(const DynamicType()); |
| 1288 addCompileTimeError(beginToken.charOffset, | 1288 addCompileTimeError(beginToken.charOffset, |
| 1289 "Can't be used as a type: '${debugName(prefix, suffix)}'."); | 1289 "Can't be used as a type: '${debugName(prefix, suffix)}'."); |
| 1290 return; | 1290 return; |
| 1291 } | 1291 } |
| 1292 } | 1292 } |
| 1293 if (name is Identifier) { | 1293 if (name is Identifier) { |
| 1294 name = name.name; | 1294 name = name.name; |
| 1295 } | 1295 } |
| 1296 if (name is BuilderAccessor) { | 1296 if (name is FastaAccessor) { |
| 1297 warning("'${beginToken.lexeme}' isn't a type.", beginToken.charOffset); | 1297 warning("'${beginToken.lexeme}' isn't a type.", beginToken.charOffset); |
| 1298 push(const DynamicType()); | 1298 push(const DynamicType()); |
| 1299 } else if (name is UnresolvedIdentifier) { | 1299 } else if (name is UnresolvedIdentifier) { |
| 1300 warning("'${name.name}' isn't a type.", beginToken.charOffset); | 1300 warning("'${name.name}' isn't a type.", beginToken.charOffset); |
| 1301 push(const DynamicType()); | 1301 push(const DynamicType()); |
| 1302 } else if (name is TypeVariableBuilder) { | 1302 } else if (name is TypeVariableBuilder) { |
| 1303 if (constantExpressionRequired) { | 1303 if (constantExpressionRequired) { |
| 1304 addCompileTimeError( | 1304 addCompileTimeError( |
| 1305 beginToken.charOffset, "Not a constant expression."); | 1305 beginToken.charOffset, "Not a constant expression."); |
| 1306 } | 1306 } |
| (...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1593 Name incrementOperator(Token token) { | 1593 Name incrementOperator(Token token) { |
| 1594 if (optional("++", token)) return plusName; | 1594 if (optional("++", token)) return plusName; |
| 1595 if (optional("--", token)) return minusName; | 1595 if (optional("--", token)) return minusName; |
| 1596 return internalError("Unknown increment operator: ${token.lexeme}"); | 1596 return internalError("Unknown increment operator: ${token.lexeme}"); |
| 1597 } | 1597 } |
| 1598 | 1598 |
| 1599 @override | 1599 @override |
| 1600 void handleUnaryPrefixAssignmentExpression(Token token) { | 1600 void handleUnaryPrefixAssignmentExpression(Token token) { |
| 1601 debugEvent("UnaryPrefixAssignmentExpression"); | 1601 debugEvent("UnaryPrefixAssignmentExpression"); |
| 1602 var accessor = pop(); | 1602 var accessor = pop(); |
| 1603 if (accessor is BuilderAccessor) { | 1603 if (accessor is FastaAccessor) { |
| 1604 push(accessor.buildPrefixIncrement(incrementOperator(token), | 1604 push(accessor.buildPrefixIncrement(incrementOperator(token), |
| 1605 offset: token.charOffset)); | 1605 offset: token.charOffset)); |
| 1606 } else { | 1606 } else { |
| 1607 push(wrapInvalid(toValue(accessor))); | 1607 push(wrapInvalid(toValue(accessor))); |
| 1608 } | 1608 } |
| 1609 } | 1609 } |
| 1610 | 1610 |
| 1611 @override | 1611 @override |
| 1612 void handleUnaryPostfixAssignmentExpression(Token token) { | 1612 void handleUnaryPostfixAssignmentExpression(Token token) { |
| 1613 debugEvent("UnaryPostfixAssignmentExpression"); | 1613 debugEvent("UnaryPostfixAssignmentExpression"); |
| 1614 var accessor = pop(); | 1614 var accessor = pop(); |
| 1615 if (accessor is BuilderAccessor) { | 1615 if (accessor is FastaAccessor) { |
| 1616 push(new DelayedPostfixIncrement( | 1616 push(new DelayedPostfixIncrement( |
| 1617 this, token.charOffset, accessor, incrementOperator(token), null)); | 1617 this, token.charOffset, accessor, incrementOperator(token), null)); |
| 1618 } else { | 1618 } else { |
| 1619 push(wrapInvalid(toValue(accessor))); | 1619 push(wrapInvalid(toValue(accessor))); |
| 1620 } | 1620 } |
| 1621 } | 1621 } |
| 1622 | 1622 |
| 1623 @override | 1623 @override |
| 1624 void endConstructorReference( | 1624 void endConstructorReference( |
| 1625 Token start, Token periodBeforeName, Token endToken) { | 1625 Token start, Token periodBeforeName, Token endToken) { |
| (...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1978 exitLocalScope(); | 1978 exitLocalScope(); |
| 1979 JumpTarget continueTarget = exitContinueTarget(); | 1979 JumpTarget continueTarget = exitContinueTarget(); |
| 1980 JumpTarget breakTarget = exitBreakTarget(); | 1980 JumpTarget breakTarget = exitBreakTarget(); |
| 1981 if (continueTarget.hasUsers) { | 1981 if (continueTarget.hasUsers) { |
| 1982 body = new LabeledStatement(body); | 1982 body = new LabeledStatement(body); |
| 1983 continueTarget.resolveContinues(body); | 1983 continueTarget.resolveContinues(body); |
| 1984 } | 1984 } |
| 1985 VariableDeclaration variable; | 1985 VariableDeclaration variable; |
| 1986 if (lvalue is VariableDeclaration) { | 1986 if (lvalue is VariableDeclaration) { |
| 1987 variable = lvalue; | 1987 variable = lvalue; |
| 1988 } else if (lvalue is BuilderAccessor) { | 1988 } else if (lvalue is FastaAccessor) { |
| 1989 /// We are in this case, where `lvalue` isn't a [VariableDeclaration]: | 1989 /// We are in this case, where `lvalue` isn't a [VariableDeclaration]: |
| 1990 /// | 1990 /// |
| 1991 /// for (lvalue in expression) body | 1991 /// for (lvalue in expression) body |
| 1992 /// | 1992 /// |
| 1993 /// This is normalized to: | 1993 /// This is normalized to: |
| 1994 /// | 1994 /// |
| 1995 /// for (final #t in expression) { | 1995 /// for (final #t in expression) { |
| 1996 /// lvalue = #t; | 1996 /// lvalue = #t; |
| 1997 /// body; | 1997 /// body; |
| 1998 /// } | 1998 /// } |
| (...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2479 nextCascade = newCascade; | 2479 nextCascade = newCascade; |
| 2480 } | 2480 } |
| 2481 | 2481 |
| 2482 void finalize(Expression expression) { | 2482 void finalize(Expression expression) { |
| 2483 assert(nextCascade.variable.initializer is InvalidExpression); | 2483 assert(nextCascade.variable.initializer is InvalidExpression); |
| 2484 nextCascade.variable.initializer = expression; | 2484 nextCascade.variable.initializer = expression; |
| 2485 expression.parent = nextCascade.variable; | 2485 expression.parent = nextCascade.variable; |
| 2486 } | 2486 } |
| 2487 } | 2487 } |
| 2488 | 2488 |
| 2489 abstract class ContextAccessor extends BuilderAccessor { | 2489 abstract class ContextAccessor extends FastaAccessor { |
| 2490 final BuilderHelper helper; | 2490 final BuilderHelper helper; |
| 2491 | 2491 |
| 2492 final BuilderAccessor accessor; | 2492 final FastaAccessor accessor; |
| 2493 | 2493 |
| 2494 final int offset; | 2494 final int offset; |
| 2495 | 2495 |
| 2496 ContextAccessor(this.helper, this.offset, this.accessor); | 2496 ContextAccessor(this.helper, this.offset, this.accessor); |
| 2497 | 2497 |
| 2498 @override | 2498 @override |
| 2499 Expression get builtBinary => internalError("Unsupported operation."); | 2499 Expression get builtBinary => internalError("Unsupported operation."); |
| 2500 | 2500 |
| 2501 @override | 2501 @override |
| 2502 void set builtBinary(Expression expression) { | 2502 void set builtBinary(Expression expression) { |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2558 "Can't be used as left-hand side of assignment.", offset); | 2558 "Can't be used as left-hand side of assignment.", offset); |
| 2559 } | 2559 } |
| 2560 } | 2560 } |
| 2561 | 2561 |
| 2562 class DelayedAssignment extends ContextAccessor { | 2562 class DelayedAssignment extends ContextAccessor { |
| 2563 final Expression value; | 2563 final Expression value; |
| 2564 | 2564 |
| 2565 final String assignmentOperator; | 2565 final String assignmentOperator; |
| 2566 | 2566 |
| 2567 DelayedAssignment(BuilderHelper helper, int charOffset, | 2567 DelayedAssignment(BuilderHelper helper, int charOffset, |
| 2568 BuilderAccessor accessor, this.value, this.assignmentOperator) | 2568 FastaAccessor accessor, this.value, this.assignmentOperator) |
| 2569 : super(helper, charOffset, accessor); | 2569 : super(helper, charOffset, accessor); |
| 2570 | 2570 |
| 2571 Expression buildSimpleRead() { | 2571 Expression buildSimpleRead() { |
| 2572 return handleAssignment(false); | 2572 return handleAssignment(false); |
| 2573 } | 2573 } |
| 2574 | 2574 |
| 2575 Expression buildForEffect() { | 2575 Expression buildForEffect() { |
| 2576 return handleAssignment(true); | 2576 return handleAssignment(true); |
| 2577 } | 2577 } |
| 2578 | 2578 |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2636 return accessor.buildFieldInitializer(initializers); | 2636 return accessor.buildFieldInitializer(initializers); |
| 2637 } | 2637 } |
| 2638 } | 2638 } |
| 2639 | 2639 |
| 2640 class DelayedPostfixIncrement extends ContextAccessor { | 2640 class DelayedPostfixIncrement extends ContextAccessor { |
| 2641 final Name binaryOperator; | 2641 final Name binaryOperator; |
| 2642 | 2642 |
| 2643 final Procedure interfaceTarget; | 2643 final Procedure interfaceTarget; |
| 2644 | 2644 |
| 2645 DelayedPostfixIncrement(BuilderHelper helper, int offset, | 2645 DelayedPostfixIncrement(BuilderHelper helper, int offset, |
| 2646 BuilderAccessor accessor, this.binaryOperator, this.interfaceTarget) | 2646 FastaAccessor accessor, this.binaryOperator, this.interfaceTarget) |
| 2647 : super(helper, offset, accessor); | 2647 : super(helper, offset, accessor); |
| 2648 | 2648 |
| 2649 Expression buildSimpleRead() { | 2649 Expression buildSimpleRead() { |
| 2650 return accessor.buildPostfixIncrement(binaryOperator, | 2650 return accessor.buildPostfixIncrement(binaryOperator, |
| 2651 offset: offset, voidContext: false, interfaceTarget: interfaceTarget); | 2651 offset: offset, voidContext: false, interfaceTarget: interfaceTarget); |
| 2652 } | 2652 } |
| 2653 | 2653 |
| 2654 Expression buildForEffect() { | 2654 Expression buildForEffect() { |
| 2655 return accessor.buildPostfixIncrement(binaryOperator, | 2655 return accessor.buildPostfixIncrement(binaryOperator, |
| 2656 offset: offset, voidContext: true, interfaceTarget: interfaceTarget); | 2656 offset: offset, voidContext: true, interfaceTarget: interfaceTarget); |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2873 if (node is Identifier) { | 2873 if (node is Identifier) { |
| 2874 return node.name; | 2874 return node.name; |
| 2875 } else if (node is UnresolvedIdentifier) { | 2875 } else if (node is UnresolvedIdentifier) { |
| 2876 return node.name.name; | 2876 return node.name.name; |
| 2877 } else if (node is TypeDeclarationBuilder) { | 2877 } else if (node is TypeDeclarationBuilder) { |
| 2878 return node.name; | 2878 return node.name; |
| 2879 } else if (node is PrefixBuilder) { | 2879 } else if (node is PrefixBuilder) { |
| 2880 return node.name; | 2880 return node.name; |
| 2881 } else if (node is ThisAccessor) { | 2881 } else if (node is ThisAccessor) { |
| 2882 return node.isSuper ? "super" : "this"; | 2882 return node.isSuper ? "super" : "this"; |
| 2883 } else if (node is BuilderAccessor) { | 2883 } else if (node is FastaAccessor) { |
| 2884 return node.plainNameForRead; | 2884 return node.plainNameForRead; |
| 2885 } else { | 2885 } else { |
| 2886 return internalError("Unhandled: ${node.runtimeType}"); | 2886 return internalError("Unhandled: ${node.runtimeType}"); |
| 2887 } | 2887 } |
| 2888 } | 2888 } |
| OLD | NEW |