--- gforth/cross.fs 2001/03/17 21:36:41 1.95 +++ gforth/cross.fs 2001/06/16 22:53:36 1.99 @@ -808,7 +808,7 @@ ghost (next) ghost unloop ghost ;S 2drop ghost lit ghost (compile) ghost ! 2drop drop ghost (does>) ghost noop 2drop -ghost (.") ghost (S") ghost (ABORT") 2drop drop ( " ) +ghost (.") ghost (S") ghost (ABORT") 2drop drop ghost ' drop ghost :docol ghost :doesjump ghost :dodoes 2drop drop ghost :dovar ghost :dodefer ghost :dofield 2drop drop @@ -1579,8 +1579,7 @@ Variable to-doc to-doc on IF s" " doc-file-id write-line throw s" make-doc " doc-file-id write-file throw - - tlast @ >image count 1F and doc-file-id write-file throw + Last-Header-Ghost @ >ghostname doc-file-id write-file throw >in @ [char] ( parse 2drop [char] ) parse doc-file-id write-file throw @@ -1777,7 +1776,11 @@ Comment ( Comment \ ELSE postpone literal postpone gexecute THEN ; immediate +T has? peephole H [IF] : (cc) compile call T >body a, H ; ' (cc) IS colon, +[ELSE] + ' (prim) IS colon, +[THEN] : [G'] \G ticks a ghost and returns its address @@ -2043,7 +2046,7 @@ Cond: DOES> restrict? executed-ghost @ create-forward-warn IF ['] reswarn-forward IS resolve-warning THEN - Theader >r dup gdoes, + Theader >r dup , dup gdoes, \ stores execution semantic in the built word \ if the word already has a semantic (concerns S", IS, .", DOES>) \ then keep it @@ -2101,10 +2104,16 @@ Cond: DOES> restrict? postpone ; ( S addr xt ) over >exec ! ; immediate +T has? peephole H [IF] : compile: ( ghost -- ghost [xt] [colon-sys] ) :noname postpone g>body ; : ;compile ( ghost [xt] [colon-sys] -- ghost ) postpone ; over >comp ! ; immediate +[ELSE] +: compile: ( ghost -- ghost xt colon-sys ) :noname ; +: ;compile ( ghost xt colon-sys -- ghost ) + postpone ; drop ['] prim-resolved over >comp ! ; immediate +[THEN] : by ( -- ghost ) \ Name ghost >end @ ; @@ -2141,6 +2150,7 @@ Builder Variable [ELSE] Build: T 0 , H ; by Create +\ compile: alit, ;compile Builder Variable [THEN] @@ -2151,6 +2161,7 @@ Builder 2Variable [ELSE] Build: T 0 , 0 , H ; by Create +\ compile: alit, ;compile Builder 2Variable [THEN] @@ -2161,6 +2172,7 @@ Builder AVariable [ELSE] Build: T 0 A, H ; by Create +\ compile: alit, ;compile Builder AVariable [THEN] @@ -2392,9 +2404,9 @@ Cond: NEXT restrict? sys? next, ;Cond : ," [char] " parse T string, align H ; -Cond: ." restrict? compile (.") T ," H ;Cond ( " ) -Cond: S" restrict? compile (S") T ," H ;Cond ( " ) -Cond: ABORT" restrict? compile (ABORT") T ," H ;Cond ( " ) +Cond: ." restrict? compile (.") T ," H ;Cond +Cond: S" restrict? compile (S") T ," H ;Cond +Cond: ABORT" restrict? compile (ABORT") T ," H ;Cond Cond: IS T ' >body H compile ALiteral compile ! ;Cond : IS T >address ' >body ! H ; @@ -2686,6 +2698,10 @@ previous : .s .s ; : bye bye ; +\ dummy + +: group source >in ! drop ; + \ turnkey direction : H forth ; immediate : T minimal ; immediate