| 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 import 'package:unittest/unittest.dart'; | 5 import 'package:unittest/unittest.dart'; |
| 6 import 'package:analyzer/file_system/memory_file_system.dart'; | 6 import 'package:analyzer/file_system/memory_file_system.dart'; |
| 7 import 'mock_sdk.dart'; | 7 import 'mock_sdk.dart'; |
| 8 import 'package:analyzer/src/generated/sdk.dart'; | 8 import 'package:analyzer/src/generated/sdk.dart'; |
| 9 import 'package:analyzer/file_system/file_system.dart'; | 9 import 'package:analyzer/file_system/file_system.dart'; |
| 10 import 'package:analyzer/src/generated/source.dart'; | 10 import 'package:analyzer/src/generated/source.dart'; |
| (...skipping 2101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2112 typedef void AccessHandler(Expression node, AccessSemantics semantics); | 2112 typedef void AccessHandler(Expression node, AccessSemantics semantics); |
| 2113 | 2113 |
| 2114 /** | 2114 /** |
| 2115 * Visitor class used to run the tests. | 2115 * Visitor class used to run the tests. |
| 2116 */ | 2116 */ |
| 2117 class TestVisitor extends RecursiveAstVisitor { | 2117 class TestVisitor extends RecursiveAstVisitor { |
| 2118 AccessHandler onAccess; | 2118 AccessHandler onAccess; |
| 2119 | 2119 |
| 2120 @override | 2120 @override |
| 2121 visitMethodInvocation(MethodInvocation node) { | 2121 visitMethodInvocation(MethodInvocation node) { |
| 2122 onAccess(node, classifyMethodInvocation(node)); | 2122 onAccess(node, node.accept(ACCESS_SEMANTICS_VISITOR)); |
| 2123 } | 2123 } |
| 2124 | 2124 |
| 2125 @override | 2125 @override |
| 2126 visitPrefixedIdentifier(PrefixedIdentifier node) { | 2126 visitPrefixedIdentifier(PrefixedIdentifier node) { |
| 2127 onAccess(node, classifyPrefixedIdentifier(node)); | 2127 onAccess(node, node.accept(ACCESS_SEMANTICS_VISITOR)); |
| 2128 } | 2128 } |
| 2129 | 2129 |
| 2130 @override | 2130 @override |
| 2131 visitPropertyAccess(PropertyAccess node) { | 2131 visitPropertyAccess(PropertyAccess node) { |
| 2132 onAccess(node, classifyPropertyAccess(node)); | 2132 onAccess(node, node.accept(ACCESS_SEMANTICS_VISITOR)); |
| 2133 } | 2133 } |
| 2134 | 2134 |
| 2135 @override | 2135 @override |
| 2136 visitSimpleIdentifier(SimpleIdentifier node) { | 2136 visitSimpleIdentifier(SimpleIdentifier node) { |
| 2137 AccessSemantics semantics = classifySimpleIdentifier(node); | 2137 AccessSemantics semantics = node.accept(ACCESS_SEMANTICS_VISITOR); |
| 2138 if (semantics != null) { | 2138 if (semantics != null) { |
| 2139 onAccess(node, semantics); | 2139 onAccess(node, semantics); |
| 2140 } | 2140 } |
| 2141 } | 2141 } |
| 2142 } | 2142 } |
| OLD | NEW |