modern: the looping is tricky...this version is correct
parent
d8d7c0cd3c
commit
0e1eb52c4c
|
@ -218,9 +218,11 @@ ERROR: no-backslash-payload n string slice ;
|
||||||
] when ;
|
] when ;
|
||||||
|
|
||||||
! If the slice is 0 width, we stopped on whitespace.
|
! If the slice is 0 width, we stopped on whitespace.
|
||||||
! Advance the index and read again somewhere else!
|
! Advance the index and read again!
|
||||||
: read-token-or-whitespace ( n string slice -- n' string slice/f )
|
: read-token-or-whitespace ( n string slice -- n' string slice/f )
|
||||||
dup length 0 = [ [ 1 + ] 2dip ] when ;
|
dup length 0 = [
|
||||||
|
[ 1 + ] 2dip drop lex-factor
|
||||||
|
] when ;
|
||||||
|
|
||||||
ERROR: mismatched-terminator n string slice ;
|
ERROR: mismatched-terminator n string slice ;
|
||||||
: read-terminator ( n string slice -- n' string slice ) ;
|
: read-terminator ( n string slice -- n' string slice ) ;
|
||||||
|
|
Loading…
Reference in New Issue