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

Side by Side Diff: pkg/front_end/lib/src/fasta/builder/class_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.class_builder; 5 library fasta.class_builder;
6 6
7 import '../deprecated_problems.dart' show deprecated_internalProblem; 7 import '../deprecated_problems.dart' show deprecated_internalProblem;
8 8
9 import 'builder.dart' 9 import 'builder.dart'
10 show 10 show
11 Builder, 11 Builder,
12 ConstructorReferenceBuilder, 12 ConstructorReferenceBuilder,
13 LibraryBuilder, 13 LibraryBuilder,
14 MemberBuilder, 14 MemberBuilder,
15 MetadataBuilder, 15 MetadataBuilder,
16 MixinApplicationBuilder, 16 MixinApplicationBuilder,
17 NamedTypeBuilder, 17 NamedTypeBuilder,
18 Scope, 18 Scope,
19 ScopeBuilder, 19 ScopeBuilder,
20 TypeBuilder, 20 TypeBuilder,
21 TypeDeclarationBuilder, 21 TypeDeclarationBuilder,
22 TypeVariableBuilder; 22 TypeVariableBuilder;
23 23
24 import '../fasta_codes.dart' show Message;
25
24 abstract class ClassBuilder<T extends TypeBuilder, R> 26 abstract class ClassBuilder<T extends TypeBuilder, R>
25 extends TypeDeclarationBuilder<T, R> { 27 extends TypeDeclarationBuilder<T, R> {
26 final List<TypeVariableBuilder> typeVariables; 28 final List<TypeVariableBuilder> typeVariables;
27 29
28 T supertype; 30 T supertype;
29 31
30 List<T> interfaces; 32 List<T> interfaces;
31 33
32 final Scope scope; 34 final Scope scope;
33 35
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 } 193 }
192 194
193 /// Don't use for scope lookup. Only use when an element is known to exist 195 /// Don't use for scope lookup. Only use when an element is known to exist
194 /// (and isn't a setter). 196 /// (and isn't a setter).
195 MemberBuilder operator [](String name) { 197 MemberBuilder operator [](String name) {
196 // TODO(ahe): Rename this to getLocalMember. 198 // TODO(ahe): Rename this to getLocalMember.
197 return scope.local[name] ?? 199 return scope.local[name] ??
198 deprecated_internalProblem("Not found: '$name'."); 200 deprecated_internalProblem("Not found: '$name'.");
199 } 201 }
200 202
203 void addCompileTimeError(Message message, int charOffset) {
204 library.addCompileTimeError(message, charOffset, fileUri);
205 }
206
207 void addWarning(Message message, int charOffset) {
208 library.addWarning(message, charOffset, fileUri);
209 }
210
211 void addNit(Message message, int charOffset) {
212 library.addNit(message, charOffset, fileUri);
213 }
214
201 void deprecated_addCompileTimeError(int charOffset, String message) { 215 void deprecated_addCompileTimeError(int charOffset, String message) {
202 library.deprecated_addCompileTimeError(charOffset, message, 216 library.deprecated_addCompileTimeError(charOffset, message,
203 fileUri: fileUri); 217 fileUri: fileUri);
204 } 218 }
205 219
206 void deprecated_addWarning(int charOffset, String message) { 220 void deprecated_addWarning(int charOffset, String message) {
207 library.deprecated_addWarning(charOffset, message, fileUri: fileUri); 221 library.deprecated_addWarning(charOffset, message, fileUri: fileUri);
208 } 222 }
209 223
210 void deprecated_addNit(int charOffset, String message) { 224 void deprecated_addNit(int charOffset, String message) {
211 library.deprecated_addNit(charOffset, message, fileUri: fileUri); 225 library.deprecated_addNit(charOffset, message, fileUri: fileUri);
212 } 226 }
213 } 227 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/tree/nodes.dart ('k') | pkg/front_end/lib/src/fasta/builder/constructor_reference_builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698