about summary refs log tree commit diff stats
path: root/apps/tile/word.mu
diff options
context:
space:
mode:
Diffstat (limited to 'apps/tile/word.mu')
-rw-r--r--apps/tile/word.mu6
1 files changed, 6 insertions, 0 deletions
diff --git a/apps/tile/word.mu b/apps/tile/word.mu
index 72a55733..e1c5e22d 100644
--- a/apps/tile/word.mu
+++ b/apps/tile/word.mu
@@ -56,6 +56,12 @@ fn word-equal? _self: (addr word), s: (addr array byte) -> result/eax: boolean {
   result <- gap-buffer-equal? data, s
 }
 
+fn word-length _self: (addr word) -> result/eax: int {
+  var self/esi: (addr word) <- copy _self
+  var data/eax: (addr gap-buffer) <- get self, data
+  result <- gap-buffer-length data
+}
+
 fn first-word _self: (addr word) -> result/eax: (addr word) {
   var self/esi: (addr word) <- copy _self
   var out/edi: (addr word) <- copy self