params function

This commit is contained in:
trochas
2025-04-25 15:05:27 +02:00
parent a86f3433be
commit c281229dbf
3 changed files with 15 additions and 10 deletions

View File

@@ -36,9 +36,9 @@ public class PrettyprinterVisitor implements ProgramVisitor<String,String>,
public String visitPrototype(PrototypeImp proto, String indent){
String str= indent + "PROTO "+proto.type().accept(this, "")+ " "+ proto.nom() + "(";
for(int i=0; i<proto.s().size();i++){
str+=proto.s().get(i);
if((i<proto.s().size()-1)){
for(int i=0; i<proto.params().size();i++){
str+=proto.params().get(i);
if((i<proto.params().size()-1)){
str+=", ";
}
}
@@ -51,9 +51,9 @@ public class PrettyprinterVisitor implements ProgramVisitor<String,String>,
public String visitFunction(FunctionImp fun, String indent) {
String str = indent+"FUNC " + fun.type().accept(this,"")+ " " + fun.nom() +"(";
for(int i=0; i<fun.s().size();i++){
str+=fun.s().get(i);
if((i<fun.s().size()-1)){
for(int i=0; i<fun.params().size();i++){
str+=fun.params().get(i);
if((i<fun.params().size()-1)){
str+=", ";
}
}
@@ -202,4 +202,4 @@ public class PrettyprinterVisitor implements ProgramVisitor<String,String>,
return e.name();
}
}
}