OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 /** | 5 /** |
6 * Dart backend helper for converting program IR back to source code. | 6 * Dart backend helper for converting program IR back to source code. |
7 */ | 7 */ |
8 class Emitter { | 8 class Emitter { |
9 | 9 |
10 final DiagnosticListener listener; | 10 final DiagnosticListener listener; |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 if (variables.type !== null) { | 43 if (variables.type !== null) { |
44 sb.add(variables.type); | 44 sb.add(variables.type); |
45 sb.add(' '); | 45 sb.add(' '); |
46 } | 46 } |
47 } | 47 } |
48 // TODO(smok): Maybe not rely on node unparsing, | 48 // TODO(smok): Maybe not rely on node unparsing, |
49 // but unparse initializer manually. | 49 // but unparse initializer manually. |
50 sb.add(element.parseNode(listener).unparse()); | 50 sb.add(element.parseNode(listener).unparse()); |
51 sb.add(';'); | 51 sb.add(';'); |
52 } else { | 52 } else { |
53 if (element.isSetter()) { | |
54 sb.add('set '); | |
55 } else if (element.isGetter()) { | |
56 sb.add('get '); | |
57 } | |
58 sb.add(element.parseNode(listener).unparse()); | 53 sb.add(element.parseNode(listener).unparse()); |
59 } | 54 } |
60 } | 55 } |
61 | 56 |
62 String toString() => sb.toString(); | 57 String toString() => sb.toString(); |
63 } | 58 } |
OLD | NEW |