Merge commit 'erg/master'

release
Slava Pestov 2007-11-25 17:03:42 -05:00
commit 7925cf2266
2 changed files with 7 additions and 5 deletions

View File

@ -190,6 +190,10 @@ M: some-parser (parse) ( input parser -- result )
#! Same as <&> except flatten the result.
<&> [ dup second swap first [ , % ] { } make ] <@ ;
: <:&:> ( parser1 parser2 -- result )
#! Same as <&> except flatten the result.
<&> [ dup second swap first [ % % ] { } make ] <@ ;
LAZY: <*> ( parser -- parser )
dup <*> <&:> { } succeed <|> ;
@ -263,4 +267,4 @@ LAZY: <(+)> ( parser -- parser )
nonempty-list-of { } succeed <|> ;
LAZY: surrounded-by ( parser start end -- parser' )
[ token ] 2apply swapd pack ;
[ token ] 2apply swapd pack ;

View File

@ -1,6 +1,6 @@
USING: combinators kernel lazy-lists math math.parser
namespaces parser parser-combinators promises sequences
strings ;
namespaces parser parser-combinators parser-combinators.simple
promises sequences strings ;
USING: continuations io prettyprint ;
IN: regexp
@ -17,8 +17,6 @@ IN: regexp
: 'string' 'char' <+> [ >string token ] <@ ;
: 'integer' [ digit? ] satisfy <+> [ string>number ] <@ ;
: exactly-n ( parser n -- parser' )
swap <repetition> and-parser construct-boa ;