1 ! Copyright (C) 2007, 2008 Slava Pestov, Eduardo Cavazos.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: accessors assocs kernel locals locals.types
4 prettyprint.backend prettyprint.sections prettyprint.custom
10 : pprint-var ( var -- )
11 #! Prettyprint a read/write local as its writer, just like
12 #! in the input syntax: [| x! | ... x 3 + x! ]
14 "local-writer" word-prop
17 : pprint-vars ( vars -- ) [ pprint-var ] each ;
22 dup vars>> pprint-vars
24 f <inset body>> pprint-elements block>
28 : pprint-let ( let word -- )
30 [ body>> ] [ bindings>> ] bi
34 [ <block [ pprint-var ] dip pprint* block> ] assoc-each
37 <block pprint-elements block>
41 M: let pprint* \ [let pprint-let ;
43 M: wlet pprint* \ [wlet pprint-let ;
45 M: let* pprint* \ [let* pprint-let ;
48 <block \ :> pprint-word local>> pprint-word block> ;