| 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 30 matching lines...) Expand all Loading... |
| 41 } | 41 } |
| 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 info) { | 51 Token symbolToken(TokenType type) { |
| 52 return new SymbolToken(info, charOffset); | 52 return new SymbolToken(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 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 EnumMethodElementX toString = new EnumMethodElementX( | 308 EnumMethodElementX toString = new EnumMethodElementX( |
| 309 'toString', enumClass, Modifiers.EMPTY, toStringNode); | 309 'toString', enumClass, Modifiers.EMPTY, toStringNode); |
| 310 FunctionSignatureX toStringSignature = new FunctionSignatureX( | 310 FunctionSignatureX toStringSignature = new FunctionSignatureX( |
| 311 type: new ResolutionFunctionType(toString, stringType)); | 311 type: new ResolutionFunctionType(toString, stringType)); |
| 312 toString.functionSignature = toStringSignature; | 312 toString.functionSignature = toStringSignature; |
| 313 enumClass.addMember(toString, reporter); | 313 enumClass.addMember(toString, reporter); |
| 314 | 314 |
| 315 enumClass.enumValues = enumValues; | 315 enumClass.enumValues = enumValues; |
| 316 } | 316 } |
| 317 } | 317 } |
| OLD | NEW |