diff options
author | Kartik Agaram <vc@akkartik.com> | 2020-10-09 21:17:51 -0700 |
---|---|---|
committer | Kartik Agaram <vc@akkartik.com> | 2020-10-09 21:17:51 -0700 |
commit | 7c6bb4d316a513b276828935162de8429e8e5df0 (patch) | |
tree | 19a98b737f0036bde44bb7ae83b138ab7047168a /apps/tile/data.mu | |
parent | eb2cccccebe6e396e929a49e08515d3ecea9b0fc (diff) | |
download | mu-7c6bb4d316a513b276828935162de8429e8e5df0.tar.gz |
6977
Snapshot. We've gotten arrow keys navigating, but segfault when getting to the second word in an expanded function call body.
Diffstat (limited to 'apps/tile/data.mu')
-rw-r--r-- | apps/tile/data.mu | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/apps/tile/data.mu b/apps/tile/data.mu index dd30dde0..59918cf1 100644 --- a/apps/tile/data.mu +++ b/apps/tile/data.mu @@ -374,3 +374,26 @@ fn final-element-value list: (addr handle call-path-element) -> result/eax: int var val/eax: (addr int) <- get final, index-in-body result <- copy *val } + +fn push-to-call-path-element list: (addr handle call-path-element), new: int { + var new-element-storage: (handle call-path-element) + var new-element-ah/edi: (addr handle call-path-element) <- address new-element-storage + allocate new-element-ah + var new-element/eax: (addr call-path-element) <- lookup *new-element-ah + # index-in-body + var dest/ecx: (addr int) <- get new-element, index-in-body + var src/edx: int <- copy new + copy-to *dest, src + # next + var dest2/ecx: (addr handle call-path-element) <- get new-element, next + copy-object list, dest2 + # return + copy-object new-element-ah, list +} + +fn drop-from-call-path-element _list: (addr handle call-path-element) { + var list-ah/esi: (addr handle call-path-element) <- copy _list + var list/eax: (addr call-path-element) <- lookup *list-ah + var next/eax: (addr handle call-path-element) <- get list, next + copy-object next, _list +} |