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

Unified Diff: lib/text/ast_to_text.dart

Issue 2439043002: Introduce Substitution class and Supertype class. (Closed)
Patch Set: Created 4 years, 2 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
« no previous file with comments | « lib/class_hierarchy.dart ('k') | lib/transformations/treeshaker.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/text/ast_to_text.dart
diff --git a/lib/text/ast_to_text.dart b/lib/text/ast_to_text.dart
index 48fe10da44baa6b6abd4f7624cd76eee79efecce..46850b765d50f4f7460b0f44a7103c7dae5e694f 100644
--- a/lib/text/ast_to_text.dart
+++ b/lib/text/ast_to_text.dart
@@ -419,6 +419,19 @@ class Printer extends Visitor<Null> {
}
}
+ visitSupertype(Supertype type) {
+ if (type == null) {
+ print('<No Supertype>');
+ } else {
+ writeClassReference(type.classNode);
+ if (type.typeArguments.isNotEmpty) {
+ writeSymbol('<');
+ writeList(type.typeArguments, writeType);
+ writeSymbol('>');
+ }
+ }
+ }
+
void writeModifier(bool isThere, String name) {
if (isThere) {
writeWord(name);
@@ -709,16 +722,16 @@ class Printer extends Visitor<Null> {
writeTypeParameterList(node.typeParameters);
if (node.isMixinApplication) {
writeSpaced('=');
- writeType(node.supertype);
+ visitSupertype(node.supertype);
writeSpaced('with');
- writeType(node.mixedInType);
+ visitSupertype(node.mixedInType);
} else if (node.supertype != null) {
writeSpaced('extends');
- writeType(node.supertype);
+ visitSupertype(node.supertype);
}
if (node.implementedTypes.isNotEmpty) {
writeSpaced('implements');
- writeList(node.implementedTypes, writeType);
+ writeList(node.implementedTypes, visitSupertype);
}
var endLineString = ' {';
if (node.enclosingLibrary.fileUri != node.fileUri) {
« no previous file with comments | « lib/class_hierarchy.dart ('k') | lib/transformations/treeshaker.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698