OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 analyzer2dart.semantic_visitor; | 5 library analyzer2dart.semantic_visitor; |
6 | 6 |
7 import 'package:analyzer/analyzer.dart'; | 7 import 'package:analyzer/analyzer.dart'; |
8 import 'package:analyzer/src/generated/source.dart'; | 8 import 'package:analyzer/src/generated/source.dart'; |
9 | 9 |
10 import 'util.dart'; | 10 import 'util.dart'; |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 } | 157 } |
158 | 158 |
159 R visitStaticMethodAccess(AstNode node, AccessSemantics semantics) { | 159 R visitStaticMethodAccess(AstNode node, AccessSemantics semantics) { |
160 return giveUp(node, 'visitStaticMethodAccess of $semantics'); | 160 return giveUp(node, 'visitStaticMethodAccess of $semantics'); |
161 } | 161 } |
162 | 162 |
163 R visitStaticPropertyAccess(AstNode node, AccessSemantics semantics) { | 163 R visitStaticPropertyAccess(AstNode node, AccessSemantics semantics) { |
164 return giveUp(node, 'visitStaticPropertyAccess of $semantics'); | 164 return giveUp(node, 'visitStaticPropertyAccess of $semantics'); |
165 } | 165 } |
166 | 166 |
| 167 R visitToplevelClassAccess(AstNode node, AccessSemantics semantics) { |
| 168 return giveUp(node, 'visitToplevelClassAccess of $semantics'); |
| 169 } |
| 170 |
| 171 R visitTypeParameterAccess(AstNode node, AccessSemantics semantics) { |
| 172 return giveUp(node, 'visitTypeParameterAccess of $semantics'); |
| 173 } |
| 174 |
167 R _handlePropertyAccess(AstNode node, AccessSemantics semantics) { | 175 R _handlePropertyAccess(AstNode node, AccessSemantics semantics) { |
168 switch (semantics.kind) { | 176 switch (semantics.kind) { |
169 case AccessKind.DYNAMIC: | 177 case AccessKind.DYNAMIC: |
170 return visitDynamicAccess(node, semantics); | 178 return visitDynamicAccess(node, semantics); |
171 case AccessKind.LOCAL_FUNCTION: | 179 case AccessKind.LOCAL_FUNCTION: |
172 return visitLocalFunctionAccess(node, semantics); | 180 return visitLocalFunctionAccess(node, semantics); |
173 case AccessKind.LOCAL_VARIABLE: | 181 case AccessKind.LOCAL_VARIABLE: |
174 return visitLocalVariableAccess(node, semantics); | 182 return visitLocalVariableAccess(node, semantics); |
175 case AccessKind.PARAMETER: | 183 case AccessKind.PARAMETER: |
176 return visitParameterAccess(node, semantics); | 184 return visitParameterAccess(node, semantics); |
177 case AccessKind.STATIC_FIELD: | 185 case AccessKind.STATIC_FIELD: |
178 return visitStaticFieldAccess(node, semantics); | 186 return visitStaticFieldAccess(node, semantics); |
179 case AccessKind.STATIC_METHOD: | 187 case AccessKind.STATIC_METHOD: |
180 return visitStaticMethodAccess(node, semantics); | 188 return visitStaticMethodAccess(node, semantics); |
181 case AccessKind.STATIC_PROPERTY: | 189 case AccessKind.STATIC_PROPERTY: |
182 return visitStaticPropertyAccess(node, semantics); | 190 return visitStaticPropertyAccess(node, semantics); |
| 191 case AccessKind.TOPLEVEL_CLASS: |
| 192 return visitToplevelClassAccess(node, semantics); |
| 193 case AccessKind.TYPE_PARAMETER: |
| 194 return visitTypeParameterAccess(node, semantics); |
183 default: | 195 default: |
184 // Unexpected access kind. | 196 // Unexpected access kind. |
185 return giveUp(node, | 197 return giveUp(node, |
186 'Unexpected ${semantics} in _handlePropertyAccess.'); | 198 'Unexpected ${semantics} in _handlePropertyAccess.'); |
187 } | 199 } |
188 } | 200 } |
189 | 201 |
190 R visitDynamicPropertyAssignment(AssignmentExpression node, | 202 R visitDynamicPropertyAssignment(AssignmentExpression node, |
191 AccessSemantics semantics) { | 203 AccessSemantics semantics) { |
192 return giveUp(node, 'visitDynamicPropertyAssignment of $semantics'); | 204 return giveUp(node, 'visitDynamicPropertyAssignment of $semantics'); |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 case AccessKind.STATIC_PROPERTY: | 262 case AccessKind.STATIC_PROPERTY: |
251 return visitStaticPropertyAssignment(node, semantics); | 263 return visitStaticPropertyAssignment(node, semantics); |
252 default: | 264 default: |
253 // Unexpected access kind. | 265 // Unexpected access kind. |
254 return giveUp(node, | 266 return giveUp(node, |
255 'Unexpected ${semantics} in _handlePropertyAccess.'); | 267 'Unexpected ${semantics} in _handlePropertyAccess.'); |
256 } | 268 } |
257 } | 269 } |
258 } | 270 } |
259 } | 271 } |
OLD | NEW |