Added eval.
This commit is contained in:
@ -178,7 +178,11 @@ create input-buffer input-limit allot
|
|||||||
|
|
||||||
( REPL )
|
( REPL )
|
||||||
: prompt ." ok" cr ;
|
: prompt ." ok" cr ;
|
||||||
: eval-line begin >in @ #tib @ < while eval1 repeat ;
|
: eval-buffer begin >in @ #tib @ < while eval1 repeat ;
|
||||||
: query begin ['] eval-line catch if ." ERROR" cr then prompt refill drop again ;
|
: eval ( a n -- ) 'tib @ >r #tib @ >r >in @ >r
|
||||||
|
#tib ! 'tib ! 0 >in ! eval-buffer
|
||||||
|
r> >in ! r> #tib ! r> 'tib ! ;
|
||||||
|
: query begin ['] eval-buffer catch
|
||||||
|
if ." ERROR" cr then prompt refill drop again ;
|
||||||
: ok ." uEForth" cr prompt refill drop query ;
|
: ok ." uEForth" cr prompt refill drop query ;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user