Move package data
This commit is contained in:
@@ -154,7 +154,7 @@ bool add_dynamic_array_macro() {
|
||||
// that is going to be imported into every other package, for now we use only the current package
|
||||
For(array_of_to_gen) {
|
||||
LC_AST *ast = LC_ParseDeclf("ArrayOf%s :: struct { data: *%s; len: int; cap: int; }", (char *)it, (char *)it);
|
||||
LC_AST *file = package->apackage.ext->ffile;
|
||||
LC_AST *file = package->apackage.ffile;
|
||||
|
||||
LC_DLLAdd(file->afile.fdecl, file->afile.ldecl, ast);
|
||||
}
|
||||
|
||||
@@ -78,11 +78,11 @@ bool sandbox() {
|
||||
//
|
||||
LC_AST *package = LC_GetPackageByName(name);
|
||||
LC_AST *dynamic_array_file = NULL;
|
||||
LC_ASTFor(it, package->apackage.ext->ffile) {
|
||||
LC_ASTFor(it, package->apackage.ffile) {
|
||||
S8_String path = S8_MakeFromChar((char *)it->afile.x->file);
|
||||
if (S8_EndsWith(path, "dynamic_array.lc")) {
|
||||
dynamic_array_file = it;
|
||||
DLL_QUEUE_REMOVE(package->apackage.ext->ffile, package->apackage.ext->lfile, it);
|
||||
DLL_QUEUE_REMOVE(package->apackage.ffile, package->apackage.lfile, it);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -94,7 +94,7 @@ bool sandbox() {
|
||||
|
||||
walker.user_data = (void *)⁢
|
||||
LC_WalkAST(&walker, new_array_file);
|
||||
LC_DLLAdd(package->apackage.ext->ffile, package->apackage.ext->lfile, new_array_file);
|
||||
LC_DLLAdd(package->apackage.ffile, package->apackage.lfile, new_array_file);
|
||||
}
|
||||
|
||||
LC_OrderAndResolveTopLevelDecls(name);
|
||||
|
||||
Reference in New Issue
Block a user