Commit Graph

17 Commits

Author SHA1 Message Date
7bb4803b9e lang: codegen: implement cascade operator generation 2025-09-12 10:01:07 +01:00
8425e2db4b lang: codegen: implement for-loop code generation 2025-09-08 16:25:54 +01:00
6844f498c5 lang: codegen: replace codegen_value with a new system for passing different types of values between code generators 2025-09-08 16:17:29 +01:00
e5ea7b1134 lang: codegen: remove old var declaration generator 2025-09-08 16:10:11 +01:00
bda10b1166 lang: codegen: update mie_ctx include path 2025-08-16 21:00:22 +01:00
9f83929600 lang: update mie ir api usage 2025-06-02 11:31:35 +01:00
475575f76f lang: codegen: add for-loop generator 2025-05-08 10:53:00 +01:00
64d1015a3c lang: codegen: implement cond-group code generation 2025-04-28 15:44:44 +01:00
d37c07e5e4 lang: codegen: implement return generation 2025-04-24 09:25:36 +01:00
7483b32c25 lang: codegen: redesign variable definition/resolution system to support capturing
the codegen scope system has been removed. instead, each generator state in the stack,
from the current state backwards, is informed when a variable is defined, resolved, or
captured.

when a variable is defined, the state stack is traversed back-to-front (current generator
first). each state has a chance to record the variable definition. once one state has
signalled that it has recorded the variable definition, the traversal ends.

when a variable is resolved, the state stack is traversed back-to-front (current generator
first). each state is asked whether or not it recognises the variable identifier being resolved.
if a state has the variable in question defined, it returns information about the variable
definition, and the traversal stops.

once a variable has been resolved, the state stack is traversed front-to-back (current generator
last), starting from the generator /after/ the one that provided the variable definition. each
generator in the iteration is given the chance to adjust the variable information, or generate
IR in response to the variable being accessed. this is used to implement variable capture,
where the state of a variable in the enclosing context is captured for later use.
2025-04-22 15:23:42 +01:00
f0869b5ba0 lang: codegen: start implementing lambda generation 2025-04-21 21:11:45 +01:00
4a258e2580 lang: codegen: implement fstring generation 2025-04-18 23:17:39 +01:00
abb7cfaf0e mie: move mie_ctx to a separate header 2025-04-17 22:25:36 +01:00
7b8d77a264 lang: codegen: implement message-send code generation and global var references 2025-04-17 21:44:38 +01:00
f0e6237473 lang: codegen: redesign again to use purely pre-order ast traversal 2025-04-16 21:58:52 +01:00
670b7c5a33 lang: codegen: redesign codegen to use a stack-based state machine 2025-04-14 20:15:05 +01:00
2cd78a64b0 lang: start implementing code generation (ast to ir) facility 2025-04-14 09:48:16 +01:00