Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(105)

Side by Side Diff: lib/compiler/implementation/tree/unparser.dart

Issue 10828076: Support signed constants. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Ready for review Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 class Unparser implements Visitor { 5 class Unparser implements Visitor {
6 final Renamer renamer; 6 final Renamer renamer;
7 StringBuffer sb; 7 StringBuffer sb;
8 8
9 Unparser([this.renamer = const Renamer()]); 9 Unparser([this.renamer = const Renamer()]);
10 10
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 visit(node.elsePart); 136 visit(node.elsePart);
137 } 137 }
138 } 138 }
139 139
140 visitLiteralBool(LiteralBool node) { 140 visitLiteralBool(LiteralBool node) {
141 add(node.token.value); 141 add(node.token.value);
142 } 142 }
143 143
144 visitLiteralDouble(LiteralDouble node) { 144 visitLiteralDouble(LiteralDouble node) {
145 add(node.token.value); 145 add(node.token.value);
146 if (node.token.kind == PLUS_TOKEN) add(node.token.next.value);
Roman 2012/07/31 07:52:12 please add a comment about how things like "-42" a
Anton Muhin 2012/07/31 08:01:16 Done.
146 } 147 }
147 148
148 visitLiteralInt(LiteralInt node) { 149 visitLiteralInt(LiteralInt node) {
149 add(node.token.value); 150 add(node.token.value);
151 if (node.token.kind == PLUS_TOKEN) add(node.token.next.value);
150 } 152 }
151 153
152 visitLiteralString(LiteralString node) { 154 visitLiteralString(LiteralString node) {
153 add(node.token.value); 155 add(node.token.value);
154 } 156 }
155 157
156 visitStringJuxtaposition(StringJuxtaposition node) { 158 visitStringJuxtaposition(StringJuxtaposition node) {
157 visit(node.first); 159 visit(node.first);
158 sb.add(" "); 160 sb.add(" ");
159 visit(node.second); 161 visit(node.second);
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after
501 sb.add(' '); 503 sb.add(' ');
502 } 504 }
503 visit(node.name); 505 visit(node.name);
504 if (node.typeParameters !== null) { 506 if (node.typeParameters !== null) {
505 visit(node.typeParameters); 507 visit(node.typeParameters);
506 } 508 }
507 visit(node.formals); 509 visit(node.formals);
508 add(node.endToken.value); 510 add(node.endToken.value);
509 } 511 }
510 } 512 }
OLDNEW
« no previous file with comments | « no previous file | tests/compiler/dart2js/unparser_test.dart » ('j') | tests/compiler/dart2js/unparser_test.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698