Skip to content

Commit

Permalink
GH-13 Fix ' and ['] so they throw -13 for undefined word.
Browse files Browse the repository at this point in the history
  • Loading branch information
SirWumpus committed Aug 7, 2024
1 parent 6858dc8 commit 5f5bec8
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/post4.p4
Original file line number Diff line number Diff line change
Expand Up @@ -708,6 +708,14 @@ DEFER _fsp!
['] COMPILE, COMPILE,
; IMMEDIATE compile-only

\ ( -- xt )
\ Redefine now that we can THROW for an undefined word.
: ' ' DUP 0= -13 AND THROW ;

\ (C: <spaces>name -- ) (S: -- xt )
\ Redefine now that ' can THROW on undefined word.
: ['] LIT [ ' LIT COMPILE, ] COMPILE, ' COMPILE, ; IMMEDIATE compile-only

\ ... [CHAR] ...
\
\ (C: <spaces>name -- ) \ (S: -- char )
Expand Down

0 comments on commit 5f5bec8

Please sign in to comment.