From: chris.double Date: Fri, 6 Oct 2006 03:38:48 +0000 (+0000) Subject: parser-combinators: refactor X-Git-Tag: 0.85~77 X-Git-Url: https://gitweb.factorcode.org/gitweb.cgi?p=factor.git;a=commitdiff_plain;h=7a45882be224c4396397843761245da089937f35 parser-combinators: refactor --- diff --git a/contrib/parser-combinators/parser-combinators.factor b/contrib/parser-combinators/parser-combinators.factor index 9fe2a1d50e..916c1f3fa2 100644 --- a/contrib/parser-combinators/parser-combinators.factor +++ b/contrib/parser-combinators/parser-combinators.factor @@ -192,20 +192,12 @@ M: some-parser (parse) ( input parser -- result ) : <*> ( parser -- parser ) [ dup <*> <&:> { } succeed <|> ] promise-with ; -: (<+>) ( parser -- parser ) - #! Non-delayed implementation of <+> - dup <*> <&:> ; - : <+> ( parser -- parser ) #! Return a parser that accepts one or more occurences of the original #! parser. dup <*> <&:> ; -: () ( parser -- parser ) - #! Non-delayed implementation of - [ unit ] <@ f succeed <|> ; - : ( parser -- parser ) #! Return a parser that optionally uses the parser #! if that parser would be successfull. - [ () call ] curry ; + [ 1array ] <@ f succeed <|> ;