Tristan B. Kildaire
8da6d94212
I wonder if that worked
2021-06-07 14:27:36 +02:00
Tristan B. Kildaire
00920ad43b
Added quick fix for gotcha
2021-06-07 14:00:06 +02:00
Tristan B. Kildaire
7e05c1cbdb
Prevent non-static classes from being used as a type in static initialization
2021-06-07 13:59:12 +02:00
Tristan B. Kildaire
2ac0e18aac
Statically initialize static classes that are members of the current class being statically initialized
2021-06-07 13:54:17 +02:00
Tristan B. Kildaire
d9566698d2
Pool the Module and make it depend on variables
2021-06-07 13:48:14 +02:00
Tristan B. Kildaire
547f25b835
Nvm
2021-06-07 13:29:15 +02:00
Tristan B. Kildaire
ea2f27d0b8
This is pretty aids not gonna lie
2021-06-07 13:25:42 +02:00
Tristan B. Kildaire
eac31532c7
If a Variable declaration has a non-basic type that is a Class-type then that class should have its static initialization run (we should make sure it is reachable however)
2021-06-07 11:17:48 +02:00
Tristan B. Kildaire
b07eecd5a2
Recursively print dependencies of the Module after running the dependency generator
2021-06-07 11:14:38 +02:00
Tristan B. Kildaire
edb11df247
Added method to print dependencies of the given Container
2021-06-07 11:14:22 +02:00
Tristan B. Kildaire
1aa3aabc44
Tired
2021-06-06 23:29:16 +02:00
Tristan B. Kildaire
d42779c3cc
WIP: Dependency
2021-06-06 23:10:16 +02:00
Tristan B. Kildaire
28bbd68857
Added dependency mechanism to Entity
2021-06-06 23:10:15 +02:00
Tristan B. Kildaire
88a6346993
Before revamp
2021-06-06 22:48:04 +02:00
Tristan B. Kildaire
fa953bc809
Fuck this is complicated (2/2)
...
Seeing how java does things
2021-06-06 22:46:06 +02:00
Tristan B. Kildaire
dc01256e60
Fuck this is complicated (1/2)
...
Going to need proper tree and also usign static now in a way that is legal but want it to be illegal to test for loops
2021-06-06 22:45:49 +02:00
Tristan B. Kildaire
a604f4ca27
Return immediatelly if the class has been statically initialized already
2021-06-06 21:43:42 +02:00
Tristan B. Kildaire
e418d98e73
Works, need to remove dupicates, this will prevent infinite mutual recursion (later)
...
too
2021-06-06 21:38:29 +02:00
Tristan B. Kildaire
5f30ba1ac9
Don't init the class already being initted
2021-06-06 21:34:23 +02:00
Tristan B. Kildaire
a30b544d67
Made initial state default to virtual (non-static) as intended
2021-06-06 20:06:27 +02:00
Tristan B. Kildaire
9609e11303
Process the class itself then too, because if it must be initted as it is referenced by a variable's type then we must do the initializtions (static) of said class first and then that variable is satisfied (it doesn't matter too much without an assignment expresison but would with it hence we definately want this.
2021-06-06 19:10:26 +02:00
Tristan B. Kildaire
4f0d601a0e
Added more tests
...
Added print out for case where parent of class type being referenced is not at module-level hence static-ness cannot be guaranteed and we will need to process this (possibly recursively)
2021-06-06 19:04:26 +02:00
Tristan B. Kildaire
257ff39b7d
Removed other stuff that should not be tested now
2021-06-06 18:57:36 +02:00
Tristan B. Kildaire
343564f287
All entities must be dependent on themselves (reason: see last commit)
2021-06-06 18:46:21 +02:00
Tristan B. Kildaire
15bce32ef6
WIP: Everything should be dependent on itself, just so we can build a tree afterwards else things like `int j;` at module-level will not be remembered
2021-06-06 18:44:47 +02:00
Tristan B. Kildaire
bf6a724783
Added intermediary type to differentiate between user-defined types, Class, Struct and built-in types like Number and Void
2021-06-06 18:42:23 +02:00
Tristan B. Kildaire
dd1ac9bdc3
Added basic type to the unit test to test that it doesn't add any dependencies.
2021-06-06 18:39:15 +02:00
Tristan B. Kildaire
0734a14f90
Added test case to test this.
2021-06-06 18:38:36 +02:00
Tristan B. Kildaire
4aeca83d90
Variables declared at module-level with types that are class types must set a dependency on said class running its static initializer
2021-06-06 18:38:07 +02:00
Tristan B. Kildaire
b2eca50f5f
Print out ndependencies after generating the list
2021-06-06 18:37:34 +02:00
Tristan B. Kildaire
3294076faa
If a variable declaration occurs at the module level an it is of a type that is non-basic then it is only a class-type and it must be statically initialized
...
(An actual check as to whether the type idk
2021-06-06 18:33:33 +02:00
Tristan B. Kildaire
8e2807c24a
WIP: Module-level type checking
2021-06-06 18:13:12 +02:00
Tristan B. Kildaire
bffcaa0898
Updated TODO
...
Removed static marking of Module-level class and struct definitions
2021-06-06 18:05:19 +02:00
Tristan B. Kildaire
3a9a43b258
Make all structs and classes at the Module level static
2021-06-06 17:59:46 +02:00
Tristan B. Kildaire
bedd9639a2
Updated TODO
2021-06-06 17:59:21 +02:00
Tristan B. Kildaire
0ddae3ab79
Added TODO
2021-06-06 17:57:50 +02:00
Tristan B. Kildaire
420ec5060d
TODO: Restarting dependency stuff
2021-06-06 17:56:31 +02:00
Tristan B. Kildaire
d6c38eee34
Actully idk what I am doing, this is a weird mix of things. I should first focus on classes and static initializations. Then when a type is used of a class that should cause it to init
2021-06-06 17:44:16 +02:00
Tristan B. Kildaire
7e8e4d6f56
Disabled visitation code for now
2021-06-06 17:33:14 +02:00
Tristan B. Kildaire
ea411066aa
Grouped dependency code toghether
2021-06-06 17:15:48 +02:00
Tristan B. Kildaire
bf226a16c7
Switched around
2021-06-06 17:14:24 +02:00
Tristan B. Kildaire
0596611295
Reliance list was keyed incorrecttly
2021-06-06 17:13:32 +02:00
Tristan B. Kildaire
4c538a95f5
Dependency list construction works
2021-06-06 17:08:55 +02:00
Tristan B. Kildaire
3501910f32
WIP: Dependancy "tree" construction
...
Added collection of all static members per each class in a container
2021-06-06 16:52:47 +02:00
Tristan B. Kildaire
880425f775
Updated todo
2021-06-06 16:10:33 +02:00
Tristan B. Kildaire
0023fe38f3
Renamed type checking test case
2021-06-06 16:06:40 +02:00
Tristan B. Kildaire
e8f7a93602
Updated test case for basic dependance
2021-06-06 16:05:27 +02:00
Tristan B. Kildaire
6de8e49a1f
Added new test case for use in type_checking
2021-06-06 15:59:01 +02:00
Tristan B. Kildaire
70623ecd4a
Check off things already implemented
...
Update test case to test them
2021-06-06 15:54:15 +02:00
Tristan B. Kildaire
3f9375c6ed
Added support for `static` (complete support) within structs
...
Updated test case to test this
2021-06-06 15:51:06 +02:00