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

Unified Diff: pkg/compiler/lib/src/tree/unparser.dart

Issue 1311783012: Split parser/listener.dart, parser/class_element_listener.dart and tokens/token.dart into smaller l… (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: pkg/compiler/lib/src/tree/unparser.dart
diff --git a/pkg/compiler/lib/src/tree/unparser.dart b/pkg/compiler/lib/src/tree/unparser.dart
index b7d31098a3a8f2845148da5adb0e795974602fb3..fd00ba31403da964a071ded52d16b0a3c7bc27de 100644
--- a/pkg/compiler/lib/src/tree/unparser.dart
+++ b/pkg/compiler/lib/src/tree/unparser.dart
@@ -34,8 +34,8 @@ class Unparser extends Indentation implements Visitor {
void addToken(Token token) {
if (token == null) return;
write(token.value);
- if (identical(token.kind, KEYWORD_TOKEN)
- || identical(token.kind, IDENTIFIER_TOKEN)) {
+ if (identical(token.kind, Tokens.KEYWORD_TOKEN)
+ || identical(token.kind, Tokens.IDENTIFIER_TOKEN)) {
write(' ');
}
}
@@ -209,7 +209,7 @@ class Unparser extends Indentation implements Visitor {
} else {
visit(send.receiver);
Identifier identifier = send.selector.asIdentifier();
- if (identical(identifier.token.kind, KEYWORD_TOKEN)) {
+ if (identical(identifier.token.kind, Tokens.KEYWORD_TOKEN)) {
write(' ');
} else if (identifier.source == 'negate') {
// TODO(ahe): Remove special case for negate.
@@ -292,13 +292,13 @@ class Unparser extends Indentation implements Visitor {
visitLiteralDouble(LiteralDouble node) {
write(node.token.value);
// -Lit is represented as a send.
- if (node.token.kind == PLUS_TOKEN) write(node.token.next.value);
+ if (node.token.kind == Tokens.PLUS_TOKEN) write(node.token.next.value);
}
visitLiteralInt(LiteralInt node) {
write(node.token.value);
// -Lit is represented as a send.
- if (node.token.kind == PLUS_TOKEN) write(node.token.next.value);
+ if (node.token.kind == Tokens.PLUS_TOKEN) write(node.token.next.value);
}
visitLiteralString(LiteralString node) {

Powered by Google App Engine
This is Rietveld 408576698