| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | // Copyright (c) 2021-2025 ChilliBits. All rights reserved. | ||
| 2 | |||
| 3 | #include "TypeChecker.h" | ||
| 4 | |||
| 5 | namespace spice::compiler { | ||
| 6 | |||
| 7 | 789 | std::any TypeChecker::visitMainFctDef(MainFctDefNode *node) { | |
| 8 |
2/2✓ Branch 2 → 3 taken 374 times.
✓ Branch 2 → 4 taken 415 times.
|
789 | if (typeCheckerMode == TC_MODE_PRE) |
| 9 | 374 | return visitMainFctDefPrepare(node); | |
| 10 | else | ||
| 11 | 415 | return visitMainFctDefCheck(node); | |
| 12 | } | ||
| 13 | |||
| 14 | 23570 | std::any TypeChecker::visitFctDef(FctDefNode *node) { | |
| 15 |
2/2✓ Branch 2 → 3 taken 7593 times.
✓ Branch 2 → 4 taken 15977 times.
|
23570 | if (typeCheckerMode == TC_MODE_PRE) |
| 16 | 7593 | return visitFctDefPrepare(node); | |
| 17 | else | ||
| 18 | 15977 | return visitFctDefCheck(node); | |
| 19 | } | ||
| 20 | |||
| 21 | 11780 | std::any TypeChecker::visitProcDef(ProcDefNode *node) { | |
| 22 |
2/2✓ Branch 2 → 3 taken 3784 times.
✓ Branch 2 → 4 taken 7996 times.
|
11780 | if (typeCheckerMode == TC_MODE_PRE) |
| 23 | 3784 | return visitProcDefPrepare(node); | |
| 24 | else | ||
| 25 | 7996 | return visitProcDefCheck(node); | |
| 26 | } | ||
| 27 | |||
| 28 | 1808 | std::any TypeChecker::visitStructDef(StructDefNode *node) { | |
| 29 |
2/2✓ Branch 2 → 3 taken 679 times.
✓ Branch 2 → 4 taken 1129 times.
|
1808 | if (typeCheckerMode == TC_MODE_PRE) |
| 30 | 679 | return visitStructDefPrepare(node); | |
| 31 | else | ||
| 32 | 1129 | return visitStructDefCheck(node); | |
| 33 | } | ||
| 34 | |||
| 35 | 194 | std::any TypeChecker::visitInterfaceDef(InterfaceDefNode *node) { | |
| 36 |
2/2✓ Branch 2 → 3 taken 93 times.
✓ Branch 2 → 4 taken 101 times.
|
194 | if (typeCheckerMode == TC_MODE_PRE) |
| 37 | 93 | return visitInterfaceDefPrepare(node); | |
| 38 |
1/2✓ Branch 4 → 5 taken 101 times.
✗ Branch 4 → 7 not taken.
|
101 | return nullptr; |
| 39 | } | ||
| 40 | |||
| 41 | 193 | std::any TypeChecker::visitEnumDef(EnumDefNode *node) { | |
| 42 |
2/2✓ Branch 2 → 3 taken 65 times.
✓ Branch 2 → 4 taken 128 times.
|
193 | if (typeCheckerMode == TC_MODE_PRE) |
| 43 | 65 | return visitEnumDefPrepare(node); | |
| 44 |
1/2✓ Branch 4 → 5 taken 128 times.
✗ Branch 4 → 7 not taken.
|
128 | return nullptr; |
| 45 | } | ||
| 46 | |||
| 47 | 2792 | std::any TypeChecker::visitGenericTypeDef(GenericTypeDefNode *node) { | |
| 48 |
2/2✓ Branch 2 → 3 taken 895 times.
✓ Branch 2 → 4 taken 1897 times.
|
2792 | if (typeCheckerMode == TC_MODE_PRE) |
| 49 | 895 | return visitGenericTypeDefPrepare(node); | |
| 50 |
1/2✓ Branch 4 → 5 taken 1897 times.
✗ Branch 4 → 7 not taken.
|
1897 | return nullptr; |
| 51 | } | ||
| 52 | |||
| 53 | 176 | std::any TypeChecker::visitAliasDef(AliasDefNode *node) { | |
| 54 |
2/2✓ Branch 2 → 3 taken 69 times.
✓ Branch 2 → 4 taken 107 times.
|
176 | if (typeCheckerMode == TC_MODE_PRE) |
| 55 | 69 | return visitAliasDefPrepare(node); | |
| 56 |
1/2✓ Branch 4 → 5 taken 107 times.
✗ Branch 4 → 7 not taken.
|
107 | return nullptr; |
| 57 | } | ||
| 58 | |||
| 59 | 2718 | std::any TypeChecker::visitGlobalVarDef(GlobalVarDefNode *node) { | |
| 60 |
2/2✓ Branch 2 → 3 taken 1170 times.
✓ Branch 2 → 4 taken 1548 times.
|
2718 | if (typeCheckerMode == TC_MODE_PRE) |
| 61 | 1170 | return visitGlobalVarDefPrepare(node); | |
| 62 |
1/2✓ Branch 4 → 5 taken 1548 times.
✗ Branch 4 → 7 not taken.
|
1548 | return nullptr; |
| 63 | } | ||
| 64 | |||
| 65 | 2910 | std::any TypeChecker::visitExtDecl(ExtDeclNode *node) { | |
| 66 |
2/2✓ Branch 2 → 3 taken 982 times.
✓ Branch 2 → 4 taken 1928 times.
|
2910 | if (typeCheckerMode == TC_MODE_PRE) |
| 67 | 982 | return visitExtDeclPrepare(node); | |
| 68 |
1/2✓ Branch 4 → 5 taken 1928 times.
✗ Branch 4 → 7 not taken.
|
1928 | return nullptr; |
| 69 | } | ||
| 70 | |||
| 71 | 1672 | std::any TypeChecker::visitImportDef(ImportDefNode *node) { | |
| 72 |
2/2✓ Branch 2 → 3 taken 594 times.
✓ Branch 2 → 4 taken 1078 times.
|
1672 | if (typeCheckerMode == TC_MODE_PRE) |
| 73 | 594 | return visitImportDefPrepare(node); | |
| 74 |
1/2✓ Branch 4 → 5 taken 1078 times.
✗ Branch 4 → 7 not taken.
|
1078 | return nullptr; |
| 75 | } | ||
| 76 | |||
| 77 | } // namespace spice::compiler | ||
| 78 |