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 | 1058 | std::any TypeChecker::visitMainFctDef(MainFctDefNode *node) { | |
| 8 |
2/2✓ Branch 2 → 3 taken 497 times.
✓ Branch 2 → 4 taken 561 times.
|
1058 | if (typeCheckerMode == TC_MODE_PRE) |
| 9 | 497 | return visitMainFctDefPrepare(node); | |
| 10 | else | ||
| 11 | 561 | return visitMainFctDefCheck(node); | |
| 12 | } | ||
| 13 | |||
| 14 | 61813 | std::any TypeChecker::visitFctDef(FctDefNode *node) { | |
| 15 |
2/2✓ Branch 2 → 3 taken 19964 times.
✓ Branch 2 → 4 taken 41849 times.
|
61813 | if (typeCheckerMode == TC_MODE_PRE) |
| 16 | 19964 | return visitFctDefPrepare(node); | |
| 17 | else | ||
| 18 | 41849 | return visitFctDefCheck(node); | |
| 19 | } | ||
| 20 | |||
| 21 | 33278 | std::any TypeChecker::visitProcDef(ProcDefNode *node) { | |
| 22 |
2/2✓ Branch 2 → 3 taken 10607 times.
✓ Branch 2 → 4 taken 22671 times.
|
33278 | if (typeCheckerMode == TC_MODE_PRE) |
| 23 | 10607 | return visitProcDefPrepare(node); | |
| 24 | else | ||
| 25 | 22671 | return visitProcDefCheck(node); | |
| 26 | } | ||
| 27 | |||
| 28 | 8098 | std::any TypeChecker::visitStructDef(StructDefNode *node) { | |
| 29 |
2/2✓ Branch 2 → 3 taken 2806 times.
✓ Branch 2 → 4 taken 5292 times.
|
8098 | if (typeCheckerMode == TC_MODE_PRE) |
| 30 | 2806 | return visitStructDefPrepare(node); | |
| 31 | else | ||
| 32 | 5292 | return visitStructDefCheck(node); | |
| 33 | } | ||
| 34 | |||
| 35 | 786 | std::any TypeChecker::visitInterfaceDef(InterfaceDefNode *node) { | |
| 36 |
2/2✓ Branch 2 → 3 taken 363 times.
✓ Branch 2 → 4 taken 423 times.
|
786 | if (typeCheckerMode == TC_MODE_PRE) |
| 37 | 363 | return visitInterfaceDefPrepare(node); | |
| 38 |
1/2✓ Branch 4 → 5 taken 423 times.
✗ Branch 4 → 8 not taken.
|
846 | return nullptr; |
| 39 | } | ||
| 40 | |||
| 41 | 1053 | std::any TypeChecker::visitEnumDef(EnumDefNode *node) { | |
| 42 |
2/2✓ Branch 2 → 3 taken 366 times.
✓ Branch 2 → 4 taken 687 times.
|
1053 | if (typeCheckerMode == TC_MODE_PRE) |
| 43 | 366 | return visitEnumDefPrepare(node); | |
| 44 |
1/2✓ Branch 4 → 5 taken 687 times.
✗ Branch 4 → 8 not taken.
|
1374 | return nullptr; |
| 45 | } | ||
| 46 | |||
| 47 | 6050 | std::any TypeChecker::visitGenericTypeDef(GenericTypeDefNode *node) { | |
| 48 |
2/2✓ Branch 2 → 3 taken 1928 times.
✓ Branch 2 → 4 taken 4122 times.
|
6050 | if (typeCheckerMode == TC_MODE_PRE) |
| 49 | 1928 | return visitGenericTypeDefPrepare(node); | |
| 50 |
1/2✓ Branch 4 → 5 taken 4122 times.
✗ Branch 4 → 8 not taken.
|
8244 | return nullptr; |
| 51 | } | ||
| 52 | |||
| 53 | 958 | std::any TypeChecker::visitAliasDef(AliasDefNode *node) { | |
| 54 |
2/2✓ Branch 2 → 3 taken 341 times.
✓ Branch 2 → 4 taken 617 times.
|
958 | if (typeCheckerMode == TC_MODE_PRE) |
| 55 | 341 | return visitAliasDefPrepare(node); | |
| 56 |
1/2✓ Branch 4 → 5 taken 617 times.
✗ Branch 4 → 8 not taken.
|
1234 | return nullptr; |
| 57 | } | ||
| 58 | |||
| 59 | 5759 | std::any TypeChecker::visitGlobalVarDef(GlobalVarDefNode *node) { | |
| 60 |
2/2✓ Branch 2 → 3 taken 2375 times.
✓ Branch 2 → 4 taken 3384 times.
|
5759 | if (typeCheckerMode == TC_MODE_PRE) |
| 61 | 2375 | return visitGlobalVarDefPrepare(node); | |
| 62 |
1/2✓ Branch 4 → 5 taken 3384 times.
✗ Branch 4 → 8 not taken.
|
6768 | return nullptr; |
| 63 | } | ||
| 64 | |||
| 65 | 8673 | std::any TypeChecker::visitExtDecl(ExtDeclNode *node) { | |
| 66 |
2/2✓ Branch 2 → 3 taken 2969 times.
✓ Branch 2 → 4 taken 5704 times.
|
8673 | if (typeCheckerMode == TC_MODE_PRE) |
| 67 | 2969 | return visitExtDeclPrepare(node); | |
| 68 |
1/2✓ Branch 4 → 5 taken 5704 times.
✗ Branch 4 → 8 not taken.
|
11408 | return nullptr; |
| 69 | } | ||
| 70 | |||
| 71 | 7239 | std::any TypeChecker::visitImportDef(ImportDefNode *node) { | |
| 72 |
2/2✓ Branch 2 → 3 taken 2525 times.
✓ Branch 2 → 4 taken 4714 times.
|
7239 | if (typeCheckerMode == TC_MODE_PRE) |
| 73 | 2525 | return visitImportDefPrepare(node); | |
| 74 |
1/2✓ Branch 4 → 5 taken 4714 times.
✗ Branch 4 → 8 not taken.
|
9428 | return nullptr; |
| 75 | } | ||
| 76 | |||
| 77 | } // namespace spice::compiler | ||
| 78 |