Skip to content
Snippets Groups Projects
Commit a75a8ce2 authored by Jesper's avatar Jesper
Browse files

[cleanup] Remove duplicated code

parent 246dcc6f
Branches
No related tags found
No related merge requests found
...@@ -142,7 +142,7 @@ outer: while (true) { ...@@ -142,7 +142,7 @@ outer: while (true) {
* @param obj original class body object * @param obj original class body object
* @return generated javadoc comment * @return generated javadoc comment
*/ */
public String ASTDecl.docComment(ClassBodyObject obj) { public String TypeDecl.docComment(ClassBodyObject obj) {
JavaDocParser parser = new JavaDocParser(); JavaDocParser parser = new JavaDocParser();
TemplateContext tt = templateContext(); TemplateContext tt = templateContext();
tt.bind("SourceComment", parser.parse(obj.comments)); tt.bind("SourceComment", parser.parse(obj.comments));
......
...@@ -298,15 +298,7 @@ aspect JastAddCodeGen { ...@@ -298,15 +298,7 @@ aspect JastAddCodeGen {
ByteArrayOutputStream bos = new ByteArrayOutputStream(); ByteArrayOutputStream bos = new ByteArrayOutputStream();
PrintStream stream = new PrintStream(bos, true, "UTF-8"); PrintStream stream = new PrintStream(bos, true, "UTF-8");
stream.println(typeDeclarationString()); stream.println(typeDeclarationString());
StringBuffer buf = new StringBuffer(); emitMembers(stream);
for (ClassBodyObject obj : classBodyDecls) {
org.jastadd.jrag.AST.SimpleNode n = obj.node;
buf.append(config().indent);
buf.append(obj.modifiers());
n.jjtAccept(new ClassBodyDeclUnparser(), buf);
buf.append("\n\n");
}
stream.println(buf.toString());
emitAbstractSyns(stream); emitAbstractSyns(stream);
emitInhDeclarations(stream); emitInhDeclarations(stream);
stream.close(); stream.close();
......
...@@ -289,9 +289,7 @@ aspect JragCodeGen { ...@@ -289,9 +289,7 @@ aspect JragCodeGen {
} }
} }
public void TypeDecl.emitMembers(PrintStream out) { } public void TypeDecl.emitMembers(PrintStream out) {
public void ASTDecl.emitMembers(PrintStream out) {
for (ClassBodyObject obj : classBodyDecls) { for (ClassBodyObject obj : classBodyDecls) {
org.jastadd.jrag.AST.SimpleNode node = obj.node; org.jastadd.jrag.AST.SimpleNode node = obj.node;
out.print(obj.modifiers()); out.print(obj.modifiers());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment