| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |