diff options
author | dcs <dcs@FreeBSD.org> | 2000-06-12 16:42:02 +0000 |
---|---|---|
committer | dcs <dcs@FreeBSD.org> | 2000-06-12 16:42:02 +0000 |
commit | 87575284dc9c996dac91245e7d6f022c70ac4e04 (patch) | |
tree | 3fc26e3652bb4acdae345fb1e31806a1c96074b2 /sys/boot | |
parent | 0e4edb9eadb9b3bbf651fa65c1f97a00b6e189f2 (diff) | |
download | FreeBSD-src-87575284dc9c996dac91245e7d6f022c70ac4e04.zip FreeBSD-src-87575284dc9c996dac91245e7d6f022c70ac4e04.tar.gz |
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.
Diffstat (limited to 'sys/boot')
-rw-r--r-- | sys/boot/ficl/softwords/softcore.fr | 35 |
1 files changed, 24 insertions, 11 deletions
diff --git a/sys/boot/ficl/softwords/softcore.fr b/sys/boot/ficl/softwords/softcore.fr index b32ed3e..fa4149a 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, , ; |