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

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: 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
« no previous file with comments | « no previous file | tests/compiler/dart2js/unparser_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 // -Lit is represented as a send.
147 if (node.token.kind == PLUS_TOKEN) add(node.token.next.value);
146 } 148 }
147 149
148 visitLiteralInt(LiteralInt node) { 150 visitLiteralInt(LiteralInt node) {
149 add(node.token.value); 151 add(node.token.value);
152 // -Lit is represented as a send.
153 if (node.token.kind == PLUS_TOKEN) add(node.token.next.value);
150 } 154 }
151 155
152 visitLiteralString(LiteralString node) { 156 visitLiteralString(LiteralString node) {
153 add(node.token.value); 157 add(node.token.value);
154 } 158 }
155 159
156 visitStringJuxtaposition(StringJuxtaposition node) { 160 visitStringJuxtaposition(StringJuxtaposition node) {
157 visit(node.first); 161 visit(node.first);
158 sb.add(" "); 162 sb.add(" ");
159 visit(node.second); 163 visit(node.second);
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after
501 sb.add(' '); 505 sb.add(' ');
502 } 506 }
503 visit(node.name); 507 visit(node.name);
504 if (node.typeParameters !== null) { 508 if (node.typeParameters !== null) {
505 visit(node.typeParameters); 509 visit(node.typeParameters);
506 } 510 }
507 visit(node.formals); 511 visit(node.formals);
508 add(node.endToken.value); 512 add(node.endToken.value);
509 } 513 }
510 } 514 }
OLDNEW
« no previous file with comments | « no previous file | tests/compiler/dart2js/unparser_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698