| 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 // SExpressionUnstringifier implements the inverse operation to | 5 // SExpressionUnstringifier implements the inverse operation to |
| 6 // [SExpressionStringifier]. | 6 // [SExpressionStringifier]. |
| 7 | 7 |
| 8 library sexpr_unstringifier; | 8 library sexpr_unstringifier; |
| 9 | 9 |
| 10 import 'package:compiler/src/constants/expressions.dart' | 10 import 'package:compiler/src/constants/expressions.dart' |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 } | 32 } |
| 33 | 33 |
| 34 /// Used whenever a node constructed by [SExpressionUnstringifier] needs a | 34 /// Used whenever a node constructed by [SExpressionUnstringifier] needs a |
| 35 /// local. | 35 /// local. |
| 36 class DummyLocal extends DummyEntity implements Local { | 36 class DummyLocal extends DummyEntity implements Local { |
| 37 DummyLocal(String name) : super(name); | 37 DummyLocal(String name) : super(name); |
| 38 | 38 |
| 39 ExecutableElement get executableContext => null; | 39 ExecutableElement get executableContext => null; |
| 40 } | 40 } |
| 41 | 41 |
| 42 // TODO(karlklose): we should remove all references to [ErroneousElement] from |
| 43 // the CPS IR. Instead, the builder must construct appropriate terms for ASTs |
| 44 // that could not be resolved correctly. Perhaps the IR should not rely on |
| 45 // elements at all for naming. |
| 42 /// Used whenever a node constructed by [SExpressionUnstringifier] requires | 46 /// Used whenever a node constructed by [SExpressionUnstringifier] requires |
| 43 /// an [Element] or [FunctionElement]. Extends [ErroneousElementX] since there | 47 /// an [Element] or [FunctionElement]. Extends [ErroneousElementX] since there |
| 44 /// is currently a large amount of overhead when extending the base abstract | 48 /// is currently a large amount of overhead when extending the base abstract |
| 45 /// classes, and erroneous elements conveniently also skip several assertion | 49 /// classes, and erroneous elements conveniently also skip several assertion |
| 46 /// checks in CPS IR nodes that are irrelevant to us. | 50 /// checks in CPS IR nodes that are irrelevant to us. |
| 47 class DummyElement extends ErroneousElementX | 51 class DummyElement extends ErroneousElementX |
| 48 implements TypeVariableElement { | 52 implements TypeVariableElement { |
| 49 DummyElement(String name) | 53 DummyElement(String name) |
| 50 : super(dart2js.MessageKind.GENERIC, {}, name, null); | 54 : super(dart2js.MessageKind.GENERIC, {}, name, null); |
| 51 | 55 |
| (...skipping 626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 678 return new ReifyTypeVar(type); | 682 return new ReifyTypeVar(type); |
| 679 } | 683 } |
| 680 | 684 |
| 681 /// (This) | 685 /// (This) |
| 682 This parseThis() { | 686 This parseThis() { |
| 683 tokens.consumeStart(THIS); | 687 tokens.consumeStart(THIS); |
| 684 tokens.consumeEnd(); | 688 tokens.consumeEnd(); |
| 685 return new This(); | 689 return new This(); |
| 686 } | 690 } |
| 687 } | 691 } |
| OLD | NEW |