| 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 | 7 import 'package:kernel/ast.dart' show |
| 8 AsyncMarker, | 8 AsyncMarker, |
| 9 ProcedureKind; | 9 ProcedureKind; |
| 10 | 10 |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 return; | 276 return; |
| 277 } | 277 } |
| 278 if (part.partOf != name) { | 278 if (part.partOf != name) { |
| 279 print("${part.uri} is part of '${part.partOf}' but is used as a part " | 279 print("${part.uri} is part of '${part.partOf}' but is used as a part " |
| 280 "by '${name}' ($uri)"); | 280 "by '${name}' ($uri)"); |
| 281 parts.remove(part); | 281 parts.remove(part); |
| 282 return; | 282 return; |
| 283 } | 283 } |
| 284 } | 284 } |
| 285 part.members.forEach((String name, Builder builder) { | 285 part.members.forEach((String name, Builder builder) { |
| 286 addBuilder(name, builder, -1); | 286 if (builder.next != null) { |
| 287 assert(builder.next.next == null); |
| 288 addBuilder(name, builder.next, builder.next.charOffset); |
| 289 } |
| 290 addBuilder(name, builder, builder.charOffset); |
| 287 }); | 291 }); |
| 288 types.addAll(part.types); | 292 types.addAll(part.types); |
| 289 constructorReferences.addAll(part.constructorReferences); | 293 constructorReferences.addAll(part.constructorReferences); |
| 290 part.partOfLibrary = this; | 294 part.partOfLibrary = this; |
| 291 // TODO(ahe): Include metadata from part? | 295 // TODO(ahe): Include metadata from part? |
| 292 } | 296 } |
| 293 | 297 |
| 294 void buildInitialScopes() { | 298 void buildInitialScopes() { |
| 295 members.forEach(addToExportScope); | 299 members.forEach(addToExportScope); |
| 296 members.forEach(addToScope); | 300 members.forEach(addToScope); |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 433 } | 437 } |
| 434 | 438 |
| 435 /// Called to register [procedure] as a factory whose types are collected in | 439 /// Called to register [procedure] as a factory whose types are collected in |
| 436 /// [factoryDeclaration]. Later, once the class has been built, we can | 440 /// [factoryDeclaration]. Later, once the class has been built, we can |
| 437 /// synthesize type variables on the factory matching the class'. | 441 /// synthesize type variables on the factory matching the class'. |
| 438 void addFactoryDeclaration( | 442 void addFactoryDeclaration( |
| 439 ProcedureBuilder procedure, DeclarationBuilder<T> factoryDeclaration) { | 443 ProcedureBuilder procedure, DeclarationBuilder<T> factoryDeclaration) { |
| 440 factoryDeclarations[procedure] = factoryDeclaration; | 444 factoryDeclarations[procedure] = factoryDeclaration; |
| 441 } | 445 } |
| 442 } | 446 } |
| OLD | NEW |