correction erreur + clean

This commit is contained in:
Rochas
2025-04-30 10:41:45 +02:00
2 changed files with 12 additions and 2 deletions

View File

@@ -182,9 +182,19 @@ public class toLLVM_Visitor implements ProgramVisitor<SymTable,ProgramLLVMImp>,
Object obj = instr.t().get(i);
if(obj instanceof String){
String str = (String)obj;
size+=str.length(); //on compte avant car \0A compte pour 1 en LLVM, mais 3 pour java
str = str.replace("\\n", "\\0A");
strGlobal+=str;
//count OA
int countOA = 0;
int index = 0;
//using array
while ((index = str.indexOf("\\0A", index)) != -1) {
countOA++;
index += 3;
}
size += str.length() - countOA * 2;
strGlobal += str;
}
else if(obj instanceof Expression){
Expression exp = (Expression)obj;

Binary file not shown.