[SLOF] [PATCH slof v5 2/6] node: Add some documentation
Alexey Kardashevskiy
aik at ozlabs.ru
Mon Oct 16 16:16:49 AEDT 2017
This adds some internal structure commented definitions so they won't
break things now and grep can find them.
Signed-off-by: Alexey Kardashevskiy <aik at ozlabs.ru>
---
slof/fs/base.fs | 16 ++++++++++++++++
slof/fs/node.fs | 2 +-
2 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/slof/fs/base.fs b/slof/fs/base.fs
index edd474e..e92621f 100644
--- a/slof/fs/base.fs
+++ b/slof/fs/base.fs
@@ -13,6 +13,22 @@
\ Hash for faster lookup
#include <find-hash.fs>
+\ WARNING: the wid>xxx and name>xxx definitions below are for the documentation
+\ purposes only; NAME>LINK LINK> NAME> should be used instead; no code outside
+\ of the engine has any business accessing flags, count, chars directly.
+
+\ STRUCT
+\ cell FIELD wid>next
+\ cell FIELD wid>names \ the head of the list of name records, points to name>next
+\ END-STRUCT
+
+\ STRUCT
+\ cell FIELD name>next
+\ /c FIELD name>flags
+\ /c FIELD name>count
+\ 0 FIELD name>chars
+\ END-STRUCT
+
: >name ( xt -- nfa ) \ note: still has the "immediate" field!
BEGIN char- dup c@ UNTIL ( @lastchar )
dup dup aligned - cell+ char- ( @lastchar lenmodcell )
diff --git a/slof/fs/node.fs b/slof/fs/node.fs
index 3b079e4..add5760 100644
--- a/slof/fs/node.fs
+++ b/slof/fs/node.fs
@@ -23,7 +23,7 @@ STRUCT
cell FIELD node>peer
cell FIELD node>parent
cell FIELD node>child
- cell FIELD node>properties
+ cell FIELD node>properties \ points to wid>next
cell FIELD node>words
cell FIELD node>instance-template
cell FIELD node>instance-size
--
2.11.0
More information about the SLOF
mailing list