]> gitweb.factorcode.org Git - factor.git/commitdiff
parser-combinators: refactor <?>
authorchris.double <chris.double@double.co.nz>
Fri, 6 Oct 2006 03:38:48 +0000 (03:38 +0000)
committerchris.double <chris.double@double.co.nz>
Fri, 6 Oct 2006 03:38:48 +0000 (03:38 +0000)
contrib/parser-combinators/parser-combinators.factor

index 9fe2a1d50ea5f354e986c65fd37899038593f2ac..916c1f3fa2c89482e51553cab269e08308a44007 100644 (file)
@@ -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 <|> ;