| ELSE |
ELSE |
| (word) |
(word) |
| THEN |
THEN |
| over start-lexeme |
2dup input-lexeme! |
| 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 |
| \G Parse @i{ccc}, delimited by @i{char}, in the parse |
\G Parse @i{ccc}, delimited by @i{char}, in the parse |
| \G area. @i{c-addr u} specifies the parsed string within the |
\G area. @i{c-addr u} specifies the parsed string within the |
| \G parse area. If the parse area was empty, @i{u} is 0. |
\G parse area. If the parse area was empty, @i{u} is 0. |
| >r source >in @ over min /string ( addr u ) |
>r source >in @ over min /string ( c-addr1 u1 ) |
| over start-lexeme |
|
| 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! ; |
| |
|
| \ 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) |
| over start-lexeme |
2dup input-lexeme! |
| 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 ; |
| : start-lexeme ( addr -- ) drop ; |
: 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 |
| max-errors /error * cells allot |
max-errors /error * cells allot |
| \ format of one cell: |
\ format of one cell: |
| \ source ( addr u ) |
\ source ( addr u ) |
| \ input-start-parse |
\ parse-start-offset |
| \ >in |
\ parse-end-offset |
| \ line-number |
\ line-number |
| \ Loadfilename ( addr u ) |
\ Loadfilename ( addr u ) |
| |
|
| |
|
| : input-error-data ( -- addr u start-parse >in line# [addr u] ) |
: input-error-data ( -- addr u start-parse >in line# [addr u] ) |
| \ error data for the current input, to be used by >error or .error-frame |
\ error data for the current input, to be used by >error or .error-frame |
| source input-start-parse @ error->in sourceline# |
source input-parse-start @ input-parse-end @ sourceline# |
| [ has? file [IF] ] sourcefilename [ [THEN] ] ; |
[ has? file [IF] ] sourcefilename [ [THEN] ] ; |
| |
|
| : dec. ( n -- ) \ gforth |
: dec. ( n -- ) \ gforth |