! Copyright (C) 2009 John Benediktsson
! See http://factorcode.org/license.txt for BSD license
-USING: accessors assocs io io.streams.string kernel macros
-math peg.ebnf prettyprint sequences strings ;
+USING: accessors ascii assocs fry io io.streams.string kernel
+macros math peg.ebnf prettyprint sequences strings ;
IN: brainfuck
PRIVATE>
MACRO: run-brainfuck ( code -- )
- [ <brainfuck> ] swap parse-brainfuck [ drop flush ] 3append ;
+ [ blank? not ] filter parse-brainfuck
+ '[ <brainfuck> @ drop flush ] ;
: get-brainfuck ( code -- result )
[ run-brainfuck ] with-string-writer ; inline
-