Use cleave instead of get-slots in peg

db4
Chris Double 2008-03-26 16:21:33 +13:00
parent 1ec945ba4c
commit de3e4e049f
1 changed files with 2 additions and 2 deletions

View File

@ -3,7 +3,7 @@
USING: kernel sequences strings namespaces math assocs shuffle
vectors arrays combinators.lib math.parser match
unicode.categories sequences.lib compiler.units parser
words quotations effects memoize accessors ;
words quotations effects memoize accessors combinators.cleave ;
IN: peg
TUPLE: parse-result remaining ast ;
@ -231,7 +231,7 @@ MATCH-VARS: ?action ;
] ;
M: action-parser (compile) ( parser -- quot )
{ p1>> quot>> } get-slots [ compiled-parser ] dip
{ [ p1>> ] [ quot>> ] } cleave [ compiled-parser ] dip
2array { ?quot ?action } action-pattern match-replace ;
: left-trim-slice ( string -- string )