\ 2012-04-06 fsm1.fs include tempbuffer.fs \ reset append show variable prev.minus? variable prev.dpoint? : digit? [char] 0 [char] 9 within ; : dpoint? [char] . = ; : minus? [char] - = ; : first.minus? minus? prev.minus? @ not and ; : first.dpoint? dpoint? prev.dpoint? @ not and ; : false true not ; : legal? ( c -- f ) dup digit? if drop true dup prev.minus? ! else dup first.minus? if drop true dup prev.minus? ! else first.dpoint? if true dup prev.dpoint? ! else false then then then ; : getafix reset false prev.minus? ! false prev.dpoint? ! begin key dup emit dup $0D <> \ exit on CR == &13 == $0D while dup legal? if append else drop then repeat drop \ CR cr show cr ;