| 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 | 823 | std::any TypeChecker::visitMainFctDef(MainFctDefNode *node) { | |
| 8 |
2/2✓ Branch 2 → 3 taken 388 times.
✓ Branch 2 → 4 taken 435 times.
|
823 | if (typeCheckerMode == TC_MODE_PRE) |
| 9 | 388 | return visitMainFctDefPrepare(node); | |
| 10 | else | ||
| 11 | 435 | return visitMainFctDefCheck(node); | |
| 12 | } | ||
| 13 | |||
| 14 | 25260 | std::any TypeChecker::visitFctDef(FctDefNode *node) { | |
| 15 |
2/2✓ Branch 2 → 3 taken 8115 times.
✓ Branch 2 → 4 taken 17145 times.
|
25260 | if (typeCheckerMode == TC_MODE_PRE) |
| 16 | 8115 | return visitFctDefPrepare(node); | |
| 17 | else | ||
| 18 | 17145 | return visitFctDefCheck(node); | |
| 19 | } | ||
| 20 | |||
| 21 | 13116 | std::any TypeChecker::visitProcDef(ProcDefNode *node) { | |
| 22 |
2/2✓ Branch 2 → 3 taken 4191 times.
✓ Branch 2 → 4 taken 8925 times.
|
13116 | if (typeCheckerMode == TC_MODE_PRE) |
| 23 | 4191 | return visitProcDefPrepare(node); | |
| 24 | else | ||
| 25 | 8925 | return visitProcDefCheck(node); | |
| 26 | } | ||
| 27 | |||
| 28 | 1904 | std::any TypeChecker::visitStructDef(StructDefNode *node) { | |
| 29 |
2/2✓ Branch 2 → 3 taken 714 times.
✓ Branch 2 → 4 taken 1190 times.
|
1904 | if (typeCheckerMode == TC_MODE_PRE) |
| 30 | 714 | return visitStructDefPrepare(node); | |
| 31 | else | ||
| 32 | 1190 | return visitStructDefCheck(node); | |
| 33 | } | ||
| 34 | |||
| 35 | 213 | std::any TypeChecker::visitInterfaceDef(InterfaceDefNode *node) { | |
| 36 |
2/2✓ Branch 2 → 3 taken 102 times.
✓ Branch 2 → 4 taken 111 times.
|
213 | if (typeCheckerMode == TC_MODE_PRE) |
| 37 | 102 | return visitInterfaceDefPrepare(node); | |
| 38 |
1/2✓ Branch 4 → 5 taken 111 times.
✗ Branch 4 → 7 not taken.
|
111 | 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 | 3047 | std::any TypeChecker::visitGenericTypeDef(GenericTypeDefNode *node) { | |
| 48 |
2/2✓ Branch 2 → 3 taken 975 times.
✓ Branch 2 → 4 taken 2072 times.
|
3047 | if (typeCheckerMode == TC_MODE_PRE) |
| 49 | 975 | return visitGenericTypeDefPrepare(node); | |
| 50 |
1/2✓ Branch 4 → 5 taken 2072 times.
✗ Branch 4 → 7 not taken.
|
2072 | 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 | 2798 | std::any TypeChecker::visitGlobalVarDef(GlobalVarDefNode *node) { | |
| 60 |
2/2✓ Branch 2 → 3 taken 1192 times.
✓ Branch 2 → 4 taken 1606 times.
|
2798 | if (typeCheckerMode == TC_MODE_PRE) |
| 61 | 1192 | return visitGlobalVarDefPrepare(node); | |
| 62 |
1/2✓ Branch 4 → 5 taken 1606 times.
✗ Branch 4 → 7 not taken.
|
1606 | return nullptr; |
| 63 | } | ||
| 64 | |||
| 65 | 3062 | std::any TypeChecker::visitExtDecl(ExtDeclNode *node) { | |
| 66 |
2/2✓ Branch 2 → 3 taken 1030 times.
✓ Branch 2 → 4 taken 2032 times.
|
3062 | if (typeCheckerMode == TC_MODE_PRE) |
| 67 | 1030 | return visitExtDeclPrepare(node); | |
| 68 |
1/2✓ Branch 4 → 5 taken 2032 times.
✗ Branch 4 → 7 not taken.
|
2032 | return nullptr; |
| 69 | } | ||
| 70 | |||
| 71 | 1772 | std::any TypeChecker::visitImportDef(ImportDefNode *node) { | |
| 72 |
2/2✓ Branch 2 → 3 taken 632 times.
✓ Branch 2 → 4 taken 1140 times.
|
1772 | if (typeCheckerMode == TC_MODE_PRE) |
| 73 | 632 | return visitImportDefPrepare(node); | |
| 74 |
1/2✓ Branch 4 → 5 taken 1140 times.
✗ Branch 4 → 7 not taken.
|
1140 | return nullptr; |
| 75 | } | ||
| 76 | |||
| 77 | } // namespace spice::compiler | ||
| 78 |