skip ( i seq ? -- n )


Vocabulary
lexer

Inputs and outputs
ia starting index
seqa sequence
?a boolean
nan integer


Word description
Skips to the first space character (if boolean is f) or the first non-space character (otherwise). Tabulations used as separators instead of spaces will be flagged as an error.

Definition
USING: kernel sequences ;

IN: lexer

: skip ( i seq ? -- n )
over length
[ [ swap forbid-tab 32 eq? xor ] curry find-from drop ] dip
or ;