Skip to content

Commit

Permalink
Initial move to the V2Engine
Browse files Browse the repository at this point in the history
  • Loading branch information
NGSpace committed Jan 15, 2025
1 parent a59d6c0 commit c00bf71
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package io.github.ngspace.hudder.hudderv2;

import io.github.ngspace.hudder.v2runtime.values.DefaultV2VariableParser;

public class HudderV2VariableParser extends DefaultV2VariableParser {

}
10 changes: 3 additions & 7 deletions src/main/java/io/github/ngspace/hudder/v2runtime/V2Runtime.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@
import io.github.ngspace.hudder.compilers.utils.CompileException;
import io.github.ngspace.hudder.compilers.utils.CompileState;
import io.github.ngspace.hudder.v2runtime.runtime_elements.AV2RuntimeElement;
import io.github.ngspace.hudder.v2runtime.runtime_elements.StringV2RuntimeElement;

public class V2Runtime {
public final AV2Compiler compiler;
protected V2Runtime scope;
/**
* Should stay mostly unused for now.
*/
public static final Object NULL = new Object() {
public static final Object VOID = new Void();
private static class Void {
@Override public boolean equals(Object obj) {return obj == this || obj == null;}
@Override public int hashCode() {return super.hashCode();}
@Override public String toString() {return "null";}
};
}
public V2Runtime(AV2Compiler compiler, V2Runtime scope) {this.compiler = compiler;this.scope = scope;}

protected AV2RuntimeElement[] elements = new AV2RuntimeElement[0];
Expand All @@ -31,14 +31,10 @@ public CompileState execute() throws CompileException {
for (int i = 0;i<elements.length;i++) {
AV2RuntimeElement element = elements[i];
if (!element.execute(compileState, builder)||compileState.hasReturned) {
// System.out.println("r"+(compiler.globalRuntime==this));
compileState.hasBroken = true;
break;
}
// System.out.println(element.getClass().getSimpleName());
// if (element instanceof StringV2RuntimeElement e) System.out.println(e.string);
}
// System.out.println(builder.toString());
compileState.addString(builder.toString(), false);
return compileState;
}
Expand Down

0 comments on commit c00bf71

Please sign in to comment.