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.md file. | 3 // BSD-style license that can be found in the LICENSE.md file. |
4 | 4 |
5 import 'package:kernel/ast.dart' as ir; | 5 import 'package:kernel/ast.dart' as ir; |
6 import 'package:kernel/frontend/accessors.dart' | 6 import 'package:kernel/frontend/accessors.dart' |
7 show | 7 show |
8 Accessor, | 8 Accessor, |
9 IndexAccessor, | 9 IndexAccessor, |
10 NullAwarePropertyAccessor, | 10 NullAwarePropertyAccessor, |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 DoWhile, | 98 DoWhile, |
99 DottedName, | 99 DottedName, |
100 EmptyStatement, | 100 EmptyStatement, |
101 Enum, | 101 Enum, |
102 Expression, | 102 Expression, |
103 ExpressionStatement, | 103 ExpressionStatement, |
104 For, | 104 For, |
105 ForIn, | 105 ForIn, |
106 FunctionDeclaration, | 106 FunctionDeclaration, |
107 FunctionExpression, | 107 FunctionExpression, |
108 FunctionTypeAnnotation, | |
109 Identifier, | 108 Identifier, |
110 If, | 109 If, |
111 Label, | 110 Label, |
112 LabeledStatement, | 111 LabeledStatement, |
113 LiteralBool, | 112 LiteralBool, |
114 LiteralDouble, | 113 LiteralDouble, |
115 LiteralInt, | 114 LiteralInt, |
116 LiteralList, | 115 LiteralList, |
117 LiteralMap, | 116 LiteralMap, |
118 LiteralMapEntry, | 117 LiteralMapEntry, |
119 LiteralNull, | 118 LiteralNull, |
120 LiteralString, | 119 LiteralString, |
121 LiteralSymbol, | 120 LiteralSymbol, |
122 Metadata, | 121 Metadata, |
123 NamedArgument, | 122 NamedArgument, |
124 NewExpression, | 123 NewExpression, |
125 Node, | 124 Node, |
126 NodeList, | 125 NodeList, |
127 NominalTypeAnnotation, | |
128 Operator, | 126 Operator, |
129 ParenthesizedExpression, | 127 ParenthesizedExpression, |
130 RedirectingFactoryBody, | 128 RedirectingFactoryBody, |
131 Rethrow, | 129 Rethrow, |
132 Return, | 130 Return, |
133 Send, | 131 Send, |
134 SendSet, | 132 SendSet, |
135 Statement, | 133 Statement, |
136 StringInterpolation, | 134 StringInterpolation, |
137 StringInterpolationPart, | 135 StringInterpolationPart, |
(...skipping 978 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1116 } | 1114 } |
1117 if (node.finallyBlock != null) { | 1115 if (node.finallyBlock != null) { |
1118 result = | 1116 result = |
1119 new ir.TryFinally(result, buildStatementInBlock(node.finallyBlock)); | 1117 new ir.TryFinally(result, buildStatementInBlock(node.finallyBlock)); |
1120 } | 1118 } |
1121 return buildBreakTarget(result, node, elements.getTargetDefinition(node)); | 1119 return buildBreakTarget(result, node, elements.getTargetDefinition(node)); |
1122 } | 1120 } |
1123 | 1121 |
1124 @override | 1122 @override |
1125 visitTypeAnnotation(TypeAnnotation node) { | 1123 visitTypeAnnotation(TypeAnnotation node) { |
1126 // Shouldn't be called, as the resolver has already resolved types and | 1124 // Shouldn't be called, as the resolver have already resolved types and |
1127 // created [DartType] objects. | 1125 // created [DartType] objects. |
1128 return internalError(node, "TypeAnnotation"); | 1126 return internalError(node, "TypeAnnotation"); |
1129 } | 1127 } |
1130 | 1128 |
1131 @override | 1129 @override |
1132 visitNominalTypeAnnotation(NominalTypeAnnotation node) { | |
1133 // Shouldn't be called, as the resolver has already resolved types and | |
1134 // created [DartType] objects. | |
1135 return internalError(node, "NominalTypeAnnotation"); | |
1136 } | |
1137 | |
1138 @override | |
1139 visitFunctionTypeAnnotation(FunctionTypeAnnotation node) { | |
1140 // Shouldn't be called, as the resolver has already resolved types and | |
1141 // created [DartType] objects. | |
1142 return internalError(node, "FunctionTypeAnnotation"); | |
1143 } | |
1144 | |
1145 @override | |
1146 visitTypeVariable(TypeVariable node) { | 1130 visitTypeVariable(TypeVariable node) { |
1147 // Shouldn't be called, as the resolver has already resolved types and | 1131 // Shouldn't be called, as the resolver have already resolved types and |
1148 // created [DartType] objects. | 1132 // created [DartType] objects. |
1149 return internalError(node, "TypeVariable"); | 1133 return internalError(node, "TypeVariable"); |
1150 } | 1134 } |
1151 | 1135 |
1152 @override | 1136 @override |
1153 ir.Statement visitWhile(While node) { | 1137 ir.Statement visitWhile(While node) { |
1154 ir.Expression condition = visitForValue(node.condition); | 1138 ir.Expression condition = visitForValue(node.condition); |
1155 JumpTarget jumpTarget = elements.getTargetDefinition(node); | 1139 JumpTarget jumpTarget = elements.getTargetDefinition(node); |
1156 ir.Statement body = | 1140 ir.Statement body = |
1157 buildContinueTarget(buildStatementInBlock(node.body), node, jumpTarget); | 1141 buildContinueTarget(buildStatementInBlock(node.body), node, jumpTarget); |
(...skipping 1782 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2940 : this(null, true, node, initializers); | 2924 : this(null, true, node, initializers); |
2941 | 2925 |
2942 accept(ir.Visitor v) => throw "unsupported"; | 2926 accept(ir.Visitor v) => throw "unsupported"; |
2943 | 2927 |
2944 visitChildren(ir.Visitor v) => throw "unsupported"; | 2928 visitChildren(ir.Visitor v) => throw "unsupported"; |
2945 | 2929 |
2946 String toString() { | 2930 String toString() { |
2947 return "IrFunction($kind, $isConstructor, $node, $initializers)"; | 2931 return "IrFunction($kind, $isConstructor, $node, $initializers)"; |
2948 } | 2932 } |
2949 } | 2933 } |
OLD | NEW |