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

Side by Side Diff: pkg/front_end/lib/src/fasta/builder/library_builder.dart

Issue 2717673002: Use printUnexpected and add location information. (Closed)
Patch Set: 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 | pkg/front_end/lib/src/fasta/errors.dart » ('j') | 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.library_builder; 5 library fasta.library_builder;
6 6
7 import '../combinator.dart' show 7 import '../combinator.dart' show
8 Combinator; 8 Combinator;
9 9
10 import '../errors.dart' show 10 import '../errors.dart' show
11 InputError, 11 InputError,
12 internalError; 12 internalError,
13 printUnexpected;
13 14
14 import '../export.dart' show 15 import '../export.dart' show
15 Export; 16 Export;
16 17
17 import '../loader.dart' show 18 import '../loader.dart' show
18 Loader; 19 Loader;
19 20
20 import '../util/relativize.dart' show 21 import '../util/relativize.dart' show
21 relativizeUri; 22 relativizeUri;
22 23
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 57
57 Builder addBuilder(String name, Builder builder, int charOffset); 58 Builder addBuilder(String name, Builder builder, int charOffset);
58 59
59 void addExporter(LibraryBuilder exporter, List<Combinator> combinators, 60 void addExporter(LibraryBuilder exporter, List<Combinator> combinators,
60 int charOffset) { 61 int charOffset) {
61 exporters.add(new Export(exporter, this, combinators, charOffset)); 62 exporters.add(new Export(exporter, this, combinators, charOffset));
62 } 63 }
63 64
64 void addCompileTimeError(int charOffset, Object message, [Uri fileUri]) { 65 void addCompileTimeError(int charOffset, Object message, [Uri fileUri]) {
65 fileUri ??= this.fileUri; 66 fileUri ??= this.fileUri;
66 InputError error = new InputError(fileUri, charOffset, message); 67 printUnexpected(fileUri, charOffset, message);
67 compileTimeErrors.add(error); 68 compileTimeErrors.add(new InputError(fileUri, charOffset, message));
68 print(error.format());
69 } 69 }
70 70
71 bool addToExportScope(String name, Builder member); 71 bool addToExportScope(String name, Builder member);
72 72
73 void addToScope(String name, Builder member); 73 void addToScope(String name, Builder member);
74 74
75 Builder buildAmbiguousBuilder( 75 Builder buildAmbiguousBuilder(
76 String name, Builder builder, Builder other, int charOffset); 76 String name, Builder builder, Builder other, int charOffset);
77 77
78 int finishStaticInvocations() => 0; 78 int finishStaticInvocations() => 0;
(...skipping 23 matching lines...) Expand all
102 } else if (constructor.isFactory) { 102 } else if (constructor.isFactory) {
103 return constructor; 103 return constructor;
104 } 104 }
105 } 105 }
106 throw internalError("Internal error: No constructor named" 106 throw internalError("Internal error: No constructor named"
107 " '$className::$constructorName' in '$uri'."); 107 " '$className::$constructorName' in '$uri'.");
108 } 108 }
109 109
110 int finishTypeVariables(ClassBuilder object) => 0; 110 int finishTypeVariables(ClassBuilder object) => 0;
111 } 111 }
OLDNEW
« no previous file with comments | « no previous file | pkg/front_end/lib/src/fasta/errors.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698