mirror of
https://github.com/hsoft/collapseos.git
synced 2024-12-28 07:58:06 +11:00
forth: Forth-ify "(parse)"
This commit is contained in:
parent
941224be94
commit
edcd80e3a6
Binary file not shown.
@ -1123,23 +1123,7 @@ PARSED:
|
||||
jp next
|
||||
|
||||
|
||||
.db "(parse)"
|
||||
.dw $-PARSED
|
||||
.db 7
|
||||
PARSE:
|
||||
.dw compiledWord
|
||||
.dw PARSED
|
||||
.dw CSKIP
|
||||
.dw .error
|
||||
; success, stack is already good, we can exit
|
||||
.dw EXIT
|
||||
|
||||
.error:
|
||||
.dw compiledWord
|
||||
.dw LIT
|
||||
.db "unknown word", 0
|
||||
.dw PRINT
|
||||
.dw ABORT
|
||||
.fill 41
|
||||
|
||||
|
||||
; Indirect parse caller. Reads PARSEPTR and calls
|
||||
@ -1154,7 +1138,7 @@ PARSEI:
|
||||
; Spit name (in (HL)) + prev in (HERE) and adjust (HERE) and (CURRENT)
|
||||
; HL points to new (HERE)
|
||||
.db "(entry)"
|
||||
.dw $-PARSE
|
||||
.dw $-PARSED
|
||||
.db 7
|
||||
ENTRYHEAD:
|
||||
.dw compiledWord
|
||||
|
@ -55,6 +55,12 @@
|
||||
AGAIN
|
||||
;
|
||||
|
||||
( This is only the "early parser" in earlier stages. No need
|
||||
for an abort message )
|
||||
: (parse)
|
||||
(parsed) SKIP? ABORT
|
||||
;
|
||||
|
||||
( ; has to be defined last because it can't be executed now )
|
||||
: X ( can't have its real name now )
|
||||
['] EXIT ,
|
||||
|
Loading…
Reference in New Issue
Block a user