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

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

Issue 2899043006: cleanup fasta token classes (Closed)
Patch Set: Created 3 years, 7 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/compiler/lib/src/parser/node_listener.dart ('k') | pkg/compiler/lib/src/tree/nodes.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) 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 '../common_elements.dart' show CommonElements; 8 import '../common_elements.dart' show CommonElements;
9 import '../elements/resolution_types.dart'; 9 import '../elements/resolution_types.dart';
10 import '../elements/elements.dart'; 10 import '../elements/elements.dart';
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 42
43 Token keywordToken(String text) { 43 Token keywordToken(String text) {
44 return new KeywordToken(Keyword.keywords[text], charOffset); 44 return new KeywordToken(Keyword.keywords[text], charOffset);
45 } 45 }
46 46
47 Token stringToken(String text) { 47 Token stringToken(String text) {
48 return new StringToken.fromString(TokenType.IDENTIFIER, text, charOffset); 48 return new StringToken.fromString(TokenType.IDENTIFIER, text, charOffset);
49 } 49 }
50 50
51 Token symbolToken(TokenType type) { 51 Token symbolToken(TokenType type) {
52 return new SymbolToken(type, charOffset); 52 return new Token(type, charOffset);
53 } 53 }
54 54
55 Identifier identifier(String text) { 55 Identifier identifier(String text) {
56 Keyword keyword = Keyword.keywords[text]; 56 Keyword keyword = Keyword.keywords[text];
57 Token token; 57 Token token;
58 if (keyword != null) { 58 if (keyword != null) {
59 token = new KeywordToken(keyword, charOffset); 59 token = new KeywordToken(keyword, charOffset);
60 } else { 60 } else {
61 token = stringToken(text); 61 token = stringToken(text);
62 } 62 }
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 EnumMethodElementX toString = new EnumMethodElementX( 350 EnumMethodElementX toString = new EnumMethodElementX(
351 'toString', enumClass, Modifiers.EMPTY, toStringNode); 351 'toString', enumClass, Modifiers.EMPTY, toStringNode);
352 FunctionSignatureX toStringSignature = new FunctionSignatureX( 352 FunctionSignatureX toStringSignature = new FunctionSignatureX(
353 type: new ResolutionFunctionType(toString, stringType)); 353 type: new ResolutionFunctionType(toString, stringType));
354 toString.functionSignature = toStringSignature; 354 toString.functionSignature = toStringSignature;
355 enumClass.addMember(toString, reporter); 355 enumClass.addMember(toString, reporter);
356 356
357 enumClass.enumValues = enumValues; 357 enumClass.enumValues = enumValues;
358 } 358 }
359 } 359 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/parser/node_listener.dart ('k') | pkg/compiler/lib/src/tree/nodes.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698