pick up preexisting new function in KissInterp2 class
All checks were successful
CI / test-core (14, ubuntu-latest, 3.x, js) (push) Successful in 2m23s
CI / test-core (14, ubuntu-latest, 3.x, nodejs) (push) Successful in 2m41s
CI / test-core (14, ubuntu-latest, 3.x, py) (push) Successful in 2m51s
CI / test-core (14, ubuntu-latest, 3.x, cpp) (push) Successful in 3m13s
CI / test-core (14, ubuntu-latest, 3.x, interp) (push) Successful in 4m25s

This commit is contained in:
2025-09-15 20:04:30 -05:00
parent 4ed85110a7
commit 8f20138e7b

View File

@@ -11,9 +11,22 @@ class KissInterp2 {
public static function build():Array<Field> {
var fields = Kiss.build(Prelude.joinPath(Helpers.libPath("kiss"), "src/kiss/KissInterp2.kiss"));
var preexistingNewBody = macro {};
for(field in fields) {
if(field.name == "new") {
switch(field.kind) {
case FFun(fun):
preexistingNewBody = fun.expr;
default:
}
fields.remove(field);
}
}
// TODO put imported types into the global variables interp
var imports = Context.getLocalImports();
fields.push({
pos: Context.currentPos(),
name: "new",
@@ -24,6 +37,7 @@ class KissInterp2 {
args: [],
expr: macro {
specialForms = _specialForms();
$preexistingNewBody;
}
})
});