src/typechecker/TypeCheckerTopLevelDefinitions.cpp
| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | // Copyright (c) 2021-2026 ChilliBits. All rights reserved. | ||
| 2 | |||
| 3 | #include "TypeChecker.h" | ||
| 4 | |||
| 5 | namespace spice::compiler { | ||
| 6 | |||
| 7 | 877 | std::any TypeChecker::visitMainFctDef(MainFctDefNode *node) { | |
| 8 |
2/2✓ Branch 2 → 3 taken 413 times.
✓ Branch 2 → 4 taken 464 times.
|
877 | if (typeCheckerMode == TC_MODE_PRE) |
| 9 | 413 | return visitMainFctDefPrepare(node); | |
| 10 | else | ||
| 11 | 464 | return visitMainFctDefCheck(node); | |
| 12 | } | ||
| 13 | |||
| 14 | 27556 | std::any TypeChecker::visitFctDef(FctDefNode *node) { | |
| 15 |
2/2✓ Branch 2 → 3 taken 8750 times.
✓ Branch 2 → 4 taken 18806 times.
|
27556 | if (typeCheckerMode == TC_MODE_PRE) |
| 16 | 8750 | return visitFctDefPrepare(node); | |
| 17 | else | ||
| 18 | 18806 | return visitFctDefCheck(node); | |
| 19 | } | ||
| 20 | |||
| 21 | 14941 | std::any TypeChecker::visitProcDef(ProcDefNode *node) { | |
| 22 |
2/2✓ Branch 2 → 3 taken 4706 times.
✓ Branch 2 → 4 taken 10235 times.
|
14941 | if (typeCheckerMode == TC_MODE_PRE) |
| 23 | 4706 | return visitProcDefPrepare(node); | |
| 24 | else | ||
| 25 | 10235 | return visitProcDefCheck(node); | |
| 26 | } | ||
| 27 | |||
| 28 | 2155 | std::any TypeChecker::visitStructDef(StructDefNode *node) { | |
| 29 |
2/2✓ Branch 2 → 3 taken 799 times.
✓ Branch 2 → 4 taken 1356 times.
|
2155 | if (typeCheckerMode == TC_MODE_PRE) |
| 30 | 799 | return visitStructDefPrepare(node); | |
| 31 | else | ||
| 32 | 1356 | return visitStructDefCheck(node); | |
| 33 | } | ||
| 34 | |||
| 35 | 227 | std::any TypeChecker::visitInterfaceDef(InterfaceDefNode *node) { | |
| 36 |
2/2✓ Branch 2 → 3 taken 108 times.
✓ Branch 2 → 4 taken 119 times.
|
227 | if (typeCheckerMode == TC_MODE_PRE) |
| 37 | 108 | return visitInterfaceDefPrepare(node); | |
| 38 |
1/2✓ Branch 4 → 5 taken 119 times.
✗ Branch 4 → 7 not taken.
|
119 | return nullptr; |
| 39 | } | ||
| 40 | |||
| 41 | 217 | std::any TypeChecker::visitEnumDef(EnumDefNode *node) { | |
| 42 |
2/2✓ Branch 2 → 3 taken 75 times.
✓ Branch 2 → 4 taken 142 times.
|
217 | if (typeCheckerMode == TC_MODE_PRE) |
| 43 | 75 | return visitEnumDefPrepare(node); | |
| 44 |
1/2✓ Branch 4 → 5 taken 142 times.
✗ Branch 4 → 7 not taken.
|
142 | return nullptr; |
| 45 | } | ||
| 46 | |||
| 47 | 3345 | std::any TypeChecker::visitGenericTypeDef(GenericTypeDefNode *node) { | |
| 48 |
2/2✓ Branch 2 → 3 taken 1057 times.
✓ Branch 2 → 4 taken 2288 times.
|
3345 | if (typeCheckerMode == TC_MODE_PRE) |
| 49 | 1057 | return visitGenericTypeDefPrepare(node); | |
| 50 |
1/2✓ Branch 4 → 5 taken 2288 times.
✗ Branch 4 → 7 not taken.
|
2288 | return nullptr; |
| 51 | } | ||
| 52 | |||
| 53 | 259 | std::any TypeChecker::visitAliasDef(AliasDefNode *node) { | |
| 54 |
2/2✓ Branch 2 → 3 taken 108 times.
✓ Branch 2 → 4 taken 151 times.
|
259 | if (typeCheckerMode == TC_MODE_PRE) |
| 55 | 108 | return visitAliasDefPrepare(node); | |
| 56 |
1/2✓ Branch 4 → 5 taken 151 times.
✗ Branch 4 → 7 not taken.
|
151 | return nullptr; |
| 57 | } | ||
| 58 | |||
| 59 | 3014 | std::any TypeChecker::visitGlobalVarDef(GlobalVarDefNode *node) { | |
| 60 |
2/2✓ Branch 2 → 3 taken 1271 times.
✓ Branch 2 → 4 taken 1743 times.
|
3014 | if (typeCheckerMode == TC_MODE_PRE) |
| 61 | 1271 | return visitGlobalVarDefPrepare(node); | |
| 62 |
1/2✓ Branch 4 → 5 taken 1743 times.
✗ Branch 4 → 7 not taken.
|
1743 | return nullptr; |
| 63 | } | ||
| 64 | |||
| 65 | 3396 | std::any TypeChecker::visitExtDecl(ExtDeclNode *node) { | |
| 66 |
2/2✓ Branch 2 → 3 taken 1155 times.
✓ Branch 2 → 4 taken 2241 times.
|
3396 | if (typeCheckerMode == TC_MODE_PRE) |
| 67 | 1155 | return visitExtDeclPrepare(node); | |
| 68 |
1/2✓ Branch 4 → 5 taken 2241 times.
✗ Branch 4 → 7 not taken.
|
2241 | return nullptr; |
| 69 | } | ||
| 70 | |||
| 71 | 1957 | std::any TypeChecker::visitImportDef(ImportDefNode *node) { | |
| 72 |
2/2✓ Branch 2 → 3 taken 674 times.
✓ Branch 2 → 4 taken 1283 times.
|
1957 | if (typeCheckerMode == TC_MODE_PRE) |
| 73 | 674 | return visitImportDefPrepare(node); | |
| 74 |
1/2✓ Branch 4 → 5 taken 1283 times.
✗ Branch 4 → 7 not taken.
|
1283 | return nullptr; |
| 75 | } | ||
| 76 | |||
| 77 | } // namespace spice::compiler | ||
| 78 |