-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtodo.txt
38 lines (34 loc) · 1.75 KB
/
todo.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
make if, switch, for, while, block expressions not statements
move the current_loop_{entry,exit,phi} from global context to function parameters
then we can have easily nested loops
todo type inference for if etc
add switch break to the phi
add for block value to the phi
loop break should optionally return a value
loops and blocks need phi instructions then
if the last statement in a block is an expression its value should be returned
loop return removes the need for some other less nice constructs
python-like for/else
multi level break
switch continue should fallthrough
not sure what for and while should return yet
maybe vector or iterator like rust or python
user defined types
for the mvp
only named types, no anonymous types
what if an accessor doesn't access all the way down to a primitive_type?
have to generate a type_id for the intermediate type
operators only for primitive types
only type_def on primitive_types, no structs or arrays
variable_def requires an assignment
zero initialise variable_def and dont have an assignment
literals/constants of aggregate types
everything should be zero initialised if its not explicitly initialised
but its inconsistent to have zero initialisation for structs and arrays and not for primitive types
lexing/parsing identifiers
could map generic `identifier` to a `variable_id`, `type_id`, `function_id`
lexer uses lookup_or_insert to unique/map generic `identifiers`
use a parser lookup_or_insert function for each
would keep them contiguous, could use vectors instead of maps
and be more typey
mapping back to the actual string would be harder though