lexer: change skip back to public interface.
parent
9a989f8e9d
commit
8afe2dfe37
|
@ -2,9 +2,8 @@
|
|||
! Copyright (C) 2006, 2010 Slava Pestov
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: accessors combinators compiler.units html.templates io
|
||||
io.encodings.utf8 io.files kernel lexer lexer.private math
|
||||
namespaces parser parser.notes quotations sequences splitting
|
||||
vocabs.parser ;
|
||||
io.encodings.utf8 io.files kernel lexer math namespaces parser
|
||||
parser.notes quotations sequences splitting vocabs.parser ;
|
||||
IN: html.templates.fhtml
|
||||
|
||||
! We use a custom lexer so that %> ends a token even if not
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
USING: help.markup help.syntax kernel lexer.private math
|
||||
sequences strings words quotations ;
|
||||
USING: help.markup help.syntax kernel math sequences strings
|
||||
words quotations ;
|
||||
IN: lexer
|
||||
|
||||
HELP: lexer
|
||||
|
|
|
@ -52,18 +52,14 @@ ERROR: unexpected want got ;
|
|||
: forbid-tab ( c -- c )
|
||||
[ CHAR: \t eq? [ "[space]" "[tab]" unexpected ] when ] keep ; inline
|
||||
|
||||
<PRIVATE
|
||||
|
||||
: skip ( i seq ? -- n )
|
||||
{ fixnum string boolean } declare
|
||||
over length [
|
||||
[ swap forbid-tab CHAR: \s eq? xor ] curry find-from drop
|
||||
] dip or ;
|
||||
|
||||
PRIVATE>
|
||||
] dip or ; inline
|
||||
|
||||
: change-lexer-column ( lexer quot -- )
|
||||
[ [ column>> ] [ line-text>> ] bi ] prepose keep column<< ; inline
|
||||
[ check-lexer [ column>> ] [ line-text>> ] bi ] prepose
|
||||
keep column<< ; inline
|
||||
|
||||
GENERIC: skip-blank ( lexer -- )
|
||||
|
||||
|
|
Loading…
Reference in New Issue