From d0b93e0722cf7eb21d970f0b51c8bae2e45755db Mon Sep 17 00:00:00 2001 From: Mark Cave-Ayland Date: Sat, 20 Feb 2016 13:22:17 +0000 Subject: ciface.fs: implement optional (exit) hook when returning control back to the interpreter This allows us to optionally intercept and execute code before returning back to the Forth interactive console. Signed-off-by: Mark Cave-Ayland git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@1383 f158a5a8-5612-0410-a976-696ce0be7e32 --- forth/system/ciface.fs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/forth/system/ciface.fs b/forth/system/ciface.fs index fd6c54e..85a6076 100644 --- a/forth/system/ciface.fs +++ b/forth/system/ciface.fs @@ -326,6 +326,14 @@ external : exit ( -- ) ." EXIT" + + \ Execute (exit) hook if one exists + s" (exit)" $find if + execute + else + 2drop + then + outer-interpreter ; -- cgit v1.1