Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(57)

Side by Side Diff: pkg/front_end/lib/src/fasta/kernel/kernel_target.dart

Issue 2731633003: [Fasta] Include line starts (Closed)
Patch Set: Addressed comments Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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.kernel_target; 5 library fasta.kernel_target;
6 6
7 import 'dart:async' show Future; 7 import 'dart:async' show Future;
8 8
9 import 'dart:io' show File, IOSink; 9 import 'dart:io' show File, IOSink;
10 10
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 mainBuilder.body = new ExpressionStatement( 303 mainBuilder.body = new ExpressionStatement(
304 new Throw(new StringLiteral("${errors.join('\n')}"))); 304 new Throw(new StringLiteral("${errors.join('\n')}")));
305 } 305 }
306 library.build(); 306 library.build();
307 return link(<Library>[library.library]); 307 return link(<Library>[library.library]);
308 } 308 }
309 309
310 /// Creates a program by combining [libraries] with the libraries of 310 /// Creates a program by combining [libraries] with the libraries of
311 /// `dillTarget.loader.program`. 311 /// `dillTarget.loader.program`.
312 Program link(List<Library> libraries) { 312 Program link(List<Library> libraries) {
313 Map<String, Source> uriToSource = <String, Source>{}; 313 Map<String, Source> uriToSource =
314 314 new Map<String, Source>.from(this.uriToSource);
315 // for (Library library in libraries) {
316 // // TODO(ahe): Compute line starts instead.
317 // uriToLineStarts[library.fileUri] = <int>[0];
318 // }
319 315
320 final Program binary = dillTarget.loader.program; 316 final Program binary = dillTarget.loader.program;
321 if (binary != null) { 317 if (binary != null) {
322 libraries.addAll(binary.libraries); 318 libraries.addAll(binary.libraries);
323 uriToSource.addAll(binary.uriToSource); 319 uriToSource.addAll(binary.uriToSource);
324 } 320 }
325 321
326 // TODO(ahe): Remove this line. Kernel seems to generate a default line map 322 // TODO(ahe): Remove this line. Kernel seems to generate a default line map
327 // that used when there's no fileUri on an element. Instead, ensure all 323 // that used when there's no fileUri on an element. Instead, ensure all
328 // elements have a fileUri. 324 // elements have a fileUri.
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
609 } 605 }
610 for (Constructor constructor in superclass.constructors) { 606 for (Constructor constructor in superclass.constructors) {
611 if (constructor.name.name.isEmpty) { 607 if (constructor.name.name.isEmpty) {
612 return constructor.function.requiredParameterCount == 0 608 return constructor.function.requiredParameterCount == 0
613 ? constructor 609 ? constructor
614 : null; 610 : null;
615 } 611 }
616 } 612 }
617 return null; 613 return null;
618 } 614 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698