]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/peg/parsers/parsers.factor
Delete empty unit tests files, remove 1- and 1+, reorder IN: lines in a lot of places...
[factor.git] / basis / peg / parsers / parsers.factor
index 7434ca6a7a21873c4bd13ee01736edb2108ce0a2..850b585190646384904f7ec17f1785f7c593dc61 100644 (file)
@@ -7,16 +7,16 @@ IN: peg.parsers
 
 TUPLE: just-parser p1 ;
 
-: just-pattern
+CONSTANT: just-pattern
   [
-    execute dup [
+    dup [
       dup remaining>> empty? [ drop f ] unless
     ] when
-  ] ;
+  ]
 
 
 M: just-parser (compile) ( parser -- quot )
-  p1>> compile-parser just-pattern curry ;
+  p1>> compile-parser-quot just-pattern compose ;
 
 : just ( parser -- parser )
   just-parser boa wrap-peg ;
@@ -51,8 +51,7 @@ PRIVATE>
   dup zero? [
     2drop epsilon
   ] [
-    2dup exactly-n
-    -rot 1- at-most-n 2choice
+    [ exactly-n ] [ 1 - at-most-n ] 2bi 2choice
   ] if ;
 
 : at-least-n ( parser n -- parser' )