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 | 859 | std::any TypeChecker::visitMainFctDef(MainFctDefNode *node) { | |
| 8 |
2/2✓ Branch 2 → 3 taken 404 times.
✓ Branch 2 → 4 taken 455 times.
|
859 | if (typeCheckerMode == TC_MODE_PRE) |
| 9 | 404 | return visitMainFctDefPrepare(node); | |
| 10 | else | ||
| 11 | 455 | return visitMainFctDefCheck(node); | |
| 12 | } | ||
| 13 | |||
| 14 | 26210 | std::any TypeChecker::visitFctDef(FctDefNode *node) { | |
| 15 |
2/2✓ Branch 2 → 3 taken 8407 times.
✓ Branch 2 → 4 taken 17803 times.
|
26210 | if (typeCheckerMode == TC_MODE_PRE) |
| 16 | 8407 | return visitFctDefPrepare(node); | |
| 17 | else | ||
| 18 | 17803 | return visitFctDefCheck(node); | |
| 19 | } | ||
| 20 | |||
| 21 | 13534 | std::any TypeChecker::visitProcDef(ProcDefNode *node) { | |
| 22 |
2/2✓ Branch 2 → 3 taken 4332 times.
✓ Branch 2 → 4 taken 9202 times.
|
13534 | if (typeCheckerMode == TC_MODE_PRE) |
| 23 | 4332 | return visitProcDefPrepare(node); | |
| 24 | else | ||
| 25 | 9202 | return visitProcDefCheck(node); | |
| 26 | } | ||
| 27 | |||
| 28 | 1994 | std::any TypeChecker::visitStructDef(StructDefNode *node) { | |
| 29 |
2/2✓ Branch 2 → 3 taken 751 times.
✓ Branch 2 → 4 taken 1243 times.
|
1994 | if (typeCheckerMode == TC_MODE_PRE) |
| 30 | 751 | return visitStructDefPrepare(node); | |
| 31 | else | ||
| 32 | 1243 | return visitStructDefCheck(node); | |
| 33 | } | ||
| 34 | |||
| 35 | 220 | std::any TypeChecker::visitInterfaceDef(InterfaceDefNode *node) { | |
| 36 |
2/2✓ Branch 2 → 3 taken 105 times.
✓ Branch 2 → 4 taken 115 times.
|
220 | if (typeCheckerMode == TC_MODE_PRE) |
| 37 | 105 | return visitInterfaceDefPrepare(node); | |
| 38 |
1/2✓ Branch 4 → 5 taken 115 times.
✗ Branch 4 → 7 not taken.
|
115 | 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 | 3149 | std::any TypeChecker::visitGenericTypeDef(GenericTypeDefNode *node) { | |
| 48 |
2/2✓ Branch 2 → 3 taken 1004 times.
✓ Branch 2 → 4 taken 2145 times.
|
3149 | if (typeCheckerMode == TC_MODE_PRE) |
| 49 | 1004 | return visitGenericTypeDefPrepare(node); | |
| 50 |
1/2✓ Branch 4 → 5 taken 2145 times.
✗ Branch 4 → 7 not taken.
|
2145 | return nullptr; |
| 51 | } | ||
| 52 | |||
| 53 | 256 | std::any TypeChecker::visitAliasDef(AliasDefNode *node) { | |
| 54 |
2/2✓ Branch 2 → 3 taken 107 times.
✓ Branch 2 → 4 taken 149 times.
|
256 | if (typeCheckerMode == TC_MODE_PRE) |
| 55 | 107 | return visitAliasDefPrepare(node); | |
| 56 |
1/2✓ Branch 4 → 5 taken 149 times.
✗ Branch 4 → 7 not taken.
|
149 | return nullptr; |
| 57 | } | ||
| 58 | |||
| 59 | 2952 | std::any TypeChecker::visitGlobalVarDef(GlobalVarDefNode *node) { | |
| 60 |
2/2✓ Branch 2 → 3 taken 1257 times.
✓ Branch 2 → 4 taken 1695 times.
|
2952 | if (typeCheckerMode == TC_MODE_PRE) |
| 61 | 1257 | return visitGlobalVarDefPrepare(node); | |
| 62 |
1/2✓ Branch 4 → 5 taken 1695 times.
✗ Branch 4 → 7 not taken.
|
1695 | return nullptr; |
| 63 | } | ||
| 64 | |||
| 65 | 3250 | std::any TypeChecker::visitExtDecl(ExtDeclNode *node) { | |
| 66 |
2/2✓ Branch 2 → 3 taken 1100 times.
✓ Branch 2 → 4 taken 2150 times.
|
3250 | if (typeCheckerMode == TC_MODE_PRE) |
| 67 | 1100 | return visitExtDeclPrepare(node); | |
| 68 |
1/2✓ Branch 4 → 5 taken 2150 times.
✗ Branch 4 → 7 not taken.
|
2150 | return nullptr; |
| 69 | } | ||
| 70 | |||
| 71 | 1799 | std::any TypeChecker::visitImportDef(ImportDefNode *node) { | |
| 72 |
2/2✓ Branch 2 → 3 taken 640 times.
✓ Branch 2 → 4 taken 1159 times.
|
1799 | if (typeCheckerMode == TC_MODE_PRE) |
| 73 | 640 | return visitImportDefPrepare(node); | |
| 74 |
1/2✓ Branch 4 → 5 taken 1159 times.
✗ Branch 4 → 7 not taken.
|
1159 | return nullptr; |
| 75 | } | ||
| 76 | |||
| 77 | } // namespace spice::compiler | ||
| 78 |