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

Side by Side Diff: pkg/compiler/lib/src/resolution/enum_creator.dart

Issue 2456643006: More functionality in kernel_impact. (Closed)
Patch Set: Fix errors. Created 4 years, 1 month 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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 dart2js.resolution.enum_creator; 5 library dart2js.resolution.enum_creator;
6 6
7 import '../common.dart'; 7 import '../common.dart';
8 import '../core_types.dart' show CoreTypes; 8 import '../core_types.dart' show CoreTypes;
9 import '../dart_types.dart'; 9 import '../dart_types.dart';
10 import '../elements/elements.dart'; 10 import '../elements/elements.dart';
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 EnumConstructorElementX constructor = new EnumConstructorElementX( 237 EnumConstructorElementX constructor = new EnumConstructorElementX(
238 enumClass, builder.modifiers(isConst: true), constructorNode); 238 enumClass, builder.modifiers(isConst: true), constructorNode);
239 239
240 EnumFormalElementX indexFormal = new EnumFormalElementX(constructor, 240 EnumFormalElementX indexFormal = new EnumFormalElementX(constructor,
241 indexDefinition, builder.identifier('index'), indexVariable); 241 indexDefinition, builder.identifier('index'), indexVariable);
242 242
243 FunctionSignatureX constructorSignature = new FunctionSignatureX( 243 FunctionSignatureX constructorSignature = new FunctionSignatureX(
244 requiredParameters: [indexFormal], 244 requiredParameters: [indexFormal],
245 requiredParameterCount: 1, 245 requiredParameterCount: 1,
246 type: new FunctionType( 246 type: new FunctionType(
247 constructor, const VoidType(), <DartType>[intType])); 247 constructor, const DynamicType(), <DartType>[intType]));
248 constructor.functionSignature = constructorSignature; 248 constructor.functionSignature = constructorSignature;
249 enumClass.addMember(constructor, reporter); 249 enumClass.addMember(constructor, reporter);
250 250
251 List<EnumConstantElement> enumValues = <EnumConstantElement>[]; 251 List<EnumConstantElement> enumValues = <EnumConstantElement>[];
252 int index = 0; 252 int index = 0;
253 List<Node> valueReferences = <Node>[]; 253 List<Node> valueReferences = <Node>[];
254 List<LiteralMapEntry> mapEntries = <LiteralMapEntry>[]; 254 List<LiteralMapEntry> mapEntries = <LiteralMapEntry>[];
255 for (Link<Node> link = node.names.nodes; !link.isEmpty; link = link.tail) { 255 for (Link<Node> link = node.names.nodes; !link.isEmpty; link = link.tail) {
256 Identifier name = link.head; 256 Identifier name = link.head;
257 AstBuilder valueBuilder = new AstBuilder(name.token.charOffset); 257 AstBuilder valueBuilder = new AstBuilder(name.token.charOffset);
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 EnumMethodElementX toString = new EnumMethodElementX( 309 EnumMethodElementX toString = new EnumMethodElementX(
310 'toString', enumClass, Modifiers.EMPTY, toStringNode); 310 'toString', enumClass, Modifiers.EMPTY, toStringNode);
311 FunctionSignatureX toStringSignature = 311 FunctionSignatureX toStringSignature =
312 new FunctionSignatureX(type: new FunctionType(toString, stringType)); 312 new FunctionSignatureX(type: new FunctionType(toString, stringType));
313 toString.functionSignature = toStringSignature; 313 toString.functionSignature = toStringSignature;
314 enumClass.addMember(toString, reporter); 314 enumClass.addMember(toString, reporter);
315 315
316 enumClass.enumValues = enumValues; 316 enumClass.enumValues = enumValues;
317 } 317 }
318 } 318 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/resolution/constructors.dart ('k') | pkg/compiler/lib/src/resolution/members.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698