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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 } | 79 } |
80 | 80 |
81 Uri get uri; | 81 Uri get uri; |
82 | 82 |
83 bool get isPart => partOfName != null || partOfUri != null; | 83 bool get isPart => partOfName != null || partOfUri != null; |
84 | 84 |
85 Map<String, Builder> get members => libraryDeclaration.members; | 85 Map<String, Builder> get members => libraryDeclaration.members; |
86 | 86 |
87 List<T> get types => libraryDeclaration.types; | 87 List<T> get types => libraryDeclaration.types; |
88 | 88 |
89 /// When parsing a class, this returns a map of its members (that have been | |
90 /// parsed so far). | |
91 Map<String, MemberBuilder> get classMembers { | |
92 assert(currentDeclaration.parent == libraryDeclaration); | |
93 return currentDeclaration.members; | |
94 } | |
95 | |
96 T addNamedType(String name, List<T> arguments, int charOffset); | 89 T addNamedType(String name, List<T> arguments, int charOffset); |
97 | 90 |
98 T addMixinApplication(T supertype, List<T> mixins, int charOffset); | 91 T addMixinApplication(T supertype, List<T> mixins, int charOffset); |
99 | 92 |
100 T addType(T type) { | 93 T addType(T type) { |
101 currentDeclaration.addType(type); | 94 currentDeclaration.addType(type); |
102 return type; | 95 return type; |
103 } | 96 } |
104 | 97 |
105 T addVoidType(int charOffset); | 98 T addVoidType(int charOffset); |
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
542 } | 535 } |
543 | 536 |
544 /// Called to register [procedure] as a factory whose types are collected in | 537 /// Called to register [procedure] as a factory whose types are collected in |
545 /// [factoryDeclaration]. Later, once the class has been built, we can | 538 /// [factoryDeclaration]. Later, once the class has been built, we can |
546 /// synthesize type variables on the factory matching the class'. | 539 /// synthesize type variables on the factory matching the class'. |
547 void addFactoryDeclaration( | 540 void addFactoryDeclaration( |
548 ProcedureBuilder procedure, DeclarationBuilder<T> factoryDeclaration) { | 541 ProcedureBuilder procedure, DeclarationBuilder<T> factoryDeclaration) { |
549 factoryDeclarations[procedure] = factoryDeclaration; | 542 factoryDeclarations[procedure] = factoryDeclaration; |
550 } | 543 } |
551 } | 544 } |
OLD | NEW |