Commit Graph

368 Commits

Author SHA1 Message Date
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
Tristan B. Kildaire 8f86e03f7c Updated 2021-06-06 15:49:07 +02:00
Tristan B. Kildaire 999bab48a0 Added non-urgent TODO regarding the implementation of `parseClass` and `parseStruct` 2021-06-06 15:46:59 +02:00
Tristan B. Kildaire 1ddd7f102b Support for `static` without preceding accessor, has been added 2021-06-06 15:43:01 +02:00
Tristan B. Kildaire 82cffeaccb WIP: Adding support for `static` keyword without preceding accessor 2021-06-06 15:35:04 +02:00
Tristan B. Kildaire f0dae29533 Added support for `static` keyword when preceded by an accessor 2021-06-06 15:33:20 +02:00
Tristan B. Velloza Kildaire 948238d4e9 Added InitScope, for STATIC 2021-06-04 21:28:30 +02:00
Tristan B. Velloza Kildaire c8490bfe36 WIP 2021-06-04 14:52:22 +02:00
Tristan B. Velloza Kildaire 0bf4a7f658 WIP: Adding static support 2021-06-04 14:47:39 +02:00
Tristan B. Velloza Kildaire 6225b5e62f WIP: Need to add support for `static` 2021-06-04 14:39:49 +02:00
Tristan B. Velloza Kildaire 16bfdbfc2f Moved case with path resolution not visited to another test case 2021-06-04 13:43:44 +02:00
Tristan B. Velloza Kildaire 4eb0c97dc7 Works without it 2021-06-04 13:42:47 +02:00