| OLD | NEW |
| 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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:analyzer/dart/ast/ast.dart'; | 5 import 'package:analyzer/dart/ast/ast.dart'; |
| 6 import 'package:analyzer/dart/element/element.dart'; | 6 import 'package:analyzer/dart/element/element.dart'; |
| 7 import 'package:analyzer/error/error.dart'; | 7 import 'package:analyzer/error/error.dart'; |
| 8 import 'package:front_end/src/fasta/analyzer/ast_builder.dart'; | 8 import 'package:front_end/src/fasta/analyzer/ast_builder.dart'; |
| 9 import 'package:front_end/src/fasta/analyzer/element_store.dart'; | 9 import 'package:front_end/src/fasta/analyzer/element_store.dart'; |
| 10 import 'package:front_end/src/fasta/builder/scope.dart'; | 10 import 'package:front_end/src/fasta/builder/scope.dart'; |
| (...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 } | 326 } |
| 327 | 327 |
| 328 /** | 328 /** |
| 329 * Proxy implementation of [KernelLibraryBuilderProxy] used by Fasta parser | 329 * Proxy implementation of [KernelLibraryBuilderProxy] used by Fasta parser |
| 330 * tests. | 330 * tests. |
| 331 */ | 331 */ |
| 332 class KernelLibraryBuilderProxy implements KernelLibraryBuilder { | 332 class KernelLibraryBuilderProxy implements KernelLibraryBuilder { |
| 333 @override | 333 @override |
| 334 final uri = Uri.parse('file:///test.dart'); | 334 final uri = Uri.parse('file:///test.dart'); |
| 335 | 335 |
| 336 @override |
| 337 Uri get fileUri => uri; |
| 338 |
| 336 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation); | 339 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation); |
| 337 } | 340 } |
| 338 | 341 |
| 339 /** | 342 /** |
| 340 * Proxy implementation of [Scope] used by Fasta parser tests. | 343 * Proxy implementation of [Scope] used by Fasta parser tests. |
| 341 * | 344 * |
| 342 * Any name lookup request is satisfied by creating an instance of | 345 * Any name lookup request is satisfied by creating an instance of |
| 343 * [BuilderProxy]. | 346 * [BuilderProxy]. |
| 344 */ | 347 */ |
| 345 class ScopeProxy implements Scope { | 348 class ScopeProxy implements Scope { |
| 346 final _locals = <String, Builder>{}; | 349 final _locals = <String, Builder>{}; |
| 347 | 350 |
| 348 Builder lookup(String name) => | 351 @override |
| 352 Builder lookup(String name, int charOffset, Uri fileUri) => |
| 349 _locals.putIfAbsent(name, () => new BuilderProxy()); | 353 _locals.putIfAbsent(name, () => new BuilderProxy()); |
| 350 | 354 |
| 351 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation); | 355 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation); |
| 352 } | 356 } |
| OLD | NEW |