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 | 25757 | std::any TypeChecker::visitFctDef(FctDefNode *node) { | |
| 15 |
2/2✓ Branch 2 → 3 taken 8253 times.
✓ Branch 2 → 4 taken 17504 times.
|
25757 | if (typeCheckerMode == TC_MODE_PRE) |
| 16 | 8253 | return visitFctDefPrepare(node); | |
| 17 | else | ||
| 18 | 17504 | return visitFctDefCheck(node); | |
| 19 | } | ||
| 20 | |||
| 21 | 13428 | std::any TypeChecker::visitProcDef(ProcDefNode *node) { | |
| 22 |
2/2✓ Branch 2 → 3 taken 4302 times.
✓ Branch 2 → 4 taken 9126 times.
|
13428 | if (typeCheckerMode == TC_MODE_PRE) |
| 23 | 4302 | return visitProcDefPrepare(node); | |
| 24 | else | ||
| 25 | 9126 | return visitProcDefCheck(node); | |
| 26 | } | ||
| 27 | |||
| 28 | 1979 | std::any TypeChecker::visitStructDef(StructDefNode *node) { | |
| 29 |
2/2✓ Branch 2 → 3 taken 746 times.
✓ Branch 2 → 4 taken 1233 times.
|
1979 | if (typeCheckerMode == TC_MODE_PRE) |
| 30 | 746 | return visitStructDefPrepare(node); | |
| 31 | else | ||
| 32 | 1233 | 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 | 209 | std::any TypeChecker::visitEnumDef(EnumDefNode *node) { | |
| 42 |
2/2✓ Branch 2 → 3 taken 73 times.
✓ Branch 2 → 4 taken 136 times.
|
209 | if (typeCheckerMode == TC_MODE_PRE) |
| 43 | 73 | return visitEnumDefPrepare(node); | |
| 44 |
1/2✓ Branch 4 → 5 taken 136 times.
✗ Branch 4 → 7 not taken.
|
136 | return nullptr; |
| 45 | } | ||
| 46 | |||
| 47 | 3118 | std::any TypeChecker::visitGenericTypeDef(GenericTypeDefNode *node) { | |
| 48 |
2/2✓ Branch 2 → 3 taken 995 times.
✓ Branch 2 → 4 taken 2123 times.
|
3118 | if (typeCheckerMode == TC_MODE_PRE) |
| 49 | 995 | return visitGenericTypeDefPrepare(node); | |
| 50 |
1/2✓ Branch 4 → 5 taken 2123 times.
✗ Branch 4 → 7 not taken.
|
2123 | return nullptr; |
| 51 | } | ||
| 52 | |||
| 53 | 246 | std::any TypeChecker::visitAliasDef(AliasDefNode *node) { | |
| 54 |
2/2✓ Branch 2 → 3 taken 104 times.
✓ Branch 2 → 4 taken 142 times.
|
246 | if (typeCheckerMode == TC_MODE_PRE) |
| 55 | 104 | return visitAliasDefPrepare(node); | |
| 56 |
1/2✓ Branch 4 → 5 taken 142 times.
✗ Branch 4 → 7 not taken.
|
142 | return nullptr; |
| 57 | } | ||
| 58 | |||
| 59 | 2800 | std::any TypeChecker::visitGlobalVarDef(GlobalVarDefNode *node) { | |
| 60 |
2/2✓ Branch 2 → 3 taken 1189 times.
✓ Branch 2 → 4 taken 1611 times.
|
2800 | if (typeCheckerMode == TC_MODE_PRE) |
| 61 | 1189 | return visitGlobalVarDefPrepare(node); | |
| 62 |
1/2✓ Branch 4 → 5 taken 1611 times.
✗ Branch 4 → 7 not taken.
|
1611 | return nullptr; |
| 63 | } | ||
| 64 | |||
| 65 | 3178 | std::any TypeChecker::visitExtDecl(ExtDeclNode *node) { | |
| 66 |
2/2✓ Branch 2 → 3 taken 1076 times.
✓ Branch 2 → 4 taken 2102 times.
|
3178 | if (typeCheckerMode == TC_MODE_PRE) |
| 67 | 1076 | return visitExtDeclPrepare(node); | |
| 68 |
1/2✓ Branch 4 → 5 taken 2102 times.
✗ Branch 4 → 7 not taken.
|
2102 | return nullptr; |
| 69 | } | ||
| 70 | |||
| 71 | 1775 | std::any TypeChecker::visitImportDef(ImportDefNode *node) { | |
| 72 |
2/2✓ Branch 2 → 3 taken 632 times.
✓ Branch 2 → 4 taken 1143 times.
|
1775 | if (typeCheckerMode == TC_MODE_PRE) |
| 73 | 632 | return visitImportDefPrepare(node); | |
| 74 |
1/2✓ Branch 4 → 5 taken 1143 times.
✗ Branch 4 → 7 not taken.
|
1143 | return nullptr; |
| 75 | } | ||
| 76 | |||
| 77 | } // namespace spice::compiler | ||
| 78 |