| 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 | 807 | std::any TypeChecker::visitMainFctDef(MainFctDefNode *node) { | |
| 8 |
2/2✓ Branch 2 → 3 taken 382 times.
✓ Branch 2 → 4 taken 425 times.
|
807 | if (typeCheckerMode == TC_MODE_PRE) |
| 9 | 382 | return visitMainFctDefPrepare(node); | |
| 10 | else | ||
| 11 | 425 | return visitMainFctDefCheck(node); | |
| 12 | } | ||
| 13 | |||
| 14 | 24738 | std::any TypeChecker::visitFctDef(FctDefNode *node) { | |
| 15 |
2/2✓ Branch 2 → 3 taken 7971 times.
✓ Branch 2 → 4 taken 16767 times.
|
24738 | if (typeCheckerMode == TC_MODE_PRE) |
| 16 | 7971 | return visitFctDefPrepare(node); | |
| 17 | else | ||
| 18 | 16767 | return visitFctDefCheck(node); | |
| 19 | } | ||
| 20 | |||
| 21 | 12541 | std::any TypeChecker::visitProcDef(ProcDefNode *node) { | |
| 22 |
2/2✓ Branch 2 → 3 taken 4035 times.
✓ Branch 2 → 4 taken 8506 times.
|
12541 | if (typeCheckerMode == TC_MODE_PRE) |
| 23 | 4035 | return visitProcDefPrepare(node); | |
| 24 | else | ||
| 25 | 8506 | return visitProcDefCheck(node); | |
| 26 | } | ||
| 27 | |||
| 28 | 1885 | std::any TypeChecker::visitStructDef(StructDefNode *node) { | |
| 29 |
2/2✓ Branch 2 → 3 taken 708 times.
✓ Branch 2 → 4 taken 1177 times.
|
1885 | if (typeCheckerMode == TC_MODE_PRE) |
| 30 | 708 | return visitStructDefPrepare(node); | |
| 31 | else | ||
| 32 | 1177 | return visitStructDefCheck(node); | |
| 33 | } | ||
| 34 | |||
| 35 | 210 | std::any TypeChecker::visitInterfaceDef(InterfaceDefNode *node) { | |
| 36 |
2/2✓ Branch 2 → 3 taken 101 times.
✓ Branch 2 → 4 taken 109 times.
|
210 | if (typeCheckerMode == TC_MODE_PRE) |
| 37 | 101 | return visitInterfaceDefPrepare(node); | |
| 38 |
1/2✓ Branch 4 → 5 taken 109 times.
✗ Branch 4 → 7 not taken.
|
109 | 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 | 2976 | std::any TypeChecker::visitGenericTypeDef(GenericTypeDefNode *node) { | |
| 48 |
2/2✓ Branch 2 → 3 taken 957 times.
✓ Branch 2 → 4 taken 2019 times.
|
2976 | if (typeCheckerMode == TC_MODE_PRE) |
| 49 | 957 | return visitGenericTypeDefPrepare(node); | |
| 50 |
1/2✓ Branch 4 → 5 taken 2019 times.
✗ Branch 4 → 7 not taken.
|
2019 | 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 | 2774 | std::any TypeChecker::visitGlobalVarDef(GlobalVarDefNode *node) { | |
| 60 |
2/2✓ Branch 2 → 3 taken 1186 times.
✓ Branch 2 → 4 taken 1588 times.
|
2774 | if (typeCheckerMode == TC_MODE_PRE) |
| 61 | 1186 | return visitGlobalVarDefPrepare(node); | |
| 62 |
1/2✓ Branch 4 → 5 taken 1588 times.
✗ Branch 4 → 7 not taken.
|
1588 | return nullptr; |
| 63 | } | ||
| 64 | |||
| 65 | 3014 | std::any TypeChecker::visitExtDecl(ExtDeclNode *node) { | |
| 66 |
2/2✓ Branch 2 → 3 taken 1018 times.
✓ Branch 2 → 4 taken 1996 times.
|
3014 | if (typeCheckerMode == TC_MODE_PRE) |
| 67 | 1018 | return visitExtDeclPrepare(node); | |
| 68 |
1/2✓ Branch 4 → 5 taken 1996 times.
✗ Branch 4 → 7 not taken.
|
1996 | return nullptr; |
| 69 | } | ||
| 70 | |||
| 71 | 1766 | std::any TypeChecker::visitImportDef(ImportDefNode *node) { | |
| 72 |
2/2✓ Branch 2 → 3 taken 631 times.
✓ Branch 2 → 4 taken 1135 times.
|
1766 | if (typeCheckerMode == TC_MODE_PRE) |
| 73 | 631 | return visitImportDefPrepare(node); | |
| 74 |
1/2✓ Branch 4 → 5 taken 1135 times.
✗ Branch 4 → 7 not taken.
|
1135 | return nullptr; |
| 75 | } | ||
| 76 | |||
| 77 | } // namespace spice::compiler | ||
| 78 |