diff options
author | Kartik Agaram <vc@akkartik.com> | 2020-10-05 20:44:50 -0700 |
---|---|---|
committer | Kartik Agaram <vc@akkartik.com> | 2020-10-05 20:44:50 -0700 |
commit | 6833b4542c3c9880eb3698ce58428ba992fd6062 (patch) | |
tree | d698409cfaa03e531f2c70325a62a852a2356a92 /apps/tile/data.mu | |
parent | c626219e3f5a44dfa7ddeba32627f4824ec965a4 (diff) | |
download | mu-6833b4542c3c9880eb3698ce58428ba992fd6062.tar.gz |
6962
Slowly hoist cursor-word from environment to sandbox. This isn't its final destination.
Diffstat (limited to 'apps/tile/data.mu')
-rw-r--r-- | apps/tile/data.mu | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/apps/tile/data.mu b/apps/tile/data.mu index 48966968..aac2dc6d 100644 --- a/apps/tile/data.mu +++ b/apps/tile/data.mu @@ -6,6 +6,7 @@ type program { type sandbox { setup: (handle line) data: (handle line) + cursor-word: (handle word) next: (handle sandbox) prev: (handle sandbox) } @@ -58,24 +59,24 @@ type result { error: (handle array byte) # single error message for now } -# if 'out' is non-null, save the first word of the program there -fn initialize-program _program: (addr program), out: (addr handle word) { +fn initialize-program _program: (addr program) { var program/esi: (addr program) <- copy _program var defs/eax: (addr handle function) <- get program, defs create-primitive-defs defs var sandbox-ah/eax: (addr handle sandbox) <- get program, sandboxes allocate sandbox-ah var sandbox/eax: (addr sandbox) <- lookup *sandbox-ah - initialize-sandbox sandbox, out + initialize-sandbox sandbox } -# if 'out' is non-null, save the first word of the sandbox there -fn initialize-sandbox _sandbox: (addr sandbox), out: (addr handle word) { +fn initialize-sandbox _sandbox: (addr sandbox) { var sandbox/esi: (addr sandbox) <- copy _sandbox var line-ah/eax: (addr handle line) <- get sandbox, data allocate line-ah var line/eax: (addr line) <- lookup *line-ah - initialize-line line, out + var cursor-word-ah/esi: (addr handle word) <- get sandbox, cursor-word + allocate cursor-word-ah + initialize-line line, cursor-word-ah } # initialize line with a single empty word |