print les strings
This commit is contained in:
@@ -60,7 +60,11 @@ public class PrettyprinterVisitor implements ProgramVisitor<String,String>,
|
||||
|
||||
@Override
|
||||
public String visitPrint(PrintImp instr, String indent) {
|
||||
return indent+ "PRINT \""+instr.t() +"\"";
|
||||
String str = indent + "PRINT ";
|
||||
for (String elem: instr.t()){
|
||||
str += "\"" +elem +"\"";
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
//EXPRESSION
|
||||
|
||||
@@ -73,7 +73,7 @@ public class Program{
|
||||
}
|
||||
}
|
||||
|
||||
public static record PrintImp(String t) implements Instruction{
|
||||
public static record PrintImp(ArrayList<String> t) implements Instruction{
|
||||
@Override
|
||||
public <H, S> S accept(InstrVisitor<H, S> v, H h) {
|
||||
return v.visitPrint(this, h);
|
||||
|
||||
Reference in New Issue
Block a user