1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-12-28 11:08:06 +11:00
collapseos/blk/009

17 lines
646 B
Plaintext
Raw Normal View History

(cont.) What if we could implement those parsing routines in
Forth? "But it's a core routine!" you say. Yes, but here's the
deal: at its native core, only decimal parsing is supported. It
lives in the "(parsed)" word. The interpreter's main loop is
initially set to simply call that word.
However, in core.fs, "(parsex)", "(parsec)" and "(parseb)" are
implemented, in Forth, then "(parse)", which goes through them
all is defined. Then, "(parsef)", which is the variable in
which the interpreter's word pointer is set, is updated to that
new "(parse)" word.
This way, we have a full-featured (and extensible) parsing with
a tiny native core.