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

Unified Diff: pkg/compiler/lib/src/tree/prettyprint.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/prettyprint.dart
diff --git a/pkg/compiler/lib/src/tree/prettyprint.dart b/pkg/compiler/lib/src/tree/prettyprint.dart
index 6056a3d76960e6eb968ce46ddc7bd05e5efbdf96..6a9aa96a2baa2d75de201d63c21db9f6bdc08a50 100644
--- a/pkg/compiler/lib/src/tree/prettyprint.dart
+++ b/pkg/compiler/lib/src/tree/prettyprint.dart
@@ -153,6 +153,14 @@ class PrettyPrinter extends Indentation with Tagging<Node> implements Visitor {
closeNode();
}
+ visitFunctionTypeAnnotation(FunctionTypeAnnotation node) {
+ openNode(node, "FunctionTypeAnnotation");
+ visitChildNode(node.returnType, "returnType");
+ visitChildNode(node.typeParameters, "typeParameters");
+ visitChildNode(node.formals, "formals");
+ closeNode();
+ }
+
visitIdentifier(Identifier node) {
openAndCloseNode(node, "Identifier", {"token": node.token});
}
@@ -244,6 +252,13 @@ class PrettyPrinter extends Indentation with Tagging<Node> implements Visitor {
}
}
+ visitNominalTypeAnnotation(NominalTypeAnnotation node) {
+ openNode(node, "NominalTypeAnnotation");
+ visitChildNode(node.typeName, "typeName");
+ visitChildNode(node.typeArguments, "typeArguments");
+ closeNode();
+ }
+
visitOperator(Operator node) {
openAndCloseNode(node, "Operator", {"value": node.token});
}
@@ -345,13 +360,6 @@ class PrettyPrinter extends Indentation with Tagging<Node> implements Visitor {
visitNodeWithChildren(node, "TryStatement");
}
- visitTypeAnnotation(TypeAnnotation node) {
- openNode(node, "TypeAnnotation");
- visitChildNode(node.typeName, "typeName");
- visitChildNode(node.typeArguments, "typeArguments");
- closeNode();
- }
-
visitTypedef(Typedef node) {
visitNodeWithChildren(node, "Typedef");
}
@@ -472,6 +480,10 @@ class PrettyPrinter extends Indentation with Tagging<Node> implements Visitor {
unimplemented('visitNode', node: node);
}
+ visitTypeAnnotation(TypeAnnotation node) {
+ unimplemented('visitNode', node: node);
+ }
+
unimplemented(String message, {Node node}) {
throw message;
}

Powered by Google App Engine
This is Rietveld 408576698