1 ! Copyright (C) 2003, 2006 Slava Pestov.
2 ! See http://factorcode.org/license.txt for BSD license.
4 USING: alien arrays generic hashtables io kernel math
5 namespaces parser sequences strings styles vectors words ;
15 ! Special trick to highlight a word in a quotation
16 SYMBOL: hilite-quotation
20 IN: prettyprint-internals
25 SYMBOL: recursion-check
29 SYMBOL: pprinter-stack
32 : line-limit? ( -- ? )
33 line-limit get dup [ line-count get <= ] when ;
35 : do-indent ( -- ) indent get CHAR: \s <string> write ;
38 dup last-newline get = [
42 line-limit? [ "..." write end-printing get continue ] when
47 : text-fits? ( len -- ? )
48 indent get + margin get <= ;