progress (Code)

This commit is contained in:
2024-12-02 00:03:38 -05:00
parent f9c21ebc04
commit 937235b776
10 changed files with 306 additions and 594 deletions

View File

@ -346,9 +346,11 @@ CodeBody gen_ast_inlines()
#pragma push_macro("GEN_NS")
#pragma push_macro("rcast")
#pragma push_macro("log_failure")
#pragma push_macro("CodeInvalid")
#undef GEN_NS
#undef rcast
#undef log_failure
#undef CodeInvalid
char const* code_impl_tmpl = stringize(
\n
inline
@ -365,7 +367,7 @@ CodeBody gen_ast_inlines()
if ( ast == nullptr )
{
log_failure("Code::duplicate: Cannot duplicate code, AST is null!");
return Code::Invalid;
return Code_Invalid;
}
return { rcast(AST*, ast)->duplicate() };
@ -404,7 +406,7 @@ CodeBody gen_ast_inlines()
return;
}
rcast(AST*, ast)->Parent = Code::Global.ast;
rcast(AST*, ast)->Parent = Code_Global.ast;
}
inline
<typename>& <typename>::operator =( Code other )
@ -419,16 +421,6 @@ CodeBody gen_ast_inlines()
return *this;
}
inline
bool <typename>::operator ==( Code other )
{
return (AST*) ast == other.ast;
}
inline
bool <typename>::operator !=( Code other )
{
return (AST*) ast != other.ast;
}
inline
<typename>::operator bool()
{
return ast != nullptr;
@ -459,6 +451,7 @@ CodeBody gen_ast_inlines()
\n
);
#pragma pop_macro("GEN_NS")
#pragma pop_macro("CodeInvalid")
CodeBody impl_code = parse_global_body( token_fmt( "typename", StrC name(Code), code_impl_tmpl ));
CodeBody impl_code_body = parse_global_body( token_fmt( "typename", StrC name(CodeBody), code_impl_tmpl ));