]> gitweb.factorcode.org Git - factor.git/commitdiff
add polymorphic effects for lexer:each-token, map-tokens
authorJoe Groff <arcata@gmail.com>
Tue, 9 Mar 2010 02:55:46 +0000 (18:55 -0800)
committerJoe Groff <arcata@gmail.com>
Tue, 9 Mar 2010 02:55:46 +0000 (18:55 -0800)
core/lexer/lexer.factor

index e03cae74db80444f77ee4ae5b1d9398eb43d56f6..7f6324c251c8853b9db16e4066db490cb2ac9050 100644 (file)
@@ -100,10 +100,10 @@ PREDICATE: unexpected-eof < unexpected
 : (each-token) ( end quot -- pred quot )
     [ [ [ scan dup ] ] dip [ = not ] curry [ [ f ] if* ] curry compose ] dip ; inline
 
-: each-token ( end quot -- )
+: each-token ( ... end quot: ( ... token -- ... ) -- ... )
     (each-token) while drop ; inline
 
-: map-tokens ( end quot -- seq )
+: map-tokens ( ... end quot: ( ... token -- ... elt ) -- ... seq )
     (each-token) produce nip ; inline
 
 : parse-tokens ( end -- seq )