! 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
-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
: 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 -- )