| 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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 imports.add(new Import(loader.read(resolve(uri)), prefix, combinators)); | 124 imports.add(new Import(loader.read(resolve(uri)), prefix, combinators)); |
| 125 } | 125 } |
| 126 | 126 |
| 127 void addPart(List<MetadataBuilder> metadata, String path) { | 127 void addPart(List<MetadataBuilder> metadata, String path) { |
| 128 Uri resolvedUri; | 128 Uri resolvedUri; |
| 129 Uri newFileUri; | 129 Uri newFileUri; |
| 130 if (uri.scheme == "dart") { | 130 if (uri.scheme == "dart") { |
| 131 resolvedUri = new Uri(scheme: "dart", path: "${uri.path}/$path"); | 131 resolvedUri = new Uri(scheme: "dart", path: "${uri.path}/$path"); |
| 132 newFileUri = fileUri.resolve(path); | 132 newFileUri = fileUri.resolve(path); |
| 133 } else { | 133 } else { |
| 134 newFileUri = resolvedUri = resolve(path); | 134 resolvedUri = uri.resolve(path); |
| 135 newFileUri = fileUri.resolve(path); |
| 135 } | 136 } |
| 136 parts.add(loader.read(resolvedUri, newFileUri)); | 137 parts.add(loader.read(resolvedUri, newFileUri)); |
| 137 } | 138 } |
| 138 | 139 |
| 139 void addPartOf(List<MetadataBuilder> metadata, String name) { | 140 void addPartOf(List<MetadataBuilder> metadata, String name) { |
| 140 partOf = name; | 141 partOf = name; |
| 141 } | 142 } |
| 142 | 143 |
| 143 ClassBuilder addClass(List<MetadataBuilder> metadata, | 144 ClassBuilder addClass(List<MetadataBuilder> metadata, |
| 144 int modifiers, String name, | 145 int modifiers, String name, |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 333 } | 334 } |
| 334 | 335 |
| 335 int resolveConstructors(_) { | 336 int resolveConstructors(_) { |
| 336 int count = 0; | 337 int count = 0; |
| 337 members.forEach((String name, Builder member) { | 338 members.forEach((String name, Builder member) { |
| 338 count += member.resolveConstructors(this); | 339 count += member.resolveConstructors(this); |
| 339 }); | 340 }); |
| 340 return count; | 341 return count; |
| 341 } | 342 } |
| 342 } | 343 } |
| OLD | NEW |