skip-word ( lexer -- )
The lexer
Prev:skip-blank ( lexer -- )
Next:with-lexer ( lexer quot -- newquot )


Vocabulary
lexer

Inputs and outputs
lexera lexer


Generic word contract
Skips until the end of the current token.

The default implementation treats a single " as a word by itself; otherwise it searches forward until a whitespace character or the end of the line.

Notes
Custom lexers can implement this generic word.

Definition
IN: lexer

GENERIC: skip-word ( lexer -- )


Methods
USING: combinators kernel lexer lexer.private math ;

M: lexer skip-word
[
{
{ [ 2dup quote? ] [ drop 1 + ] }
{ [ 2dup shebang? ] [ drop 2 + ] }
[ f skip ]
} cond
] change-lexer-column ;


USING: combinators html.templates.fhtml kernel lexer math
sequences ;

M: template-lexer skip-word
[
{
{ [ 2dup nth 34 = ] [ drop 1 + ] }
{
[ 2dup swap tail-slice "%>" head? ]
[ drop 2 + ]
}
[ f skip ]
} cond
] change-lexer-column ;