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

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

Issue 2567133002: Add support for the new function-type syntax. (Closed)
Patch Set: Fixes after rebase. Created 3 years, 10 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 1aa5eb70be30a4c9d324f5fd40b1e1d30776c7a5..0413e23263c73f5fc5e6c4d2e20a8b19479f7091 100644
--- a/pkg/compiler/lib/src/tree/unparser.dart
+++ b/pkg/compiler/lib/src/tree/unparser.dart
@@ -548,11 +548,18 @@ class Unparser extends Indentation implements Visitor {
visit(node.expression);
}
- visitTypeAnnotation(TypeAnnotation node) {
+ visitNominalTypeAnnotation(NominalTypeAnnotation node) {
visit(node.typeName);
visit(node.typeArguments);
}
+ visitFunctionTypeAnnotation(FunctionTypeAnnotation node) {
+ visit(node.returnType);
+ write(' Function');
+ visit(node.typeParameters);
+ visit(node.formals);
+ }
+
visitTypeVariable(TypeVariable node) {
visit(node.name);
if (node.bound != null) {
@@ -771,8 +778,8 @@ class Unparser extends Indentation implements Visitor {
write(' ');
}
visit(node.name);
- if (node.typeParameters != null) {
- visit(node.typeParameters);
+ if (node.templateParameters != null) {
+ visit(node.templateParameters);
}
visit(node.formals);
write(node.endToken.value);
@@ -904,4 +911,8 @@ class Unparser extends Indentation implements Visitor {
visitStringNode(StringNode node) {
throw 'internal error'; // Should not be called.
}
+
+ visitTypeAnnotation(TypeAnnotation node) {
+ throw 'internal error'; // Should not be called.
+ }
}

Powered by Google App Engine
This is Rietveld 408576698