Code::is_equal reduction

This commit is contained in:
2024-12-02 00:34:40 -05:00
parent 5cd69e1742
commit 2b24511f7d
5 changed files with 42 additions and 300 deletions

View File

@ -121,6 +121,18 @@ bool is_body(Code code)
return false;
}
inline
bool is_equal( Code self, Code other )
{
if ( self.ast == nullptr || other.ast == nullptr )
{
// Just check if they're both null.
// log_failure( "Code::is_equal: Cannot compare code, AST is null!" );
return self.ast == nullptr && other.ast == nullptr;
}
return is_equal( self.ast, other.ast );
}
inline
Code& Code::operator ++()
{