Paste: such a balagan
Author: | randy7 |
Mode: | factor |
Date: | Fri, 13 Feb 2009 13:15:26 |
Plain Text |
USING: kernel peg peg.search make sequences ;
: (1action) ( str1 str2 -- action-parser )
[ token ] [ [ ] curry [ drop ] prepose ] bi* action ;
: replace-all ( long-str seq-of-pairs -- str )
dupd [ [ first ] [ second ] bi (1action) ] with map
[ [ , ] curry ] map concat
choice*
replace ;
Author: | randy7 |
Mode: | factor |
Date: | Fri, 13 Feb 2009 13:37:25 |
Plain Text |
: replace-all ( long-str seq-of-pairs -- str )
dupd [ [ first ] [ second ] bi (1action) nip ] with map
[ [ , ] curry ] map concat
choice*
replace ;
New Annotation