| ELSE |
ELSE |
| (word) |
(word) |
| THEN |
THEN |
| |
[ has? new-input [IF] ] |
| 2dup input-lexeme! |
2dup input-lexeme! |
| |
[ [THEN] ] |
| 2dup + r> - 1+ r> min >in ! ; |
2dup + r> - 1+ r> min >in ! ; |
| |
|
| : word ( char "<chars>ccc<char>-- c-addr ) \ core |
: word ( char "<chars>ccc<char>-- c-addr ) \ core |
| >r source >in @ over min /string ( c-addr1 u1 ) |
>r source >in @ over min /string ( c-addr1 u1 ) |
| over swap r> scan >r |
over swap r> scan >r |
| over - dup r> IF 1+ THEN >in +! |
over - dup r> IF 1+ THEN >in +! |
| 2dup input-lexeme! ; |
[ has? new-input [IF] ] |
| |
2dup input-lexeme! |
| |
[ [THEN] ] ; |
| |
|
| \ name 13feb93py |
\ name 13feb93py |
| |
|
| |
|
| : (name) ( -- c-addr count ) \ gforth |
: (name) ( -- c-addr count ) \ gforth |
| source 2dup >r >r >in @ /string (parse-white) |
source 2dup >r >r >in @ /string (parse-white) |
| |
[ has? new-input [IF] ] |
| 2dup input-lexeme! |
2dup input-lexeme! |
| |
[ [THEN] ] |
| 2dup + r> - 1+ r> min >in ! ; |
2dup + r> - 1+ r> min >in ! ; |
| \ name count ; |
\ name count ; |
| [THEN] |
[THEN] |
| |
|
| has? new-input 0= [IF] |
has? new-input 0= [IF] |
| : input-start-line ( -- ) >in off ; |
: input-start-line ( -- ) >in off ; |
| : input-lexeme! ( c-addr n -- ) 2drop ; |
|
| : refill ( -- flag ) \ core-ext,block-ext,file-ext |
: refill ( -- flag ) \ core-ext,block-ext,file-ext |
| \G Attempt to fill the input buffer from the input source. When |
\G Attempt to fill the input buffer from the input source. When |
| \G the input source is the user input device, attempt to receive |
\G the input source is the user input device, attempt to receive |
| \G and return true; otherwise, return false. A successful result |
\G and return true; otherwise, return false. A successful result |
| \G includes receipt of a line containing 0 characters. |
\G includes receipt of a line containing 0 characters. |
| [ has? file [IF] ] |
[ has? file [IF] ] |
| blk @ IF 1 blk +! true input-start-line EXIT THEN |
blk @ IF 1 blk +! true EXIT THEN |
| [ [THEN] ] |
[ [THEN] ] |
| tib /line |
tib /line |
| [ has? file [IF] ] |
[ has? file [IF] ] |
| THEN |
THEN |
| 1 loadline +! |
1 loadline +! |
| [ [THEN] ] |
[ [THEN] ] |
| swap #tib ! input-start-line ; |
swap #tib ! |
| |
input-start-line ; |
| |
|
| : query ( -- ) \ core-ext |
: query ( -- ) \ core-ext |
| \G Make the user input device the input source. Receive input into |
\G Make the user input device the input source. Receive input into |
| sp@ $10 cells + |
sp@ $10 cells + |
| [ [THEN] ] |
[ [THEN] ] |
| [ [THEN] ] |
[ [THEN] ] |
| dup >tib ! tibstack ! #tib off input-start-line ; |
dup >tib ! tibstack ! #tib off |
| |
input-start-line ; |
| [THEN] |
[THEN] |
| |
|
| : boot ( path n **argv argc -- ) |
: boot ( path n **argv argc -- ) |