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

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

Issue 1520293002: Add token invariant to DiagnosticReporter (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Rebase + status update Created 5 years 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 8 import '../core_types.dart' show
9 CoreTypes; 9 CoreTypes;
10 import '../dart_types.dart'; 10 import '../dart_types.dart';
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 return new LiteralMap( 173 return new LiteralMap(
174 null, // Type arguments. 174 null, // Type arguments.
175 new NodeList(symbolToken(Precedence.OPEN_CURLY_BRACKET_INFO), 175 new NodeList(symbolToken(Precedence.OPEN_CURLY_BRACKET_INFO),
176 linkedList(entries), 176 linkedList(entries),
177 symbolToken(Precedence.CLOSE_CURLY_BRACKET_INFO), 177 symbolToken(Precedence.CLOSE_CURLY_BRACKET_INFO),
178 ','), 178 ','),
179 isConst ? keywordToken('const') : null); 179 isConst ? keywordToken('const') : null);
180 } 180 }
181 } 181 }
182 182
183 // TODO(johnniwinther): Avoid creating synthesized ASTs for enums when SSA is
184 // removed.
183 class EnumCreator { 185 class EnumCreator {
184 final DiagnosticReporter reporter; 186 final DiagnosticReporter reporter;
185 final CoreTypes coreTypes; 187 final CoreTypes coreTypes;
186 final EnumClassElementX enumClass; 188 final EnumClassElementX enumClass;
187 189
188 EnumCreator(this.reporter, this.coreTypes, this.enumClass); 190 EnumCreator(this.reporter, this.coreTypes, this.enumClass);
189 191
190 void createMembers() { 192 void createMembers() {
191 Enum node = enumClass.node; 193 Enum node = enumClass.node;
192 InterfaceType enumType = enumClass.thisType; 194 InterfaceType enumType = enumClass.thisType;
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 EnumMethodElementX toString = new EnumMethodElementX('toString', 304 EnumMethodElementX toString = new EnumMethodElementX('toString',
303 enumClass, Modifiers.EMPTY, toStringNode); 305 enumClass, Modifiers.EMPTY, toStringNode);
304 FunctionSignatureX toStringSignature = new FunctionSignatureX( 306 FunctionSignatureX toStringSignature = new FunctionSignatureX(
305 type: new FunctionType(toString, stringType)); 307 type: new FunctionType(toString, stringType));
306 toString.functionSignature = toStringSignature; 308 toString.functionSignature = toStringSignature;
307 enumClass.addMember(toString, reporter); 309 enumClass.addMember(toString, reporter);
308 310
309 enumClass.enumValues = enumValues; 311 enumClass.enumValues = enumValues;
310 } 312 }
311 } 313 }
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