--- gforth/cross.fs 2007/12/31 18:40:23 1.166 +++ gforth/cross.fs 2010/04/18 06:18:36 1.170 @@ -1,7 +1,7 @@ \ CROSS.FS The Cross-Compiler 06oct92py \ Idea and implementation: Bernd Paysan (py) -\ Copyright (C) 1995,1996,1997,1998,1999,2000,2003,2004,2005,2006,2007 Free Software Foundation, Inc. +\ Copyright (C) 1995,1996,1997,1998,1999,2000,2003,2004,2005,2006,2007,2009 Free Software Foundation, Inc. \ This file is part of Gforth. @@ -191,7 +191,7 @@ Create bases 10 , 2 , A , 100 , 1+ THEN ; -: number? ( string -- string 0 / n -1 / d 0> ) +: (number?) ( string -- string 0 / n -1 / d 0> ) dup >r count snumber? dup if rdrop else @@ -199,13 +199,15 @@ Create bases 10 , 2 , A , 100 , then ; : number ( string -- d ) - number? ?dup 0= abort" ?" 0< + (number?) ?dup 0= abort" ?" 0< IF s>d THEN ; [THEN] +[IFUNDEF] (number?) : (number?) number? ; [THEN] + \ this provides assert( and struct stuff \GFORTH [IFUNDEF] assert1( \GFORTH also forth definitions require assert.fs previous @@ -1726,7 +1728,7 @@ Ghost (do) Ghost (?do) Ghost (for) drop Ghost (loop) Ghost (+loop) 2drop Ghost (next) drop -Ghost (does>) Ghost (does>1) Ghost (does>2) 2drop drop +Ghost !does drop Ghost compile, drop Ghost (.") Ghost (S") Ghost (ABORT") 2drop drop Ghost (C") Ghost c(abort") Ghost type 2drop drop @@ -2410,7 +2412,7 @@ T 2 cells H Value xt>body there xt>body + ca>native T a, H 1 fillcfa ; ' (doprim,) plugin-of doprim, : (doeshandler,) ( -- ) - T cfalign H [G'] :doesjump addr, T 0 , H ; ' (doeshandler,) plugin-of doeshandler, + T cfalign H ; ' (doeshandler,) plugin-of doeshandler, : (dodoes,) ( does-action-ghost -- ) ]comp [G'] :dodoes addr, comp[ @@ -2535,7 +2537,7 @@ Cond: MAXI IF nip execute-exec-compile ELSE gexecute THEN EXIT THEN - number? dup + (number?) dup IF 0> IF swap lit, THEN lit, discard ELSE 2drop restore-input throw Ghost gexecute THEN ; @@ -2650,7 +2652,7 @@ T has? primcentric H [IF] >TARGET Cond: DOES> T here H [ T has? primcentric H [IF] ] 5 [ [ELSE] ] 4 [ [THEN] ] T cells - H + alit, compile (does>2) compile ;s + H + alit, compile !does compile ;s doeshandler, resolve-does>-part ;Cond @@ -2947,6 +2949,11 @@ by (Field) T 1 cells H dup ; >CROSS +\ ABI-CODE support +Builder (ABI-CODE) +Build: ;Build +by: :doabicode noop ;DO + \ Input-Methods 01py Builder input-method