diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2021-06-08 21:25:58 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2021-06-08 21:25:58 -0700 |
commit | d0d8fc7b046d46640632f744d8b2751193b218f5 (patch) | |
tree | 73f103a33109d6f62635dc1c4ffaf54c579e35f3 | |
parent | 206493b5e17762fc65b4ce220754863ed0e1373b (diff) | |
download | mu-d0d8fc7b046d46640632f744d8b2751193b218f5.tar.gz |
.
-rw-r--r-- | shell/global.mu | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/shell/global.mu b/shell/global.mu index 67700fb8..9b68e91e 100644 --- a/shell/global.mu +++ b/shell/global.mu @@ -482,19 +482,19 @@ fn mutate-binding-in-globals name: (addr stream byte), val: (addr handle cell), # Accepts an input s-expression, naively checks if it is a definition, and if # so saves the gap-buffer to the appropriate global, spinning up a new empty # one to replace it with. -fn maybe-stash-gap-buffer-to-global _globals: (addr global-table), _definition-ah: (addr handle cell), gap: (addr handle gap-buffer) { - # if 'definition' is not a pair, return - var definition-ah/eax: (addr handle cell) <- copy _definition-ah - var _definition/eax: (addr cell) <- lookup *definition-ah - var definition/esi: (addr cell) <- copy _definition - var definition-type/eax: (addr int) <- get definition, type - compare *definition-type, 0/pair +fn maybe-stash-gap-buffer-to-global _globals: (addr global-table), _expr-ah: (addr handle cell), gap: (addr handle gap-buffer) { + # if 'expr' is not a pair, return + var expr-ah/eax: (addr handle cell) <- copy _expr-ah + var _expr/eax: (addr cell) <- lookup *expr-ah + var expr/esi: (addr cell) <- copy _expr + var expr-type/eax: (addr int) <- get expr, type + compare *expr-type, 0/pair { break-if-= return } - # if definition->left is neither "define" nor "set", return - var left-ah/eax: (addr handle cell) <- get definition, left + # if expr->left is neither "define" nor "set", return + var left-ah/eax: (addr handle cell) <- get expr, left var _left/eax: (addr cell) <- lookup *left-ah var left/ecx: (addr cell) <- copy _left { @@ -506,8 +506,8 @@ fn maybe-stash-gap-buffer-to-global _globals: (addr global-table), _definition-a break-if-!= return } - # locate the global for definition->right->left - var right-ah/eax: (addr handle cell) <- get definition, right + # locate the global for expr->right->left + var right-ah/eax: (addr handle cell) <- get expr, right var right/eax: (addr cell) <- lookup *right-ah var defined-symbol-ah/eax: (addr handle cell) <- get right, left var defined-symbol/eax: (addr cell) <- lookup *defined-symbol-ah |