fix prototype
This commit is contained in:
@@ -18,10 +18,15 @@ public class PrettyprinterVisitor implements ProgramVisitor<String,String>,
|
||||
@Override
|
||||
public String visitProgram(ProgramImp prog, String indent) {
|
||||
String str ="";
|
||||
for(int i = 0; i<prog.fonctions().size(); i++){
|
||||
str += prog.fonctions().get(i).accept(this,INDENT);
|
||||
if(i<prog.fonctions().size()-1) str += "\n";
|
||||
}
|
||||
for(int i= 0; i<prog.protos().size();i++){
|
||||
str+=prog.protos().get(i).accept(this, INDENT);
|
||||
if(i<prog.protos().size()-1) str += "\n";
|
||||
}
|
||||
str+="\n";
|
||||
for(int i = 0; i<prog.fonctions().size(); i++){
|
||||
str += prog.fonctions().get(i).accept(this,INDENT);
|
||||
if(i<prog.fonctions().size()-1) str += "\n";
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
@@ -29,7 +34,6 @@ public class PrettyprinterVisitor implements ProgramVisitor<String,String>,
|
||||
@Override
|
||||
public String visitPrototype(PrototypeImp proto, String indent){
|
||||
String str= indent + "PROTO "+proto.type().accept(this, "")+ " "+ proto.nom() + "(";
|
||||
|
||||
for(int i=0; i<proto.params().size();i++){
|
||||
str+=proto.params().get(i).accept(this, "");
|
||||
if((i<proto.params().size()-1)){
|
||||
@@ -43,7 +47,6 @@ public class PrettyprinterVisitor implements ProgramVisitor<String,String>,
|
||||
@Override
|
||||
public String visitFunction(FunctionImp fun, String indent) {
|
||||
String str = indent+"FUNC " + fun.type().accept(this,"")+ " " + fun.nom() +"(";
|
||||
|
||||
for(int i=0; i<fun.params().size();i++){
|
||||
str+=fun.params().get(i).accept(this, "");
|
||||
if((i<fun.params().size()-1)){
|
||||
|
||||
Reference in New Issue
Block a user