OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 dart2js.resolution.send_structure; | 5 library dart2js.resolution.send_structure; |
6 | 6 |
7 import '../common.dart'; | 7 import '../common.dart'; |
8 import '../constants/expressions.dart'; | 8 import '../constants/expressions.dart'; |
9 import '../elements/resolution_types.dart'; | 9 import '../elements/resolution_types.dart'; |
10 import '../elements/elements.dart'; | 10 import '../elements/elements.dart'; |
(...skipping 2185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2196 /// `const C()`. | 2196 /// `const C()`. |
2197 class ConstInvokeStructure<R, A> extends NewStructure<R, A> { | 2197 class ConstInvokeStructure<R, A> extends NewStructure<R, A> { |
2198 final ConstantInvokeKind constantInvokeKind; | 2198 final ConstantInvokeKind constantInvokeKind; |
2199 final ConstantExpression constant; | 2199 final ConstantExpression constant; |
2200 | 2200 |
2201 ConstInvokeStructure(this.constantInvokeKind, this.constant); | 2201 ConstInvokeStructure(this.constantInvokeKind, this.constant); |
2202 | 2202 |
2203 @override | 2203 @override |
2204 NewStructureKind get kind => NewStructureKind.CONST_INVOKE; | 2204 NewStructureKind get kind => NewStructureKind.CONST_INVOKE; |
2205 | 2205 |
| 2206 // ignore: MISSING_RETURN |
2206 R dispatch(SemanticSendVisitor<R, A> visitor, NewExpression node, A arg) { | 2207 R dispatch(SemanticSendVisitor<R, A> visitor, NewExpression node, A arg) { |
2207 switch (constantInvokeKind) { | 2208 switch (constantInvokeKind) { |
2208 case ConstantInvokeKind.CONSTRUCTED: | 2209 case ConstantInvokeKind.CONSTRUCTED: |
2209 return visitor.visitConstConstructorInvoke(node, constant, arg); | 2210 return visitor.visitConstConstructorInvoke(node, constant, arg); |
2210 case ConstantInvokeKind.BOOL_FROM_ENVIRONMENT: | 2211 case ConstantInvokeKind.BOOL_FROM_ENVIRONMENT: |
2211 return visitor.visitBoolFromEnvironmentConstructorInvoke( | 2212 return visitor.visitBoolFromEnvironmentConstructorInvoke( |
2212 node, constant, arg); | 2213 node, constant, arg); |
2213 case ConstantInvokeKind.INT_FROM_ENVIRONMENT: | 2214 case ConstantInvokeKind.INT_FROM_ENVIRONMENT: |
2214 return visitor.visitIntFromEnvironmentConstructorInvoke( | 2215 return visitor.visitIntFromEnvironmentConstructorInvoke( |
2215 node, constant, arg); | 2216 node, constant, arg); |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2394 | 2395 |
2395 R dispatch(SemanticDeclarationVisitor<R, A> visitor, | 2396 R dispatch(SemanticDeclarationVisitor<R, A> visitor, |
2396 VariableDefinitions definitions, A arg); | 2397 VariableDefinitions definitions, A arg); |
2397 } | 2398 } |
2398 | 2399 |
2399 class NonConstantVariableStructure<R, A> extends VariableStructure<R, A> { | 2400 class NonConstantVariableStructure<R, A> extends VariableStructure<R, A> { |
2400 NonConstantVariableStructure( | 2401 NonConstantVariableStructure( |
2401 VariableKind kind, Node node, VariableElement variable) | 2402 VariableKind kind, Node node, VariableElement variable) |
2402 : super(kind, node, variable); | 2403 : super(kind, node, variable); |
2403 | 2404 |
| 2405 // ignore: MISSING_RETURN |
2404 R dispatch(SemanticDeclarationVisitor<R, A> visitor, | 2406 R dispatch(SemanticDeclarationVisitor<R, A> visitor, |
2405 VariableDefinitions definitions, A arg) { | 2407 VariableDefinitions definitions, A arg) { |
2406 switch (kind) { | 2408 switch (kind) { |
2407 case VariableKind.TOP_LEVEL_FIELD: | 2409 case VariableKind.TOP_LEVEL_FIELD: |
2408 return visitor.visitTopLevelFieldDeclaration( | 2410 return visitor.visitTopLevelFieldDeclaration( |
2409 definitions, node, variable, variable.initializer, arg); | 2411 definitions, node, variable, variable.initializer, arg); |
2410 case VariableKind.STATIC_FIELD: | 2412 case VariableKind.STATIC_FIELD: |
2411 return visitor.visitStaticFieldDeclaration( | 2413 return visitor.visitStaticFieldDeclaration( |
2412 definitions, node, variable, variable.initializer, arg); | 2414 definitions, node, variable, variable.initializer, arg); |
2413 case VariableKind.INSTANCE_FIELD: | 2415 case VariableKind.INSTANCE_FIELD: |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2512 ThisConstructorInvokeStructure( | 2514 ThisConstructorInvokeStructure( |
2513 this.node, this.constructor, this.callStructure); | 2515 this.node, this.constructor, this.callStructure); |
2514 | 2516 |
2515 R dispatch(SemanticDeclarationVisitor<R, A> visitor, A arg) { | 2517 R dispatch(SemanticDeclarationVisitor<R, A> visitor, A arg) { |
2516 return visitor.visitThisConstructorInvoke( | 2518 return visitor.visitThisConstructorInvoke( |
2517 node, constructor, node.argumentsNode, callStructure, arg); | 2519 node, constructor, node.argumentsNode, callStructure, arg); |
2518 } | 2520 } |
2519 | 2521 |
2520 bool get isConstructorInvoke => true; | 2522 bool get isConstructorInvoke => true; |
2521 } | 2523 } |
OLD | NEW |