Code::set_global reduction

This commit is contained in:
2024-12-02 00:43:57 -05:00
parent f9b5029e64
commit c38b077c37
4 changed files with 13 additions and 302 deletions

View File

@ -139,6 +139,18 @@ bool is_valid(Code self)
return self.ast != nullptr && self.ast->Type != CodeT::Invalid;
}
inline
void set_global(Code self)
{
if ( self.ast == nullptr )
{
log_failure("Code::set_global: Cannot set code as global, AST is null!");
return;
}
self->Parent = Code_Global.ast;
}
inline
Code& Code::operator ++()
{