From 188e80756b5f6f9fd582e94ac95dd1f8a418da0d Mon Sep 17 00:00:00 2001 From: mgcaret Date: Wed, 11 Nov 2020 15:42:55 -0800 Subject: [PATCH] properties fixes --- ofw/of/base.fs | 10 ++++++++++ ofw/of/node.fs | 4 ++++ ofw/of/property.fs | 13 +++++++++---- 3 files changed, 23 insertions(+), 4 deletions(-) diff --git a/ofw/of/base.fs b/ofw/of/base.fs index 5329d10..f99ce27 100644 --- a/ofw/of/base.fs +++ b/ofw/of/base.fs @@ -8,6 +8,15 @@ true value of-verbose? db" OF base" +\ OF816 constants, these should follow macros.include +binary +10000000 constant (f_immed) +01000000 constant (f_conly) +00100000 constant (f_prot) +00010000 constant (f_tempd) +00001000 constant (f_smudg) +hex + \ Reverse engineer the leading JSLs for these words : (function) ; @@ -24,6 +33,7 @@ alias (alias) (function) \ ALIAS will have 5C in the low byte, and we maybe need to fix that... \ in SLOF most of these are only used by the debug.fs \ except the ones needed to support instance values +\ so most of these should be removed since no plans to implement debug.fs ' (function) 1+ @ \ ( ) ' (function) 1+ /n + @ \ ( ... ) ' (defer) 1+ @ \ ( ... ) diff --git a/ofw/of/node.fs b/ofw/of/node.fs index 9b4db11..e1b09d6 100644 --- a/ofw/of/node.fs +++ b/ofw/of/node.fs @@ -319,6 +319,10 @@ defer find-node \ fixed for OF816 : (.print-alias) ( lfa -- ) + \ Don't print smudged alias + dup lfa>xt c@ (f_smudg) and IF + drop EXIT + THEN dup lfa>name \ Don't print name property 2dup s" name" string=ci IF 2drop drop diff --git a/ofw/of/property.fs b/ofw/of/property.fs index 4b84161..8252945 100644 --- a/ofw/of/property.fs +++ b/ofw/of/property.fs @@ -43,11 +43,12 @@ true value encode-first? \ >r @ r> ! EXIT THEN @ REPEAT 2drop ELSE r> drop THEN ; \ : prune ( name len -- ) last (prune) ; \ OF816: just smudge it, hopefully properties don't change that often -: prune ( name len -- ) context @ search-wordlist 0= if exit then - dup c@ 20 and if - drop \ protected +: prune ( name len -- ) + get-current search-wordlist 0= if ." no prune!" cr exit then + dup c@ (f_prot) (f_smudg) or and if + drop \ protected or smudged already else - dup c@ 8 or swap c! + dup c@ (f_smudg) or swap c! then ; @@ -136,6 +137,10 @@ true value encode-first? ; : .property ( lfa -- ) + \ Don't print smudged alias + dup lfa>xt c@ (f_smudg) and IF + drop EXIT + THEN dup cr indent @ 0 ?do space loop lfa>name 2dup type nip indent-prop swap -