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

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

Issue 2965393002: Use FastaMessage instead of String. Part 1. (Closed)
Patch Set: Add type variable to Code. Created 3 years, 5 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
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 Combinator; 7 import '../combinator.dart' show Combinator;
8 8
9 import '../deprecated_problems.dart' show deprecated_internalProblem; 9 import '../deprecated_problems.dart' show deprecated_internalProblem;
10 10
11 import '../export.dart' show Export; 11 import '../export.dart' show Export;
12 12
13 import '../loader.dart' show Loader; 13 import '../loader.dart' show Loader;
14 14
15 import '../messages.dart' show deprecated_nit, deprecated_warning; 15 import '../messages.dart'
16 show Message, deprecated_nit, deprecated_warning, nit, warning;
16 17
17 import '../util/relativize.dart' show relativizeUri; 18 import '../util/relativize.dart' show relativizeUri;
18 19
19 import 'builder.dart' 20 import 'builder.dart'
20 show 21 show
21 Builder, 22 Builder,
22 ClassBuilder, 23 ClassBuilder,
23 DynamicTypeBuilder, 24 DynamicTypeBuilder,
24 PrefixBuilder, 25 PrefixBuilder,
25 Scope, 26 Scope,
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 /// 71 ///
71 /// If [fileUri] is null, it defaults to `this.fileUri`. 72 /// If [fileUri] is null, it defaults to `this.fileUri`.
72 void deprecated_addCompileTimeError(int charOffset, Object message, 73 void deprecated_addCompileTimeError(int charOffset, Object message,
73 {Uri fileUri, bool silent: false, bool wasHandled: false}) { 74 {Uri fileUri, bool silent: false, bool wasHandled: false}) {
74 hasCompileTimeErrors = true; 75 hasCompileTimeErrors = true;
75 loader.deprecated_addCompileTimeError( 76 loader.deprecated_addCompileTimeError(
76 fileUri ?? this.fileUri, charOffset, message, 77 fileUri ?? this.fileUri, charOffset, message,
77 silent: silent, wasHandled: wasHandled); 78 silent: silent, wasHandled: wasHandled);
78 } 79 }
79 80
81 void addCompileTimeError(Message message, int charOffset, Uri uri,
82 {bool silent: false, bool wasHandled: false}) {
83 hasCompileTimeErrors = true;
84 loader.addCompileTimeError(message, charOffset, uri,
85 silent: silent, wasHandled: wasHandled);
86 }
87
88 void addWarning(Message message, int charOffset, Uri uri,
89 {bool silent: false}) {
90 if (!silent) {
91 warning(message, charOffset, uri);
92 }
93 }
94
95 void addNit(Message message, int charOffset, Uri uri, {bool silent: false}) {
96 if (!silent) {
97 nit(message, charOffset, uri);
98 }
99 }
100
80 void deprecated_addWarning(int charOffset, Object message, 101 void deprecated_addWarning(int charOffset, Object message,
81 {Uri fileUri, bool silent: false}) { 102 {Uri fileUri, bool silent: false}) {
82 fileUri ??= this.fileUri; 103 fileUri ??= this.fileUri;
83 if (!silent) { 104 if (!silent) {
84 deprecated_warning(fileUri, charOffset, message); 105 deprecated_warning(fileUri, charOffset, message);
85 } 106 }
86 } 107 }
87 108
88 void deprecated_addNit(int charOffset, Object message, 109 void deprecated_addNit(int charOffset, Object message,
89 {Uri fileUri, bool silent: false}) { 110 {Uri fileUri, bool silent: false}) {
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 /// (and not a setter). 200 /// (and not a setter).
180 Builder operator [](String name) { 201 Builder operator [](String name) {
181 return scope.local[name] ?? 202 return scope.local[name] ??
182 deprecated_internalProblem("Not found: '$name'."); 203 deprecated_internalProblem("Not found: '$name'.");
183 } 204 }
184 205
185 Builder lookup(String name, int charOffset, Uri fileUri) { 206 Builder lookup(String name, int charOffset, Uri fileUri) {
186 return scope.lookup(name, charOffset, fileUri); 207 return scope.lookup(name, charOffset, fileUri);
187 } 208 }
188 } 209 }
OLDNEW
« no previous file with comments | « pkg/front_end/lib/src/fasta/builder/constructor_reference_builder.dart ('k') | pkg/front_end/lib/src/fasta/command_line.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698