Commit graph

115 commits

Author SHA1 Message Date
James Harton
0b6c27df74 Ensure that predicate methods are defined without a return type because they always return a boolean. 2019-04-21 15:02:27 +12:00
James Harton
2e58f2d71f Pest deprecated into_span. 2019-04-12 12:24:11 +12:00
James Harton
fc5a796321 Make sure that there are no unresolved types left over and the end of pass. 2019-04-09 16:06:09 +12:00
James Harton
1aeeda93fe Tidy up type-finding code. 2019-04-09 09:47:06 +12:00
James Harton
1d3815e281 Make StringIdx Copy. 2019-04-04 08:23:31 +13:00
James Harton
87f4b970f6 Fix improvements not being applied to all IR. 2019-04-03 21:40:06 +13:00
James Harton
396a6d020b All blocks have result types. 2019-04-03 19:56:05 +13:00
James Harton
c465cdf9a4 More type unification is working. 2019-04-03 18:45:19 +13:00
James Harton
48c66442e5 Improve code generation for methods. 2019-03-27 16:35:40 +13:00
James Harton
c64a589f5a Use known types in more places. 2019-03-26 19:37:51 +13:00
James Harton
a957660c82 Compiler can now output IR because that's super useful. 2019-03-26 18:57:02 +13:00
James Harton
b2b631a7c7 Reduce duplication in the IR builder and correctly handle clauses with multi-block CFGs. 2019-03-25 12:30:19 +13:00
James Harton
811776d9e7 Code gardening. 2019-03-23 09:36:45 +13:00
James Harton
b52e236c67 Separate method definitions from method specifications in the parser. 2019-03-21 21:05:09 +13:00
James Harton
dc08e056c7 Add *very* simple compiler CLI to print out the context of a compiled file. 2019-03-21 16:43:22 +13:00
James Harton
91a52574c8 Add some simple desugaring to the compiler. 2019-03-21 16:15:24 +13:00
James Harton
a45d9627dc Fix function and method calling once and for all. 2019-03-21 10:18:51 +13:00
James Harton
7be2c3e525 Code gardening. 2019-03-20 20:32:23 +13:00
James Harton
64435f1831 Track compile errors if a type is redefined. 2019-03-20 16:58:59 +13:00
James Harton
20bb5314cc Track types for locals and properties. 2019-03-20 16:19:59 +13:00
James Harton
ee3df9a527 Ensure that if expressions parse and build correctly. 2019-03-18 20:20:39 +13:00
James Harton
536e5cc5f4 Code gardening. 2019-03-18 18:54:21 +13:00
James Harton
596ee84f44 Add code improvement to IR and implement simple numeric constant folding. 2019-03-18 17:38:36 +13:00
James Harton
8942c04c6e Extend the IR to include the location and the result type. 2019-03-18 13:55:09 +13:00
James Harton
b0ab1a4717 Store blocks on the context and reference them.
Because we need to build a control-flow graph from all our blocks don't
store them haphazard all over the place but in a single blocks
collection on the context object.
2019-03-18 13:01:27 +13:00
James Harton
26ed1130e7 Use blocks rather than vecs or IR all over the place. 2019-03-18 08:53:47 +13:00
James Harton
30fdff315b Build IR 2019-03-17 18:54:35 +13:00
James Harton
bd2177940c Add a bunch more IR stuff and anonymous functions. 2019-03-14 21:25:12 +13:00
James Harton
781832eb7d There's no need to store the type declarations in the IR. 2019-03-14 16:51:15 +13:00
James Harton
292fdb1305 Add type, trait and impl definitions. 2019-03-14 08:29:01 +13:00
James Harton
f6359f4245 Use a simple stack machine to build the IR. 2019-03-13 20:32:13 +13:00
James Harton
81c0ac85c4 WIP: I don't think building our IR using recursive descent is going to work. 2019-03-12 15:44:13 +13:00
James Harton
aa6395e55b Make the parser much more explicit about it's grammer and deal with the consequences later. 2019-03-08 22:40:34 +13:00
James Harton
fd823107f1 Add page about Huia with poem. 2019-03-08 15:55:42 +13:00
James Harton
f18f088105 Use a smaller photo for faster loadijng. 2019-03-08 15:30:40 +13:00
James Harton
277ce9cfe7 Helps if one includes the theme along with the site. 2019-03-08 15:20:01 +13:00
James Harton
ea00028c2e Attempted installation of Hexo site generator. 2019-03-08 14:01:39 +13:00
James Harton
ba04a202c6 method calls are left associative. 2019-03-07 18:36:29 +13:00
James Harton
78f7593520 Reimplement method calls as binary operations. 2019-03-07 11:09:39 +13:00
James Harton
dece06f8c6 Build IR for more expressions. 2019-03-06 19:27:57 +13:00
James Harton
6ea740a436 Include clippy in CI. 2019-03-06 16:40:35 +13:00
James Harton
977e0de9a1 Assign isn't a binary operation anymore. 2019-03-06 16:29:29 +13:00
James Harton
e022838be6 Add Ir for unary and binary expressions. 2019-03-06 16:27:22 +13:00
James Harton
030aeef878 Add braced expressions for tighter binding. 2019-03-06 15:36:04 +13:00
James Harton
a0e33edd10 Add IR for array and map constants. 2019-03-06 15:13:40 +13:00
James Harton
10fcc65045 Start over by trying to build an IR instead of the final output. 2019-03-06 13:38:18 +13:00
James Harton
2f55480228 Update MIT license file 2019-03-04 15:07:30 +13:00
James Harton
59b28f7ce9 Rename typename to just ty. 2019-03-03 13:38:44 +13:00
James Harton
b7d15a2c3c Remove compiler. Again. 2019-03-03 13:28:28 +13:00
James Harton
33e364bf38 Remove the concept of a typespec because it's just an expression. 2019-03-03 13:28:09 +13:00