Line | Branch | Exec | Source |
---|---|---|---|
1 | // Copyright (c) 2021-2025 ChilliBits. All rights reserved. | ||
2 | |||
3 | #include "TypeChecker.h" | ||
4 | |||
5 | namespace spice::compiler { | ||
6 | |||
7 | 775 | std::any TypeChecker::visitMainFctDef(MainFctDefNode *node) { | |
8 |
2/2✓ Branch 0 (2→3) taken 367 times.
✓ Branch 1 (2→4) taken 408 times.
|
775 | if (typeCheckerMode == TC_MODE_PRE) |
9 | 367 | return visitMainFctDefPrepare(node); | |
10 | else | ||
11 | 408 | return visitMainFctDefCheck(node); | |
12 | } | ||
13 | |||
14 | 23386 | std::any TypeChecker::visitFctDef(FctDefNode *node) { | |
15 |
2/2✓ Branch 0 (2→3) taken 7505 times.
✓ Branch 1 (2→4) taken 15881 times.
|
23386 | if (typeCheckerMode == TC_MODE_PRE) |
16 | 7505 | return visitFctDefPrepare(node); | |
17 | else | ||
18 | 15881 | return visitFctDefCheck(node); | |
19 | } | ||
20 | |||
21 | 11705 | std::any TypeChecker::visitProcDef(ProcDefNode *node) { | |
22 |
2/2✓ Branch 0 (2→3) taken 3744 times.
✓ Branch 1 (2→4) taken 7961 times.
|
11705 | if (typeCheckerMode == TC_MODE_PRE) |
23 | 3744 | return visitProcDefPrepare(node); | |
24 | else | ||
25 | 7961 | return visitProcDefCheck(node); | |
26 | } | ||
27 | |||
28 | 1783 | std::any TypeChecker::visitStructDef(StructDefNode *node) { | |
29 |
2/2✓ Branch 0 (2→3) taken 668 times.
✓ Branch 1 (2→4) taken 1115 times.
|
1783 | if (typeCheckerMode == TC_MODE_PRE) |
30 | 668 | return visitStructDefPrepare(node); | |
31 | else | ||
32 | 1115 | return visitStructDefCheck(node); | |
33 | } | ||
34 | |||
35 | 194 | std::any TypeChecker::visitInterfaceDef(InterfaceDefNode *node) { | |
36 |
2/2✓ Branch 0 (2→3) taken 93 times.
✓ Branch 1 (2→4) taken 101 times.
|
194 | if (typeCheckerMode == TC_MODE_PRE) |
37 | 93 | return visitInterfaceDefPrepare(node); | |
38 |
1/2✓ Branch 0 (4→5) taken 101 times.
✗ Branch 1 (4→7) not taken.
|
101 | return nullptr; |
39 | } | ||
40 | |||
41 | 193 | std::any TypeChecker::visitEnumDef(EnumDefNode *node) { | |
42 |
2/2✓ Branch 0 (2→3) taken 65 times.
✓ Branch 1 (2→4) taken 128 times.
|
193 | if (typeCheckerMode == TC_MODE_PRE) |
43 | 65 | return visitEnumDefPrepare(node); | |
44 |
1/2✓ Branch 0 (4→5) taken 128 times.
✗ Branch 1 (4→7) not taken.
|
128 | return nullptr; |
45 | } | ||
46 | |||
47 | 2787 | std::any TypeChecker::visitGenericTypeDef(GenericTypeDefNode *node) { | |
48 |
2/2✓ Branch 0 (2→3) taken 891 times.
✓ Branch 1 (2→4) taken 1896 times.
|
2787 | if (typeCheckerMode == TC_MODE_PRE) |
49 | 891 | return visitGenericTypeDefPrepare(node); | |
50 |
1/2✓ Branch 0 (4→5) taken 1896 times.
✗ Branch 1 (4→7) not taken.
|
1896 | return nullptr; |
51 | } | ||
52 | |||
53 | 172 | std::any TypeChecker::visitAliasDef(AliasDefNode *node) { | |
54 |
2/2✓ Branch 0 (2→3) taken 67 times.
✓ Branch 1 (2→4) taken 105 times.
|
172 | if (typeCheckerMode == TC_MODE_PRE) |
55 | 67 | return visitAliasDefPrepare(node); | |
56 |
1/2✓ Branch 0 (4→5) taken 105 times.
✗ Branch 1 (4→7) not taken.
|
105 | return nullptr; |
57 | } | ||
58 | |||
59 | 2716 | std::any TypeChecker::visitGlobalVarDef(GlobalVarDefNode *node) { | |
60 |
2/2✓ Branch 0 (2→3) taken 1168 times.
✓ Branch 1 (2→4) taken 1548 times.
|
2716 | if (typeCheckerMode == TC_MODE_PRE) |
61 | 1168 | return visitGlobalVarDefPrepare(node); | |
62 |
1/2✓ Branch 0 (4→5) taken 1548 times.
✗ Branch 1 (4→7) not taken.
|
1548 | return nullptr; |
63 | } | ||
64 | |||
65 | 2862 | std::any TypeChecker::visitExtDecl(ExtDeclNode *node) { | |
66 |
2/2✓ Branch 0 (2→3) taken 961 times.
✓ Branch 1 (2→4) taken 1901 times.
|
2862 | if (typeCheckerMode == TC_MODE_PRE) |
67 | 961 | return visitExtDeclPrepare(node); | |
68 |
1/2✓ Branch 0 (4→5) taken 1901 times.
✗ Branch 1 (4→7) not taken.
|
1901 | return nullptr; |
69 | } | ||
70 | |||
71 | 1659 | std::any TypeChecker::visitImportDef(ImportDefNode *node) { | |
72 |
2/2✓ Branch 0 (2→3) taken 588 times.
✓ Branch 1 (2→4) taken 1071 times.
|
1659 | if (typeCheckerMode == TC_MODE_PRE) |
73 | 588 | return visitImportDefPrepare(node); | |
74 |
1/2✓ Branch 0 (4→5) taken 1071 times.
✗ Branch 1 (4→7) not taken.
|
1071 | return nullptr; |
75 | } | ||
76 | |||
77 | } // namespace spice::compiler | ||
78 |