@@ -28,8 +28,7 @@ bool Code::is_equal( Code other )
2828{
2929 if ( ast == nullptr || other.ast == nullptr )
3030 {
31- log_failure ( " Code::is_equal: Cannot compare code, AST is null!" );
32- return false ;
31+ return rcast ( AST*, ast ) == other.ast ;
3332 }
3433 return rcast ( AST*, ast )->is_equal ( other.ast );
3534}
@@ -96,8 +95,7 @@ bool CodeBody::is_equal( Code other )
9695{
9796 if ( ast == nullptr || other.ast == nullptr )
9897 {
99- log_failure ( " Code::is_equal: Cannot compare code, AST is null!" );
100- return false ;
98+ return rcast ( AST*, ast ) == other.ast ;
10199 }
102100 return rcast ( AST*, ast )->is_equal ( other.ast );
103101}
@@ -164,8 +162,7 @@ bool CodeAttributes::is_equal( Code other )
164162{
165163 if ( ast == nullptr || other.ast == nullptr )
166164 {
167- log_failure ( " Code::is_equal: Cannot compare code, AST is null!" );
168- return false ;
165+ return rcast ( AST*, ast ) == other.ast ;
169166 }
170167 return rcast ( AST*, ast )->is_equal ( other.ast );
171168}
@@ -252,8 +249,7 @@ bool CodeComment::is_equal( Code other )
252249{
253250 if ( ast == nullptr || other.ast == nullptr )
254251 {
255- log_failure ( " Code::is_equal: Cannot compare code, AST is null!" );
256- return false ;
252+ return rcast ( AST*, ast ) == other.ast ;
257253 }
258254 return rcast ( AST*, ast )->is_equal ( other.ast );
259255}
@@ -340,8 +336,7 @@ bool CodeConstructor::is_equal( Code other )
340336{
341337 if ( ast == nullptr || other.ast == nullptr )
342338 {
343- log_failure ( " Code::is_equal: Cannot compare code, AST is null!" );
344- return false ;
339+ return rcast ( AST*, ast ) == other.ast ;
345340 }
346341 return rcast ( AST*, ast )->is_equal ( other.ast );
347342}
@@ -428,8 +423,7 @@ bool CodeClass::is_equal( Code other )
428423{
429424 if ( ast == nullptr || other.ast == nullptr )
430425 {
431- log_failure ( " Code::is_equal: Cannot compare code, AST is null!" );
432- return false ;
426+ return rcast ( AST*, ast ) == other.ast ;
433427 }
434428 return rcast ( AST*, ast )->is_equal ( other.ast );
435429}
@@ -496,8 +490,7 @@ bool CodeDefine::is_equal( Code other )
496490{
497491 if ( ast == nullptr || other.ast == nullptr )
498492 {
499- log_failure ( " Code::is_equal: Cannot compare code, AST is null!" );
500- return false ;
493+ return rcast ( AST*, ast ) == other.ast ;
501494 }
502495 return rcast ( AST*, ast )->is_equal ( other.ast );
503496}
@@ -584,8 +577,7 @@ bool CodeDestructor::is_equal( Code other )
584577{
585578 if ( ast == nullptr || other.ast == nullptr )
586579 {
587- log_failure ( " Code::is_equal: Cannot compare code, AST is null!" );
588- return false ;
580+ return rcast ( AST*, ast ) == other.ast ;
589581 }
590582 return rcast ( AST*, ast )->is_equal ( other.ast );
591583}
@@ -672,8 +664,7 @@ bool CodeEnum::is_equal( Code other )
672664{
673665 if ( ast == nullptr || other.ast == nullptr )
674666 {
675- log_failure ( " Code::is_equal: Cannot compare code, AST is null!" );
676- return false ;
667+ return rcast ( AST*, ast ) == other.ast ;
677668 }
678669 return rcast ( AST*, ast )->is_equal ( other.ast );
679670}
@@ -760,8 +751,7 @@ bool CodeExec::is_equal( Code other )
760751{
761752 if ( ast == nullptr || other.ast == nullptr )
762753 {
763- log_failure ( " Code::is_equal: Cannot compare code, AST is null!" );
764- return false ;
754+ return rcast ( AST*, ast ) == other.ast ;
765755 }
766756 return rcast ( AST*, ast )->is_equal ( other.ast );
767757}
@@ -848,8 +838,7 @@ bool CodeExtern::is_equal( Code other )
848838{
849839 if ( ast == nullptr || other.ast == nullptr )
850840 {
851- log_failure ( " Code::is_equal: Cannot compare code, AST is null!" );
852- return false ;
841+ return rcast ( AST*, ast ) == other.ast ;
853842 }
854843 return rcast ( AST*, ast )->is_equal ( other.ast );
855844}
@@ -936,8 +925,7 @@ bool CodeFriend::is_equal( Code other )
936925{
937926 if ( ast == nullptr || other.ast == nullptr )
938927 {
939- log_failure ( " Code::is_equal: Cannot compare code, AST is null!" );
940- return false ;
928+ return rcast ( AST*, ast ) == other.ast ;
941929 }
942930 return rcast ( AST*, ast )->is_equal ( other.ast );
943931}
@@ -1024,8 +1012,7 @@ bool CodeFn::is_equal( Code other )
10241012{
10251013 if ( ast == nullptr || other.ast == nullptr )
10261014 {
1027- log_failure ( " Code::is_equal: Cannot compare code, AST is null!" );
1028- return false ;
1015+ return rcast ( AST*, ast ) == other.ast ;
10291016 }
10301017 return rcast ( AST*, ast )->is_equal ( other.ast );
10311018}
@@ -1112,8 +1099,7 @@ bool CodeInclude::is_equal( Code other )
11121099{
11131100 if ( ast == nullptr || other.ast == nullptr )
11141101 {
1115- log_failure ( " Code::is_equal: Cannot compare code, AST is null!" );
1116- return false ;
1102+ return rcast ( AST*, ast ) == other.ast ;
11171103 }
11181104 return rcast ( AST*, ast )->is_equal ( other.ast );
11191105}
@@ -1200,8 +1186,7 @@ bool CodeModule::is_equal( Code other )
12001186{
12011187 if ( ast == nullptr || other.ast == nullptr )
12021188 {
1203- log_failure ( " Code::is_equal: Cannot compare code, AST is null!" );
1204- return false ;
1189+ return rcast ( AST*, ast ) == other.ast ;
12051190 }
12061191 return rcast ( AST*, ast )->is_equal ( other.ast );
12071192}
@@ -1288,8 +1273,7 @@ bool CodeNS::is_equal( Code other )
12881273{
12891274 if ( ast == nullptr || other.ast == nullptr )
12901275 {
1291- log_failure ( " Code::is_equal: Cannot compare code, AST is null!" );
1292- return false ;
1276+ return rcast ( AST*, ast ) == other.ast ;
12931277 }
12941278 return rcast ( AST*, ast )->is_equal ( other.ast );
12951279}
@@ -1376,8 +1360,7 @@ bool CodeOperator::is_equal( Code other )
13761360{
13771361 if ( ast == nullptr || other.ast == nullptr )
13781362 {
1379- log_failure ( " Code::is_equal: Cannot compare code, AST is null!" );
1380- return false ;
1363+ return rcast ( AST*, ast ) == other.ast ;
13811364 }
13821365 return rcast ( AST*, ast )->is_equal ( other.ast );
13831366}
@@ -1464,8 +1447,7 @@ bool CodeOpCast::is_equal( Code other )
14641447{
14651448 if ( ast == nullptr || other.ast == nullptr )
14661449 {
1467- log_failure ( " Code::is_equal: Cannot compare code, AST is null!" );
1468- return false ;
1450+ return rcast ( AST*, ast ) == other.ast ;
14691451 }
14701452 return rcast ( AST*, ast )->is_equal ( other.ast );
14711453}
@@ -1552,8 +1534,7 @@ bool CodeParam::is_equal( Code other )
15521534{
15531535 if ( ast == nullptr || other.ast == nullptr )
15541536 {
1555- log_failure ( " Code::is_equal: Cannot compare code, AST is null!" );
1556- return false ;
1537+ return rcast ( AST*, ast ) == other.ast ;
15571538 }
15581539 return rcast ( AST*, ast )->is_equal ( other.ast );
15591540}
@@ -1620,8 +1601,7 @@ bool CodePragma::is_equal( Code other )
16201601{
16211602 if ( ast == nullptr || other.ast == nullptr )
16221603 {
1623- log_failure ( " Code::is_equal: Cannot compare code, AST is null!" );
1624- return false ;
1604+ return rcast ( AST*, ast ) == other.ast ;
16251605 }
16261606 return rcast ( AST*, ast )->is_equal ( other.ast );
16271607}
@@ -1708,8 +1688,7 @@ bool CodePreprocessCond::is_equal( Code other )
17081688{
17091689 if ( ast == nullptr || other.ast == nullptr )
17101690 {
1711- log_failure ( " Code::is_equal: Cannot compare code, AST is null!" );
1712- return false ;
1691+ return rcast ( AST*, ast ) == other.ast ;
17131692 }
17141693 return rcast ( AST*, ast )->is_equal ( other.ast );
17151694}
@@ -1796,8 +1775,7 @@ bool CodeSpecifiers::is_equal( Code other )
17961775{
17971776 if ( ast == nullptr || other.ast == nullptr )
17981777 {
1799- log_failure ( " Code::is_equal: Cannot compare code, AST is null!" );
1800- return false ;
1778+ return rcast ( AST*, ast ) == other.ast ;
18011779 }
18021780 return rcast ( AST*, ast )->is_equal ( other.ast );
18031781}
@@ -1864,8 +1842,7 @@ bool CodeStruct::is_equal( Code other )
18641842{
18651843 if ( ast == nullptr || other.ast == nullptr )
18661844 {
1867- log_failure ( " Code::is_equal: Cannot compare code, AST is null!" );
1868- return false ;
1845+ return rcast ( AST*, ast ) == other.ast ;
18691846 }
18701847 return rcast ( AST*, ast )->is_equal ( other.ast );
18711848}
@@ -1932,8 +1909,7 @@ bool CodeTemplate::is_equal( Code other )
19321909{
19331910 if ( ast == nullptr || other.ast == nullptr )
19341911 {
1935- log_failure ( " Code::is_equal: Cannot compare code, AST is null!" );
1936- return false ;
1912+ return rcast ( AST*, ast ) == other.ast ;
19371913 }
19381914 return rcast ( AST*, ast )->is_equal ( other.ast );
19391915}
@@ -2020,8 +1996,7 @@ bool CodeType::is_equal( Code other )
20201996{
20211997 if ( ast == nullptr || other.ast == nullptr )
20221998 {
2023- log_failure ( " Code::is_equal: Cannot compare code, AST is null!" );
2024- return false ;
1999+ return rcast ( AST*, ast ) == other.ast ;
20252000 }
20262001 return rcast ( AST*, ast )->is_equal ( other.ast );
20272002}
@@ -2108,8 +2083,7 @@ bool CodeTypedef::is_equal( Code other )
21082083{
21092084 if ( ast == nullptr || other.ast == nullptr )
21102085 {
2111- log_failure ( " Code::is_equal: Cannot compare code, AST is null!" );
2112- return false ;
2086+ return rcast ( AST*, ast ) == other.ast ;
21132087 }
21142088 return rcast ( AST*, ast )->is_equal ( other.ast );
21152089}
@@ -2196,8 +2170,7 @@ bool CodeUnion::is_equal( Code other )
21962170{
21972171 if ( ast == nullptr || other.ast == nullptr )
21982172 {
2199- log_failure ( " Code::is_equal: Cannot compare code, AST is null!" );
2200- return false ;
2173+ return rcast ( AST*, ast ) == other.ast ;
22012174 }
22022175 return rcast ( AST*, ast )->is_equal ( other.ast );
22032176}
@@ -2284,8 +2257,7 @@ bool CodeUsing::is_equal( Code other )
22842257{
22852258 if ( ast == nullptr || other.ast == nullptr )
22862259 {
2287- log_failure ( " Code::is_equal: Cannot compare code, AST is null!" );
2288- return false ;
2260+ return rcast ( AST*, ast ) == other.ast ;
22892261 }
22902262 return rcast ( AST*, ast )->is_equal ( other.ast );
22912263}
@@ -2372,8 +2344,7 @@ bool CodeVar::is_equal( Code other )
23722344{
23732345 if ( ast == nullptr || other.ast == nullptr )
23742346 {
2375- log_failure ( " Code::is_equal: Cannot compare code, AST is null!" );
2376- return false ;
2347+ return rcast ( AST*, ast ) == other.ast ;
23772348 }
23782349 return rcast ( AST*, ast )->is_equal ( other.ast );
23792350}
0 commit comments