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 | 1003 | std::any TypeChecker::visitMainFctDef(MainFctDefNode *node) { | |
| 8 |
2/2✓ Branch 2 → 3 taken 472 times.
✓ Branch 2 → 4 taken 531 times.
|
1003 | if (typeCheckerMode == TC_MODE_PRE) |
| 9 | 472 | return visitMainFctDefPrepare(node); | |
| 10 | else | ||
| 11 | 531 | return visitMainFctDefCheck(node); | |
| 12 | } | ||
| 13 | |||
| 14 | 47121 | std::any TypeChecker::visitFctDef(FctDefNode *node) { | |
| 15 |
2/2✓ Branch 2 → 3 taken 15077 times.
✓ Branch 2 → 4 taken 32044 times.
|
47121 | if (typeCheckerMode == TC_MODE_PRE) |
| 16 | 15077 | return visitFctDefPrepare(node); | |
| 17 | else | ||
| 18 | 32044 | return visitFctDefCheck(node); | |
| 19 | } | ||
| 20 | |||
| 21 | 26154 | std::any TypeChecker::visitProcDef(ProcDefNode *node) { | |
| 22 |
2/2✓ Branch 2 → 3 taken 8270 times.
✓ Branch 2 → 4 taken 17884 times.
|
26154 | if (typeCheckerMode == TC_MODE_PRE) |
| 23 | 8270 | return visitProcDefPrepare(node); | |
| 24 | else | ||
| 25 | 17884 | return visitProcDefCheck(node); | |
| 26 | } | ||
| 27 | |||
| 28 | 5540 | std::any TypeChecker::visitStructDef(StructDefNode *node) { | |
| 29 |
2/2✓ Branch 2 → 3 taken 1941 times.
✓ Branch 2 → 4 taken 3599 times.
|
5540 | if (typeCheckerMode == TC_MODE_PRE) |
| 30 | 1941 | return visitStructDefPrepare(node); | |
| 31 | else | ||
| 32 | 3599 | return visitStructDefCheck(node); | |
| 33 | } | ||
| 34 | |||
| 35 | 482 | std::any TypeChecker::visitInterfaceDef(InterfaceDefNode *node) { | |
| 36 |
2/2✓ Branch 2 → 3 taken 226 times.
✓ Branch 2 → 4 taken 256 times.
|
482 | if (typeCheckerMode == TC_MODE_PRE) |
| 37 | 226 | return visitInterfaceDefPrepare(node); | |
| 38 |
1/2✓ Branch 4 → 5 taken 256 times.
✗ Branch 4 → 8 not taken.
|
512 | return nullptr; |
| 39 | } | ||
| 40 | |||
| 41 | 628 | std::any TypeChecker::visitEnumDef(EnumDefNode *node) { | |
| 42 |
2/2✓ Branch 2 → 3 taken 216 times.
✓ Branch 2 → 4 taken 412 times.
|
628 | if (typeCheckerMode == TC_MODE_PRE) |
| 43 | 216 | return visitEnumDefPrepare(node); | |
| 44 |
1/2✓ Branch 4 → 5 taken 412 times.
✗ Branch 4 → 8 not taken.
|
824 | return nullptr; |
| 45 | } | ||
| 46 | |||
| 47 | 5211 | std::any TypeChecker::visitGenericTypeDef(GenericTypeDefNode *node) { | |
| 48 |
2/2✓ Branch 2 → 3 taken 1651 times.
✓ Branch 2 → 4 taken 3560 times.
|
5211 | if (typeCheckerMode == TC_MODE_PRE) |
| 49 | 1651 | return visitGenericTypeDefPrepare(node); | |
| 50 |
1/2✓ Branch 4 → 5 taken 3560 times.
✗ Branch 4 → 8 not taken.
|
7120 | return nullptr; |
| 51 | } | ||
| 52 | |||
| 53 | 551 | std::any TypeChecker::visitAliasDef(AliasDefNode *node) { | |
| 54 |
2/2✓ Branch 2 → 3 taken 209 times.
✓ Branch 2 → 4 taken 342 times.
|
551 | if (typeCheckerMode == TC_MODE_PRE) |
| 55 | 209 | return visitAliasDefPrepare(node); | |
| 56 |
1/2✓ Branch 4 → 5 taken 342 times.
✗ Branch 4 → 8 not taken.
|
684 | return nullptr; |
| 57 | } | ||
| 58 | |||
| 59 | 4827 | std::any TypeChecker::visitGlobalVarDef(GlobalVarDefNode *node) { | |
| 60 |
2/2✓ Branch 2 → 3 taken 2009 times.
✓ Branch 2 → 4 taken 2818 times.
|
4827 | if (typeCheckerMode == TC_MODE_PRE) |
| 61 | 2009 | return visitGlobalVarDefPrepare(node); | |
| 62 |
1/2✓ Branch 4 → 5 taken 2818 times.
✗ Branch 4 → 8 not taken.
|
5636 | return nullptr; |
| 63 | } | ||
| 64 | |||
| 65 | 6265 | std::any TypeChecker::visitExtDecl(ExtDeclNode *node) { | |
| 66 |
2/2✓ Branch 2 → 3 taken 2147 times.
✓ Branch 2 → 4 taken 4118 times.
|
6265 | if (typeCheckerMode == TC_MODE_PRE) |
| 67 | 2147 | return visitExtDeclPrepare(node); | |
| 68 |
1/2✓ Branch 4 → 5 taken 4118 times.
✗ Branch 4 → 8 not taken.
|
8236 | return nullptr; |
| 69 | } | ||
| 70 | |||
| 71 | 4660 | std::any TypeChecker::visitImportDef(ImportDefNode *node) { | |
| 72 |
2/2✓ Branch 2 → 3 taken 1607 times.
✓ Branch 2 → 4 taken 3053 times.
|
4660 | if (typeCheckerMode == TC_MODE_PRE) |
| 73 | 1607 | return visitImportDefPrepare(node); | |
| 74 |
1/2✓ Branch 4 → 5 taken 3053 times.
✗ Branch 4 → 8 not taken.
|
6106 | return nullptr; |
| 75 | } | ||
| 76 | |||
| 77 | } // namespace spice::compiler | ||
| 78 |