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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
96 DoWhile, | 96 DoWhile, |
97 DottedName, | 97 DottedName, |
98 EmptyStatement, | 98 EmptyStatement, |
99 Enum, | 99 Enum, |
100 Expression, | 100 Expression, |
101 ExpressionStatement, | 101 ExpressionStatement, |
102 For, | 102 For, |
103 ForIn, | 103 ForIn, |
104 FunctionDeclaration, | 104 FunctionDeclaration, |
105 FunctionExpression, | 105 FunctionExpression, |
106 FunctionTypeAnnotation, | |
106 Identifier, | 107 Identifier, |
107 If, | 108 If, |
108 Label, | 109 Label, |
109 LabeledStatement, | 110 LabeledStatement, |
110 LiteralBool, | 111 LiteralBool, |
111 LiteralDouble, | 112 LiteralDouble, |
112 LiteralInt, | 113 LiteralInt, |
113 LiteralList, | 114 LiteralList, |
114 LiteralMap, | 115 LiteralMap, |
115 LiteralMapEntry, | 116 LiteralMapEntry, |
116 LiteralNull, | 117 LiteralNull, |
117 LiteralString, | 118 LiteralString, |
118 LiteralSymbol, | 119 LiteralSymbol, |
119 Metadata, | 120 Metadata, |
120 NamedArgument, | 121 NamedArgument, |
121 NewExpression, | 122 NewExpression, |
122 Node, | 123 Node, |
123 NodeList, | 124 NodeList, |
125 NominalTypeAnnotation, | |
124 Operator, | 126 Operator, |
125 ParenthesizedExpression, | 127 ParenthesizedExpression, |
126 RedirectingFactoryBody, | 128 RedirectingFactoryBody, |
127 Rethrow, | 129 Rethrow, |
128 Return, | 130 Return, |
129 Send, | 131 Send, |
130 SendSet, | 132 SendSet, |
131 Statement, | 133 Statement, |
132 StringInterpolation, | 134 StringInterpolation, |
133 StringInterpolationPart, | 135 StringInterpolationPart, |
(...skipping 946 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1080 } | 1082 } |
1081 if (node.finallyBlock != null) { | 1083 if (node.finallyBlock != null) { |
1082 result = | 1084 result = |
1083 new ir.TryFinally(result, buildStatementInBlock(node.finallyBlock)); | 1085 new ir.TryFinally(result, buildStatementInBlock(node.finallyBlock)); |
1084 } | 1086 } |
1085 return buildBreakTarget(result, node, elements.getTargetDefinition(node)); | 1087 return buildBreakTarget(result, node, elements.getTargetDefinition(node)); |
1086 } | 1088 } |
1087 | 1089 |
1088 @override | 1090 @override |
1089 visitTypeAnnotation(TypeAnnotation node) { | 1091 visitTypeAnnotation(TypeAnnotation node) { |
1090 // Shouldn't be called, as the resolver have already resolved types and | 1092 // Shouldn't be called, as the resolver have already resolved types and |
Johnni Winther
2017/01/02 12:46:53
As below.
floitsch
2017/01/02 13:48:48
Done.
| |
1091 // created [DartType] objects. | 1093 // created [DartType] objects. |
1092 return internalError(node, "TypeAnnotation"); | 1094 return internalError(node, "TypeAnnotation"); |
1093 } | 1095 } |
1094 | 1096 |
1095 @override | 1097 @override |
1098 visitNominalTypeAnnotation(NominalTypeAnnotation node) { | |
1099 // Shouldn't be called, as the resolver have already resolved types and | |
Johnni Winther
2017/01/02 12:46:53
'have' -> 'has'
floitsch
2017/01/02 13:48:48
Done.
| |
1100 // created [DartType] objects. | |
1101 return internalError(node, "NominalTypeAnnotation"); | |
1102 } | |
1103 | |
1104 @override | |
1105 visitFunctionTypeAnnotation(FunctionTypeAnnotation node) { | |
1106 // Shouldn't be called, as the resolver have already resolved types and | |
Johnni Winther
2017/01/02 12:46:53
ditto
floitsch
2017/01/02 13:48:48
Done.
| |
1107 // created [DartType] objects. | |
1108 return internalError(node, "FunctionTypeAnnotation"); | |
1109 } | |
1110 | |
1111 @override | |
1096 visitTypeVariable(TypeVariable node) { | 1112 visitTypeVariable(TypeVariable node) { |
1097 // Shouldn't be called, as the resolver have already resolved types and | 1113 // Shouldn't be called, as the resolver have already resolved types and |
floitsch
2017/01/02 13:48:48
done.
| |
1098 // created [DartType] objects. | 1114 // created [DartType] objects. |
1099 return internalError(node, "TypeVariable"); | 1115 return internalError(node, "TypeVariable"); |
1100 } | 1116 } |
1101 | 1117 |
1102 @override | 1118 @override |
1103 ir.Statement visitWhile(While node) { | 1119 ir.Statement visitWhile(While node) { |
1104 ir.Expression condition = visitForValue(node.condition); | 1120 ir.Expression condition = visitForValue(node.condition); |
1105 JumpTarget jumpTarget = elements.getTargetDefinition(node); | 1121 JumpTarget jumpTarget = elements.getTargetDefinition(node); |
1106 ir.Statement body = | 1122 ir.Statement body = |
1107 buildContinueTarget(buildStatementInBlock(node.body), node, jumpTarget); | 1123 buildContinueTarget(buildStatementInBlock(node.body), node, jumpTarget); |
(...skipping 1746 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2854 : this(null, true, node, initializers); | 2870 : this(null, true, node, initializers); |
2855 | 2871 |
2856 accept(ir.Visitor v) => throw "unsupported"; | 2872 accept(ir.Visitor v) => throw "unsupported"; |
2857 | 2873 |
2858 visitChildren(ir.Visitor v) => throw "unsupported"; | 2874 visitChildren(ir.Visitor v) => throw "unsupported"; |
2859 | 2875 |
2860 String toString() { | 2876 String toString() { |
2861 return "IrFunction($kind, $isConstructor, $node, $initializers)"; | 2877 return "IrFunction($kind, $isConstructor, $node, $initializers)"; |
2862 } | 2878 } |
2863 } | 2879 } |
OLD | NEW |