Mirror of CollapseOS
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
646B

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