[ parsed>> ] dip
[ parsed>> 2array ] keep
unparsed>> <parse-result>
- ] with lazy-map
- ] with lazy-map lconcat ;
+ ] with lmap-lazy
+ ] with lmap-lazy lconcat ;
M: and-parser parse ( input parser -- list )
! Parse 'input' by sequentially combining the
! of parser1 and parser2 being applied to the same
! input. This implements the choice parsing operator.
parsers>> sequence>list
- [ parse ] with lazy-map lconcat ;
+ [ parse ] with lmap-lazy lconcat ;
: trim-head-slice ( string -- string )
! Return a new string without any leading whitespace
-rot parse [
[ parsed>> swap call ] keep
unparsed>> <parse-result>
- ] with lazy-map ;
+ ] with lmap-lazy ;
TUPLE: some-parser p1 ;