Commit Graph

177 Commits

Author SHA1 Message Date
306b029951 Generator now has module support 2024-02-19 21:00:20 -05:00
3d75cdbd02 Parser now has something of a concept of modules 2024-02-14 01:44:25 -05:00
b743e56c2a Updated generator 2024-02-13 13:12:53 -05:00
bf73821dbd New test for generator confirmed to work, filled out 2024-02-10 21:31:10 -05:00
2571fcde99 Add same test as stub to generator 2024-02-10 21:20:24 -05:00
deae98001d Fix small issues with generator readme 2024-02-10 18:32:35 -05:00
a91922e749 Add generator README.md 2024-02-10 18:26:51 -05:00
35299ea526 Updated generator's test-common 2024-02-09 04:02:55 -05:00
100861dc47 Added module-level doc comments to generator and generator/native 2024-02-09 00:57:06 -05:00
122cafbc2b Unexport generator.resultMode 2024-02-08 16:06:00 -05:00
74e84c7da4 Fixed all generator tests 2024-02-08 13:32:04 -05:00
94a25f0aac Generator compiles and runs 2024-02-08 13:14:21 -05:00
66771b3145 Put functionality from generator/test-common.go in its own package 2024-02-01 01:59:17 -05:00
f659866ae1 Fix crash when using int literals as floats 2024-01-29 13:29:53 -05:00
4aab296de3 Update tests 2024-01-29 03:30:54 -05:00
b4cb7454b0 Slice length fields are properly stored as Index values 2024-01-29 03:11:43 -05:00
c0f771db09 Update tests 2024-01-29 02:20:16 -05:00
5c8749d8cd Updated test cases for literals 2024-01-29 00:30:48 -05:00
06759a6e39 Array literals and string literals now exhibit identical behavior
They both fill unspecified data with zeros, and add a null
terminator when directly assigned to a pointer.
2024-01-29 00:25:34 -05:00
192044e074 String generation now uses correct type names, data length, and nulls 2024-01-28 17:10:03 -05:00
ff3efe646e Fix tests 2024-01-28 16:44:34 -05:00
01526aa914 Add source code printout for tests 2024-01-28 14:46:47 -05:00
31cf892a63 Broke up the monolithic TestLiteral 2024-01-28 14:36:04 -05:00
fa90e50c3b Increased the coverage of TestLiteralArray 2024-01-28 14:15:54 -05:00
83aefbae07 *Greatly* reduced the amount of excess IR related to string literals 2024-01-28 14:11:41 -05:00
1f53fc5214 Struct literals now support irDestLoc 2024-01-28 04:50:18 -05:00
3d6142f496 Added the ability for array literals to be undersized 2024-01-28 04:43:01 -05:00
235252b591 Added test for nested array literals
Who knew it would work first try?
2024-01-28 04:24:15 -05:00
185a6114a6 Array literals now support irDestLoc 2024-01-28 04:18:33 -05:00
a4c7212709 Add more tests for loops 2024-01-28 03:29:49 -05:00
e9a9fc75c6 Fixed extra lines after IR blocks 2024-01-28 03:18:39 -05:00
1b4a0621de Fix some issues with control flow, add tests 2024-01-28 03:16:05 -05:00
7e4abb7bba Add test case for comparisons on defined types 2024-01-28 02:18:18 -05:00
9a4241cb11 Updated all tests except for literal_test.go
You Will See Why
2024-01-27 23:24:19 -05:00
3ca9b5ff50 Well it would help if it generated well formed IR 2024-01-27 23:00:03 -05:00
079a05ccca Assignment coercions are much more IR efficient 2024-01-27 22:45:28 -05:00
cfe12634ef Complete TestInterfaceInStruct (no longer segfaults somehow) 2024-01-27 19:49:22 -05:00
928fef02cd More using qualified names in IR 2024-01-27 18:16:30 -05:00
2f8b3fcad6 Oh my god I swapped the columns 2024-01-27 18:09:51 -05:00
7bc24eabe0 Added cool output to failed tests 2024-01-27 18:07:49 -05:00
839178d1d2 Literal generation now uses qualified type names when possible 2024-01-27 17:16:23 -05:00
f039be92b6 Remove redundant val variable/declaration generation 2024-01-27 14:17:52 -05:00
c0f004d3b8 Rename some routines in data 2024-01-27 14:03:38 -05:00
55f0138a64 Updated more tests (cutting out extra load insts) 2024-01-27 17:35:33 +00:00
a4fc8746bd Fix more names and orgaization of statement generation 2024-01-27 17:33:15 +00:00
64d246a997 Added -Any suffix to appropriate generation routines 2024-01-27 17:24:47 +00:00
e188b2f349 Fixed segfault relating to break and return statements 2024-01-27 17:11:44 +00:00
8e9b5e0613 Introducing ResultMode! time to got to bed. 2024-01-27 10:43:27 +00:00
a423d572ad Update some tests 2024-01-27 10:06:17 +00:00
12ab7dd3e3 Updated control flow generation 2024-01-27 10:03:15 +00:00
b6da53afd6 Void functions/methods no longer request a value 2024-01-27 09:22:19 +00:00
c63e077f9a Made generic block generation routine 2024-01-27 09:18:41 +00:00
75ec6a2ddc Made panic messages in expression-multiplex.go more informative 2024-01-27 09:15:39 +00:00
8b45c91239 Add Val onto value expressions 2024-01-27 09:09:27 +00:00
934af40e4b Update block generation routines 2024-01-27 09:06:17 +00:00
f827bfeb7a Add generateStatement routine 2024-01-27 08:53:29 +00:00
32ce14f032 Renamed generateStatement to generateStatementVal 2024-01-27 08:49:25 +00:00
ac6a969ac9 Add generateExpression function 2024-01-27 08:48:00 +00:00
07a4895b60 Rename expression source files 2024-01-27 08:40:02 +00:00
cfc894ff29 Rename generateExpression to generateExpressionVal 2024-01-27 08:39:05 +00:00
c2df4203bd Same thing for bit casts 2024-01-27 07:05:34 +00:00
01a3ac2e1b Generator now no longer generates ineffectual value casts 2024-01-27 07:03:13 +00:00
6fd0d600e2 Add more tests to generator 2024-01-27 01:00:07 +00:00
4114b5c3aa Updated stuff to use the new routines in data.go 2024-01-26 05:35:47 +00:00
effebe5f64 More routines in data.go 2024-01-26 05:35:22 +00:00
cf201a08c6 Added a test case for a Writer interface
I really need to cut out a lot of the unnecessary IR that the
generator emits
2024-01-26 04:32:55 +00:00
794c41766c Added a test case for casting slices to pointers 2024-01-26 04:21:30 +00:00
8a6d4599d1 Fix conversion of slices to pointers 2024-01-26 04:07:58 +00:00
ea697c19dd Change the location at which defined IR types are wrapped
Defined IR types are wrapped in a TypeDefined by generateTypeNamed.
This causes them to be sent through GEP, which is necessary for
testing.
2024-01-25 22:57:52 +00:00
4878c62531 Wrote test for getelementptr'ing into chained typedefs 2024-01-25 18:19:34 +00:00
143aeb5236 Use TypeDefined in generator 2024-01-25 18:19:22 +00:00
496ef09154 Add test for chained typedefs with different names 2024-01-25 17:56:20 +00:00
dae023b2af Fix duplicated pointer types 2024-01-25 07:36:51 +00:00
3d94027c09 Added test to debug absurd behavior relating to type defs 2023-12-24 22:49:10 -05:00
182b361237 Interface method calls no longer cause a segfault 2023-12-24 22:18:47 -05:00
b750fa3c77 Something was off with TestCompare 2023-12-24 21:45:47 -05:00
47b3594bbf Fix code I probably wrote while high off my ass 2023-12-24 21:39:56 -05:00
06df727f7f Empty struct literal values are initialized to zero 2023-12-23 17:25:27 -05:00
cd688c91af Added nil (zero initializer) literals 2023-12-21 23:33:38 -05:00
a9ff511496 Generator can produce link names 2023-12-20 03:05:27 -05:00
b220235a43 I forgor 2023-12-15 12:46:33 -05:00
e55d87d378 Fix comparison predicates 2023-12-15 12:40:43 -05:00
c4df65d189 Attempt to further fix interface assignment 2023-12-14 21:21:07 -05:00
f72bf533e0 Method calling now properly passes pointer instead of value 2023-12-14 01:23:34 -05:00
6fa8adf871 generateAssignmentSource assigns interface methods to iface dest 2023-12-14 00:47:14 -05:00
900e90d468 Add test for aforementioned issue 2023-12-07 17:14:37 -05:00
4a981f3253 Augh 2023-12-07 04:03:28 -05:00
6045ed6ee3 If/else branching is no longer... like how it was 2023-12-07 03:58:57 -05:00
c780668cd0 If/else generation will not attempt to overwrite branches 2023-12-07 03:54:01 -05:00
fb360c3398 Operands to IR binary instructions now have identifiers instead of names 2023-12-07 03:04:29 -05:00
30c346c6b7 Generator alloca's variables when they are defined 2023-12-07 02:48:27 -05:00
7d436290c4 Add some more test cases to the generator 2023-12-05 22:29:29 -05:00
e06fd099ce Fix bug with popping block managers off of the stack 2023-12-05 22:27:55 -05:00
ead5ed3222 Slice operations now load the data pointer 2023-12-05 15:35:17 -05:00
8085da442b Revert slices back to having just two fields 2023-12-05 03:07:54 -05:00
7f866d102d Fixed several cases where the generator would output invalid IR 2023-12-03 22:23:04 -05:00
e24b9b8f17 Generator passes method owner as pointer 2023-12-03 15:38:07 -05:00
52ac569c06 Fix stale code 2023-12-02 23:42:54 -05:00
7dbde0a1d7 Generator generates methods properly 2023-12-02 23:41:35 -05:00
a18d9ea0de Oops 2023-12-02 23:36:12 -05:00