fix multi-line ( … ) comments in included files
This commit is contained in:
parent
ff2d91b66b
commit
676ec83cb9
13
startup.4th
13
startup.4th
|
|
@ -1221,6 +1221,10 @@ CREATE EXCEPTION-STACK NULL ,
|
|||
|
||||
: PARSE-AREA ( -- c-addr u ) SOURCE >IN @ /STRING ;
|
||||
|
||||
\ Placeholder to be replaced before switching to terminal input
|
||||
DEFER REFILL
|
||||
' FALSE ' REFILL DEFER!
|
||||
|
||||
' UTILITY (DEFINITIONS)
|
||||
|
||||
: PARSE-EMPTY? ( -- flag ) SOURCE NIP >IN @ = ;
|
||||
|
|
@ -1235,17 +1239,16 @@ CREATE EXCEPTION-STACK NULL ,
|
|||
: SKIP-SPACES ( "<spaces?>" -- )
|
||||
BEGIN ▪ PARSE-EMPTY? 0= WHILE ▪ PEEK-CHAR SPACE? WHILE ▪ SKIP-CHAR ▪ REPEAT ;
|
||||
|
||||
: ENSURE-NONEMPTY ( -- f=eof )
|
||||
BEGIN PARSE-EMPTY? ?0DUP WHILE REFILL 0= ?DUP UNTIL 0= ;
|
||||
|
||||
' FORTH (DEFINITIONS)
|
||||
|
||||
\ Comments; ignore all characters until the next EOL or ) character, respectively
|
||||
: \ ( "ccc<eol>" -- ) IMMEDIATE
|
||||
BEGIN PARSE-EMPTY? 0= WHILE NEXT-CHAR LF = UNTIL ;
|
||||
: ( ( "ccc<closeparen>" -- ) IMMEDIATE
|
||||
BEGIN PARSE-EMPTY? 0= WHILE NEXT-CHAR [[ CHAR ) ]] = UNTIL ;
|
||||
|
||||
\ Placeholder to be replaced before switching to terminal input
|
||||
DEFER REFILL
|
||||
' FALSE ' REFILL DEFER!
|
||||
BEGIN ENSURE-NONEMPTY WHILE NEXT-CHAR [[ CHAR ) ]] = UNTIL ;
|
||||
|
||||
\ Skip whitespace; read and return the next word delimited by whitespace
|
||||
\ The delimiting whitespace character is left in the parse area
|
||||
|
|
|
|||
Loading…
Reference in New Issue