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 | 761 | std::any TypeChecker::visitMainFctDef(MainFctDefNode *node) { | |
8 |
2/2✓ Branch 0 (2→3) taken 360 times.
✓ Branch 1 (2→4) taken 401 times.
|
761 | if (typeCheckerMode == TC_MODE_PRE) |
9 | 360 | return visitMainFctDefPrepare(node); | |
10 | else | ||
11 | 401 | return visitMainFctDefCheck(node); | |
12 | } | ||
13 | |||
14 | 19281 | std::any TypeChecker::visitFctDef(FctDefNode *node) { | |
15 |
2/2✓ Branch 0 (2→3) taken 6226 times.
✓ Branch 1 (2→4) taken 13055 times.
|
19281 | if (typeCheckerMode == TC_MODE_PRE) |
16 | 6226 | return visitFctDefPrepare(node); | |
17 | else | ||
18 | 13055 | return visitFctDefCheck(node); | |
19 | } | ||
20 | |||
21 | 10576 | std::any TypeChecker::visitProcDef(ProcDefNode *node) { | |
22 |
2/2✓ Branch 0 (2→3) taken 3400 times.
✓ Branch 1 (2→4) taken 7176 times.
|
10576 | if (typeCheckerMode == TC_MODE_PRE) |
23 | 3400 | return visitProcDefPrepare(node); | |
24 | else | ||
25 | 7176 | return visitProcDefCheck(node); | |
26 | } | ||
27 | |||
28 | 1587 | std::any TypeChecker::visitStructDef(StructDefNode *node) { | |
29 |
2/2✓ Branch 0 (2→3) taken 605 times.
✓ Branch 1 (2→4) taken 982 times.
|
1587 | if (typeCheckerMode == TC_MODE_PRE) |
30 | 605 | return visitStructDefPrepare(node); | |
31 | else | ||
32 | 982 | return visitStructDefCheck(node); | |
33 | } | ||
34 | |||
35 | 172 | std::any TypeChecker::visitInterfaceDef(InterfaceDefNode *node) { | |
36 |
2/2✓ Branch 0 (2→3) taken 83 times.
✓ Branch 1 (2→4) taken 89 times.
|
172 | if (typeCheckerMode == TC_MODE_PRE) |
37 | 83 | return visitInterfaceDefPrepare(node); | |
38 |
1/2✓ Branch 0 (4→5) taken 89 times.
✗ Branch 1 (4→7) not taken.
|
89 | return nullptr; |
39 | } | ||
40 | |||
41 | 184 | std::any TypeChecker::visitEnumDef(EnumDefNode *node) { | |
42 |
2/2✓ Branch 0 (2→3) taken 63 times.
✓ Branch 1 (2→4) taken 121 times.
|
184 | if (typeCheckerMode == TC_MODE_PRE) |
43 | 63 | return visitEnumDefPrepare(node); | |
44 |
1/2✓ Branch 0 (4→5) taken 121 times.
✗ Branch 1 (4→7) not taken.
|
121 | return nullptr; |
45 | } | ||
46 | |||
47 | 2527 | std::any TypeChecker::visitGenericTypeDef(GenericTypeDefNode *node) { | |
48 |
2/2✓ Branch 0 (2→3) taken 810 times.
✓ Branch 1 (2→4) taken 1717 times.
|
2527 | if (typeCheckerMode == TC_MODE_PRE) |
49 | 810 | return visitGenericTypeDefPrepare(node); | |
50 |
1/2✓ Branch 0 (4→5) taken 1717 times.
✗ Branch 1 (4→7) not taken.
|
1717 | return nullptr; |
51 | } | ||
52 | |||
53 | 142 | std::any TypeChecker::visitAliasDef(AliasDefNode *node) { | |
54 |
2/2✓ Branch 0 (2→3) taken 53 times.
✓ Branch 1 (2→4) taken 89 times.
|
142 | if (typeCheckerMode == TC_MODE_PRE) |
55 | 53 | return visitAliasDefPrepare(node); | |
56 |
1/2✓ Branch 0 (4→5) taken 89 times.
✗ Branch 1 (4→7) not taken.
|
89 | return nullptr; |
57 | } | ||
58 | |||
59 | 2644 | std::any TypeChecker::visitGlobalVarDef(GlobalVarDefNode *node) { | |
60 |
2/2✓ Branch 0 (2→3) taken 1144 times.
✓ Branch 1 (2→4) taken 1500 times.
|
2644 | if (typeCheckerMode == TC_MODE_PRE) |
61 | 1144 | return visitGlobalVarDefPrepare(node); | |
62 |
1/2✓ Branch 0 (4→5) taken 1500 times.
✗ Branch 1 (4→7) not taken.
|
1500 | return nullptr; |
63 | } | ||
64 | |||
65 | 2548 | std::any TypeChecker::visitExtDecl(ExtDeclNode *node) { | |
66 |
2/2✓ Branch 0 (2→3) taken 868 times.
✓ Branch 1 (2→4) taken 1680 times.
|
2548 | if (typeCheckerMode == TC_MODE_PRE) |
67 | 868 | return visitExtDeclPrepare(node); | |
68 |
1/2✓ Branch 0 (4→5) taken 1680 times.
✗ Branch 1 (4→7) not taken.
|
1680 | return nullptr; |
69 | } | ||
70 | |||
71 | 1411 | std::any TypeChecker::visitImportDef(ImportDefNode *node) { | |
72 |
2/2✓ Branch 0 (2→3) taken 508 times.
✓ Branch 1 (2→4) taken 903 times.
|
1411 | if (typeCheckerMode == TC_MODE_PRE) |
73 | 508 | return visitImportDefPrepare(node); | |
74 |
1/2✓ Branch 0 (4→5) taken 903 times.
✗ Branch 1 (4→7) not taken.
|
903 | return nullptr; |
75 | } | ||
76 | |||
77 | } // namespace spice::compiler | ||
78 |