| 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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 } | 51 } |
| 52 | 52 |
| 53 Token symbolToken(PrecedenceInfo info) { | 53 Token symbolToken(PrecedenceInfo info) { |
| 54 return new SymbolToken(info, charOffset); | 54 return new SymbolToken(info, charOffset); |
| 55 } | 55 } |
| 56 | 56 |
| 57 Identifier identifier(String text) { | 57 Identifier identifier(String text) { |
| 58 Keyword keyword = Keyword.keywords[text]; | 58 Keyword keyword = Keyword.keywords[text]; |
| 59 Token token; | 59 Token token; |
| 60 if (keyword != null) { | 60 if (keyword != null) { |
| 61 token = new KeywordToken(Keyword.keywords[text], charOffset); | 61 token = new KeywordToken(keyword, charOffset); |
| 62 } else { | 62 } else { |
| 63 token = stringToken(text); | 63 token = stringToken(text); |
| 64 } | 64 } |
| 65 return new Identifier(token); | 65 return new Identifier(token); |
| 66 } | 66 } |
| 67 | 67 |
| 68 Link linkedList(List elements) { | 68 Link linkedList(List elements) { |
| 69 LinkBuilder builder = new LinkBuilder(); | 69 LinkBuilder builder = new LinkBuilder(); |
| 70 elements.forEach((e) => builder.addLast(e)); | 70 elements.forEach((e) => builder.addLast(e)); |
| 71 return builder.toLink(); | 71 return builder.toLink(); |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 313 EnumMethodElementX toString = new EnumMethodElementX( | 313 EnumMethodElementX toString = new EnumMethodElementX( |
| 314 'toString', enumClass, Modifiers.EMPTY, toStringNode); | 314 'toString', enumClass, Modifiers.EMPTY, toStringNode); |
| 315 FunctionSignatureX toStringSignature = new FunctionSignatureX( | 315 FunctionSignatureX toStringSignature = new FunctionSignatureX( |
| 316 type: new ResolutionFunctionType(toString, stringType)); | 316 type: new ResolutionFunctionType(toString, stringType)); |
| 317 toString.functionSignature = toStringSignature; | 317 toString.functionSignature = toStringSignature; |
| 318 enumClass.addMember(toString, reporter); | 318 enumClass.addMember(toString, reporter); |
| 319 | 319 |
| 320 enumClass.enumValues = enumValues; | 320 enumClass.enumValues = enumValues; |
| 321 } | 321 } |
| 322 } | 322 } |
| OLD | NEW |