From 87575284dc9c996dac91245e7d6f022c70ac4e04 Mon Sep 17 00:00:00 2001 From: dcs Date: Mon, 12 Jun 2000 16:42:02 +0000 Subject: [PATCH] Make abort" functional in interpret mode. This behavior is undefined by ANS Forth standard, but it's useful. Also, define the constant true in a more strict way. C might garantee 2-complement math, but Forth doesn't. --- sys/boot/ficl/softwords/softcore.fr | 35 ++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/sys/boot/ficl/softwords/softcore.fr b/sys/boot/ficl/softwords/softcore.fr index b32ed3e1cf42..fa4149af4459 100644 --- a/sys/boot/ficl/softwords/softcore.fr +++ b/sys/boot/ficl/softwords/softcore.fr @@ -31,20 +31,33 @@ decimal 32 constant bl : spaces ( n -- ) 0 ?do space loop ; -: abort" - postpone if - postpone ." - postpone cr - -2 - postpone literal - postpone throw - postpone endif -; immediate +: abort" + state @ if + postpone if + [char] " parse + postpone sliteral + postpone type + postpone cr + -2 + postpone literal + postpone throw + postpone endif + else + [char] " parse + rot if + type + cr + -2 throw + else + 2drop + then + then +; immediate \ ** CORE EXT -0 constant false --1 constant true +0 constant false +false invert constant true : <> = 0= ; : 0<> 0= 0= ; : compile, , ;