mirror of
https://github.com/hsoft/collapseos.git
synced 2024-12-25 18:18:06 +11:00
15 lines
644 B
Plaintext
15 lines
644 B
Plaintext
(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.
|