mirror of
https://github.com/hsoft/collapseos.git
synced 2024-11-27 12:38:05 +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
|
jp next
|
||||||
|
|
||||||
|
|
||||||
.db "(parse)"
|
.fill 41
|
||||||
.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
|
|
||||||
|
|
||||||
|
|
||||||
; Indirect parse caller. Reads PARSEPTR and calls
|
; Indirect parse caller. Reads PARSEPTR and calls
|
||||||
@ -1154,7 +1138,7 @@ PARSEI:
|
|||||||
; Spit name (in (HL)) + prev in (HERE) and adjust (HERE) and (CURRENT)
|
; Spit name (in (HL)) + prev in (HERE) and adjust (HERE) and (CURRENT)
|
||||||
; HL points to new (HERE)
|
; HL points to new (HERE)
|
||||||
.db "(entry)"
|
.db "(entry)"
|
||||||
.dw $-PARSE
|
.dw $-PARSED
|
||||||
.db 7
|
.db 7
|
||||||
ENTRYHEAD:
|
ENTRYHEAD:
|
||||||
.dw compiledWord
|
.dw compiledWord
|
||||||
|
@ -55,6 +55,12 @@
|
|||||||
AGAIN
|
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 )
|
( ; has to be defined last because it can't be executed now )
|
||||||
: X ( can't have its real name now )
|
: X ( can't have its real name now )
|
||||||
['] EXIT ,
|
['] EXIT ,
|
||||||
|
Loading…
Reference in New Issue
Block a user