1 \ tag: Forth preprocessor
5 \ Copyright (C) 2003, 2004 Samuel Rydh
7 \ See the file "COPYING" for further information about
8 \ the copyright and warranty status of this work.
17 begin parse-word dup 0= while
21 2dup " [IF]" strcmp 0= if 1 throw then
22 2dup " [IFDEF]" strcmp 0= if 1 throw then
23 2dup " [ELSE]" strcmp 0= if 2 throw then
24 2dup " [THEN]" strcmp 0= if 3 throw then
25 " \\" strcmp 0= if linefeed parse 2drop then
33 \ EOF (FIXME: this does not work)
34 \ -1 of ." Missing [THEN]" abort exit endof
38 2 of dup 1 = if 1- then endof
46 : [ELSE] 0 [ ['] [IF] , ] ; immediate
54 : [IFDEF] ( <word> -- )
56 parse-word prep-wid search-wordlist dup if nip then
61 : [DEFINE] ( <word> -- )
62 parse-word here get-current >r >r
69 prep-wid set-current prep-here here!
72 r> r> set-current here!