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:front_end/src/scanner/token.dart' show Token; | 7 import 'package:front_end/src/scanner/token.dart' show Token; |
8 | 8 |
9 import 'package:kernel/ast.dart' show ProcedureKind; | 9 import 'package:kernel/ast.dart' show ProcedureKind; |
10 | 10 |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 Uri newFileUri; | 154 Uri newFileUri; |
155 if (uri.scheme == "dart") { | 155 if (uri.scheme == "dart") { |
156 resolvedUri = resolveRelativeUri(uri, Uri.parse(path)); | 156 resolvedUri = resolveRelativeUri(uri, Uri.parse(path)); |
157 newFileUri = fileUri.resolve(path); | 157 newFileUri = fileUri.resolve(path); |
158 } else { | 158 } else { |
159 resolvedUri = uri.resolve(path); | 159 resolvedUri = uri.resolve(path); |
160 if (uri.scheme != "package") { | 160 if (uri.scheme != "package") { |
161 newFileUri = fileUri.resolve(path); | 161 newFileUri = fileUri.resolve(path); |
162 } | 162 } |
163 } | 163 } |
164 parts | 164 parts.add(loader.read(resolvedUri, charOffset, |
165 .add(loader.read(resolvedUri, -1, fileUri: newFileUri, accessor: this)); | 165 fileUri: newFileUri, accessor: this)); |
166 } | 166 } |
167 | 167 |
168 void addPartOf(List<MetadataBuilder> metadata, String name, String uri) { | 168 void addPartOf(List<MetadataBuilder> metadata, String name, String uri) { |
169 partOfName = name; | 169 partOfName = name; |
170 partOfUri = uri == null ? null : this.uri.resolve(uri); | 170 partOfUri = uri == null ? null : this.uri.resolve(uri); |
171 } | 171 } |
172 | 172 |
173 void addClass( | 173 void addClass( |
174 List<MetadataBuilder> metadata, | 174 List<MetadataBuilder> metadata, |
175 int modifiers, | 175 int modifiers, |
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
578 /// synthesize type variables on the factory matching the class'. | 578 /// synthesize type variables on the factory matching the class'. |
579 void addFactoryDeclaration( | 579 void addFactoryDeclaration( |
580 ProcedureBuilder procedure, DeclarationBuilder<T> factoryDeclaration) { | 580 ProcedureBuilder procedure, DeclarationBuilder<T> factoryDeclaration) { |
581 factoryDeclarations[procedure] = factoryDeclaration; | 581 factoryDeclarations[procedure] = factoryDeclaration; |
582 } | 582 } |
583 | 583 |
584 Scope toScope(Scope parent) { | 584 Scope toScope(Scope parent) { |
585 return new Scope(members, setters, parent, isModifiable: false); | 585 return new Scope(members, setters, parent, isModifiable: false); |
586 } | 586 } |
587 } | 587 } |
OLD | NEW |