]> gitweb.factorcode.org Git - factor.git/commitdiff
parser-combinators: added <!?>
authorchris.double <chris.double@double.co.nz>
Fri, 15 Dec 2006 12:51:38 +0000 (12:51 +0000)
committerchris.double <chris.double@double.co.nz>
Fri, 15 Dec 2006 12:51:38 +0000 (12:51 +0000)
libs/parser-combinators/parser-combinators.factor

index 39ba92807cd8c33180bb63a4e1c6334497773ff0..82af77c9c4d9e7bdd0130a0ace1a47a4325663a3 100644 (file)
@@ -221,3 +221,11 @@ LAZY: <!+> ( parser -- parser )
   #! usually the effect you want and cuts down on backtracking
   #! required.
   <+> only-first ;
+
+LAZY: <!?> ( parser -- parser )
+  #! Like <?> but only return one possible result
+  #! containing all matching parses. Does not return
+  #! partial matches. Useful for efficiency since that's
+  #! usually the effect you want and cuts down on backtracking
+  #! required.
+  <?> only-first ;