! Copyright (C) 2003, 2005 Slava Pestov. ! See http://factor.sf.net/license.txt for BSD license. IN: prettyprint USING: generic hashtables io kernel lists namespaces sequences styles words ; : declaration. ( word prop -- ) tuck word-name word-prop [ bl pprint-word ] [ drop ] ifte ; : declarations. ( word -- ) [ POSTPONE: parsing POSTPONE: inline POSTPONE: foldable POSTPONE: flushable ] [ declaration. ] each-with ; : comment. ( comment -- ) [ [[ font-style italic ]] ] text ; : stack-picture% ( seq -- string ) [ word-name % " " % ] each ; : effect>string ( effect -- string ) [ " " % dup first stack-picture% "-- " % second stack-picture% ] make-string ; : stack-effect ( word -- string ) dup "stack-effect" word-prop [ ] [ "infer-effect" word-prop dup [ effect>string ] when ] ?ifte ; : stack-effect. ( string -- ) [ bl "(" swap ")" append3 comment. ] when* ; : in. ( word -- )