Skip to content
Snippets Groups Projects
Commit a52e3838 authored by Anders Nilsson's avatar Anders Nilsson
Browse files

Fixed PrettyPrinter indentation

parent ed1e4c15
No related branches found
No related tags found
No related merge requests found
...@@ -122,9 +122,8 @@ aspect GenPrettyPrinter { ...@@ -122,9 +122,8 @@ aspect GenPrettyPrinter {
pStream.println(); pStream.println();
pStream.println("aspect PrettyPrinter {"); pStream.println("aspect PrettyPrinter {");
pStream.println(" public void ASTNode.prettyPrint(String indent, PrintStream pStream) {"); pStream.println(" public void ASTNode.prettyPrint(String indent, PrintStream pStream) {");
pStream.println(" String childIndent = indent + \" \";");
pStream.println(" for (int i=0; i<getNumChild(); i++) {"); pStream.println(" for (int i=0; i<getNumChild(); i++) {");
pStream.println(" getChild(i).prettyPrint(childIndent,pStream);"); pStream.println(" getChild(i).prettyPrint(indent,pStream);");
pStream.println(" }"); pStream.println(" }");
pStream.println(" }\n"); pStream.println(" }\n");
super.genPrettyPrinter(ind,pStream); super.genPrettyPrinter(ind,pStream);
...@@ -139,8 +138,9 @@ aspect GenPrettyPrinter { ...@@ -139,8 +138,9 @@ aspect GenPrettyPrinter {
// getAttribute(i).genPrettyPrinter(ind,pStream); // getAttribute(i).genPrettyPrinter(ind,pStream);
// } // }
pStream.println(">\");"); pStream.println(">\");");
pStream.println(" String childIndent = indent + \" \";");
pStream.println(" for (int i=0; i<getNumElement(); i++) {"); pStream.println(" for (int i=0; i<getNumElement(); i++) {");
pStream.println(" getElement(i).prettyPrint(indent,pStream);"); pStream.println(" getElement(i).prettyPrint(childIndent,pStream);");
pStream.println(" }"); pStream.println(" }");
pStream.println(" System.out.println(indent+\"</"+name()+">\");"); pStream.println(" System.out.println(indent+\"</"+name()+">\");");
pStream.println("}\n"); pStream.println("}\n");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment