From 6a3c1d96b42a5047fc21b03f4e260b4691b61a80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Remko=20Tron=C3=A7on?= Date: Fri, 8 Mar 2019 22:05:34 +0100 Subject: [PATCH] Export state symbols --- src/waforth.wat | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/waforth.wat b/src/waforth.wat index fcf4aa3..a3aa871 100644 --- a/src/waforth.wat +++ b/src/waforth.wat @@ -815,7 +815,7 @@ (!def_word "FIND" "$find") ;; 6.1.1650 - (func $here + (func $here (export "HERE") (i32.store (get_global $tos) (get_global $here)) (set_global $tos (i32.add (get_global $tos) (i32.const 4)))) (!def_word "HERE" "$here") @@ -1907,6 +1907,11 @@ EOF (call $shell_emit (i32.const 10)) (get_local $result)) + ;; Used for experiments + (func (export "set_state") (param $latest i32) (param $here i32) + (set_global $latest (get_local $latest)) + (set_global $here (get_local $here))) + (table (export "table") !tableStartIndex anyfunc) (global $latest (mut i32) (i32.const !dictionaryLatest)) (global $here (mut i32) (i32.const !dictionaryTop))