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 file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library fasta.source_library_builder; | 5 library fasta.source_library_builder; |
6 | 6 |
7 import 'package:kernel/ast.dart' show AsyncMarker, ProcedureKind; | 7 import 'package:kernel/ast.dart' show AsyncMarker, ProcedureKind; |
8 | 8 |
9 import '../combinator.dart' show Combinator; | 9 import '../combinator.dart' show Combinator; |
10 | 10 |
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
435 int resolveConstructors(_) { | 435 int resolveConstructors(_) { |
436 int count = 0; | 436 int count = 0; |
437 members.forEach((String name, Builder member) { | 437 members.forEach((String name, Builder member) { |
438 count += member.resolveConstructors(this); | 438 count += member.resolveConstructors(this); |
439 }); | 439 }); |
440 return count; | 440 return count; |
441 } | 441 } |
442 | 442 |
443 List<TypeVariableBuilder> copyTypeVariables( | 443 List<TypeVariableBuilder> copyTypeVariables( |
444 List<TypeVariableBuilder> original); | 444 List<TypeVariableBuilder> original); |
| 445 |
| 446 @override |
| 447 String get fullNameForErrors => name ?? "<library '$relativeFileUri'>"; |
445 } | 448 } |
446 | 449 |
447 /// Unlike [Scope], this scope is used during construction of builders to | 450 /// Unlike [Scope], this scope is used during construction of builders to |
448 /// ensure types and members are added to and resolved in the correct location. | 451 /// ensure types and members are added to and resolved in the correct location. |
449 class DeclarationBuilder<T extends TypeBuilder> { | 452 class DeclarationBuilder<T extends TypeBuilder> { |
450 final DeclarationBuilder<T> parent; | 453 final DeclarationBuilder<T> parent; |
451 | 454 |
452 final Map<String, Builder> members; | 455 final Map<String, Builder> members; |
453 | 456 |
454 final List<T> types = <T>[]; | 457 final List<T> types = <T>[]; |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
520 } | 523 } |
521 | 524 |
522 /// Called to register [procedure] as a factory whose types are collected in | 525 /// Called to register [procedure] as a factory whose types are collected in |
523 /// [factoryDeclaration]. Later, once the class has been built, we can | 526 /// [factoryDeclaration]. Later, once the class has been built, we can |
524 /// synthesize type variables on the factory matching the class'. | 527 /// synthesize type variables on the factory matching the class'. |
525 void addFactoryDeclaration( | 528 void addFactoryDeclaration( |
526 ProcedureBuilder procedure, DeclarationBuilder<T> factoryDeclaration) { | 529 ProcedureBuilder procedure, DeclarationBuilder<T> factoryDeclaration) { |
527 factoryDeclarations[procedure] = factoryDeclaration; | 530 factoryDeclarations[procedure] = factoryDeclaration; |
528 } | 531 } |
529 } | 532 } |
OLD | NEW |