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

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

Issue 2988113002: Add Class.isEnum to Kernel and use it to resynthesize enums in Analyzer. (Closed)
Patch Set: Created 3 years, 4 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 | « pkg/analyzer/test/src/summary/resynthesize_kernel_test.dart ('k') | pkg/kernel/lib/ast.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.kernel_enum_builder; 5 library fasta.kernel_enum_builder;
6 6
7 import 'package:kernel/ast.dart' 7 import 'package:kernel/ast.dart'
8 show 8 show
9 Arguments, 9 Arguments,
10 Class, 10 Class,
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 233
234 KernelTypeBuilder get mixedInType => null; 234 KernelTypeBuilder get mixedInType => null;
235 235
236 InterfaceType buildType( 236 InterfaceType buildType(
237 LibraryBuilder library, List<KernelTypeBuilder> arguments) { 237 LibraryBuilder library, List<KernelTypeBuilder> arguments) {
238 return cls.rawType; 238 return cls.rawType;
239 } 239 }
240 240
241 @override 241 @override
242 Class build(KernelLibraryBuilder libraryBuilder, LibraryBuilder coreLibrary) { 242 Class build(KernelLibraryBuilder libraryBuilder, LibraryBuilder coreLibrary) {
243 cls.isEnum = true;
243 if (constantNamesAndOffsets.isEmpty) { 244 if (constantNamesAndOffsets.isEmpty) {
244 libraryBuilder.addCompileTimeError( 245 libraryBuilder.addCompileTimeError(
245 messageEnumDeclartionEmpty, charOffset, fileUri); 246 messageEnumDeclartionEmpty, charOffset, fileUri);
246 } 247 }
247 intType.resolveIn(coreLibrary.scope); 248 intType.resolveIn(coreLibrary.scope);
248 stringType.resolveIn(coreLibrary.scope); 249 stringType.resolveIn(coreLibrary.scope);
249 objectType.resolveIn(coreLibrary.scope); 250 objectType.resolveIn(coreLibrary.scope);
250 listType.resolveIn(coreLibrary.scope); 251 listType.resolveIn(coreLibrary.scope);
251 toStringMap.keyType = intType.build(libraryBuilder); 252 toStringMap.keyType = intType.build(libraryBuilder);
252 toStringMap.valueType = stringType.build(libraryBuilder); 253 toStringMap.valueType = stringType.build(libraryBuilder);
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 } 307 }
307 return super.build(libraryBuilder, coreLibrary); 308 return super.build(libraryBuilder, coreLibrary);
308 } 309 }
309 310
310 @override 311 @override
311 Builder findConstructorOrFactory( 312 Builder findConstructorOrFactory(
312 String name, int charOffset, Uri uri, LibraryBuilder library) { 313 String name, int charOffset, Uri uri, LibraryBuilder library) {
313 return null; 314 return null;
314 } 315 }
315 } 316 }
OLDNEW
« no previous file with comments | « pkg/analyzer/test/src/summary/resynthesize_kernel_test.dart ('k') | pkg/kernel/lib/ast.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698