Skip to content

Commit

Permalink
[include] Cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
5pilow committed May 11, 2023
1 parent 8208500 commit 745fd5c
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 10 deletions.
1 change: 1 addition & 0 deletions src/main/java/leekscript/compiler/JavaCompiler.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public AIClassEntry(Class<?> clazz, long timestamp) {
static {
classpath = new File(LeekScript.class.getProtectionDomain().getCodeSource().getLocation().getPath()).getPath();
classpath += ":/home/pierre/dev/leek-wars/generator/bin/main";
classpath += ":/home/pierre/dev/leek-wars/generator/leekwars-env/bin/main";
arguments.addAll(Arrays.asList("-classpath", classpath, "-nowarn"));
try {
urlLoader = new URLClassLoader(new URL[] { new File(IA_PATH).toURI().toURL() }, new ClassLoader() {});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -696,16 +696,16 @@ public void createJava(MainLeekBlock mainblock, JavaWriter writer) {
current = current.parent;
}
for (int i = classes.size() - 1; i >= 0; --i) {
var clazz = classes.get(i);
for (var field : clazz.fields.entrySet()) {
// var clazz = classes.get(i);
// for (var field : clazz.fields.entrySet()) {
// writer.addCode("u_this.addField(" + writer.getAIThis() + ", \"" + field.getKey() + "\", ");
// if (field.getValue().expression != null) {
// field.getValue().expression.writeJavaCode(mainblock, writer);
// } else {
// writer.addCode("null");
// }
// writer.addLine(", AccessLevel." + field.getValue().level + ", " + field.getValue().isFinal + ");");
}
// }
}
writer.addLine("return null;");
writer.addLine("}};");
Expand Down Expand Up @@ -815,12 +815,12 @@ private void writeFields(MainLeekBlock mainblock, JavaWriter writer, String clas
parent.writeFields(mainblock, writer, className);
}

for (Entry<String, ClassDeclarationField> field : fields.entrySet()) {
// for (Entry<String, ClassDeclarationField> field : fields.entrySet()) {
// writer.addCode(className);
// writer.addCode(".addField(\"" + field.getKey() + "\"");
// writer.addCode(", AccessLevel." + field.getValue().level + ", " + field.getValue().isFinal);
// writer.addLine(");");
}
// }
}

public Token getParentToken() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package leekscript.compiler.resolver;

import java.io.FileNotFoundException;
import java.io.FileReader;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
Expand Down
3 changes: 0 additions & 3 deletions src/main/java/leekscript/runner/AI.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package leekscript.runner;

import leekscript.AILog;
import leekscript.ErrorManager;
import leekscript.compiler.AIFile;
import leekscript.compiler.LineMapping;
import leekscript.compiler.RandomGenerator;
Expand All @@ -22,15 +21,13 @@

import java.io.File;
import java.io.IOException;
import java.lang.annotation.Native;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.nio.file.Files;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.Random;
import java.util.Set;
import java.util.TreeMap;
Expand Down
1 change: 0 additions & 1 deletion src/main/java/leekscript/runner/values/ClassLeekValue.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package leekscript.runner.values;

import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.LinkedHashMap;
Expand Down

0 comments on commit 745fd5c

Please sign in to comment.