]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/peg/peg.factor
basis: use lint.vocabs tool to trim using lists
[factor.git] / basis / peg / peg.factor
index 5f644b5e914266ecd42e9481ffef7cb3218adeb0..eb8dd16b33173ab609f98242748e945a7ed0e5fd 100644 (file)
@@ -3,9 +3,8 @@
 
 USING: accessors arrays assocs classes combinators
 combinators.short-circuit compiler.units effects.parser fry
-generalizations kernel locals make math math.order namespaces
-quotations sequences sets splitting unicode vectors
-vocabs.loader words ;
+kernel make math math.order namespaces quotations sequences
+sets splitting unicode vectors vocabs.loader words ;
 
 IN: peg
 
@@ -266,7 +265,7 @@ GENERIC: (compile) ( peg -- quot )
     pos get apply-rule process-parser-result ;
 
 : preset-parser-word ( parser -- word parser )
-    gensym swap over >>compiled ;
+    gensym tuck >>compiled ;
 
 : define-parser-word ( word parser -- )
     ! Return the body of the word that is the compiled version
@@ -461,7 +460,7 @@ M: ensure-not-parser (compile)
 TUPLE: action-parser parser quot ;
 
 : check-action ( result quot -- result )
-    dupd '[ _ change-ast ] when ; inline
+    dupd '[ [ _ call( ast -- ast ) ] change-ast ] when ;
 
 M: action-parser (compile)
     [ parser>> compile-parser-quot ] [ quot>> ] bi