diff options
author | Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> | 2016-02-20 13:22:17 +0000 |
---|---|---|
committer | Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> | 2016-02-20 13:22:17 +0000 |
commit | d0b93e0722cf7eb21d970f0b51c8bae2e45755db (patch) | |
tree | b30da6ee1b6143213bed1c2e7f592ca499930015 /forth/system | |
parent | 09c184269592e04cfab026c46c019aad0cbaf7fc (diff) | |
download | openbios-d0b93e0722cf7eb21d970f0b51c8bae2e45755db.zip openbios-d0b93e0722cf7eb21d970f0b51c8bae2e45755db.tar.gz openbios-d0b93e0722cf7eb21d970f0b51c8bae2e45755db.tar.bz2 |
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 <mark.cave-ayland@ilande.co.uk>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@1383 f158a5a8-5612-0410-a976-696ce0be7e32
Diffstat (limited to 'forth/system')
-rw-r--r-- | forth/system/ciface.fs | 8 |
1 files changed, 8 insertions, 0 deletions
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 ; |