about summary refs log tree commit diff stats
path: root/apps/tile/word.mu
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2020-09-26 13:41:23 -0700
committerKartik Agaram <vc@akkartik.com>2020-09-26 13:41:23 -0700
commite0bceffe08e06a30e771efe986f1f4f7c717dc95 (patch)
treee485751ca2e141a7ee777434cc6de2407af1f344 /apps/tile/word.mu
parentfca30f0f86f848c105c0dd048815f959e850eb1b (diff)
downloadmu-e0bceffe08e06a30e771efe986f1f4f7c717dc95.tar.gz
6860
Snapshot: tile currently segfaulting. I need to back up and make it easier
to debug.
Diffstat (limited to 'apps/tile/word.mu')
-rw-r--r--apps/tile/word.mu7
1 files changed, 7 insertions, 0 deletions
diff --git a/apps/tile/word.mu b/apps/tile/word.mu
index 8016a496..b425868e 100644
--- a/apps/tile/word.mu
+++ b/apps/tile/word.mu
@@ -225,3 +225,10 @@ fn emit-word _self: (addr word), out: (addr stream byte) {
   var data/eax: (addr gap-buffer) <- lookup *data-ah
   emit-gap-buffer data, out
 }
+
+fn word-to-string _self: (addr word), out: (addr handle array byte) {
+  var self/esi: (addr word) <- copy _self
+  var data-ah/eax: (addr handle gap-buffer) <- get self, scalar-data
+  var data/eax: (addr gap-buffer) <- lookup *data-ah
+  gap-buffer-to-string data, out
+}