]> gitweb.factorcode.org Git - factor.git/commitdiff
prettyprint: cleanup using.
authorJohn Benediktsson <mrjbq7@gmail.com>
Fri, 17 Jul 2015 23:42:20 +0000 (16:42 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Fri, 17 Jul 2015 23:42:20 +0000 (16:42 -0700)
basis/inspector/inspector.factor
basis/prettyprint/backend/backend.factor
basis/prettyprint/sections/sections.factor

index 97c28f7dfeb85ac9099a8cc9466d49f392307605..473707aa74cea4cc8f2e61ffbbc18cc5214cf45c 100644 (file)
@@ -1,10 +1,9 @@
 ! Copyright (C) 2005, 2010 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors arrays generic hashtables io kernel assocs math
-namespaces prettyprint prettyprint.custom prettyprint.sections
-sequences strings io.styles vectors words quotations mirrors
-splitting math.parser classes vocabs sets sorting summary
-debugger continuations fry combinators ;
+USING: accessors assocs continuations debugger fry hashtables io
+io.styles kernel math mirrors namespaces prettyprint
+prettyprint.custom prettyprint.sections sequences sets sorting
+summary ;
 FROM: namespaces => set ;
 IN: inspector
 
index 1d96a15a82eddc321db83e39c28e6446c71a48a8..de99429f1591c8a8e3e463749d8c203aa5748844 100644 (file)
@@ -1,14 +1,12 @@
 ! Copyright (C) 2003, 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors arrays assocs byte-arrays byte-vectors classes
-classes.algebra.private classes.intersection classes.maybe
-classes.tuple classes.tuple.private classes.union colors
-colors.constants combinators continuations effects generic
-hash-sets hashtables io io.pathnames io.styles kernel
-make math math.order math.parser namespaces prettyprint.config
+classes.algebra.private classes.maybe classes.private
+classes.tuple combinators continuations effects generic
+hash-sets hashtables io.pathnames io.styles kernel make math
+math.order math.parser namespaces prettyprint.config
 prettyprint.custom prettyprint.sections prettyprint.stylesheet
-quotations sbufs sequences strings vectors words words.symbol
-classes.private ;
+quotations sbufs sequences strings vectors words ;
 FROM: sets => members ;
 IN: prettyprint.backend
 
index 0de903270a0439e2d089d33f1c518376fa856dc4..7ae9c661d32835eea989f673d6b5454f05e0b35b 100644 (file)
@@ -1,10 +1,9 @@
 ! Copyright (C) 2003, 2010 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: arrays generic hashtables io kernel math assocs
-namespaces make sequences strings io.styles vectors words
-prettyprint.config splitting classes continuations
-accessors sets vocabs.parser combinators vocabs
-classes.maybe combinators.short-circuit ;
+USING: accessors classes.maybe combinators
+combinators.short-circuit continuations hashtables io io.styles
+kernel make math namespaces prettyprint.config sequences sets
+splitting strings vocabs vocabs.parser words ;
 FROM: sets => members ;
 FROM: namespaces => set ;
 IN: prettyprint.sections
@@ -48,20 +47,23 @@ M: maybe vocabulary-name
 : do-indent ( -- ) pprinter get indent>> CHAR: \s <string> write ;
 
 : fresh-line ( n -- )
-    dup pprinter get last-newline>> = [
-        drop
+    pprinter get 2dup last-newline>> = [
+        2drop
     ] [
-        pprinter get last-newline<<
+        swap >>last-newline
         line-limit? [
-            "..." write pprinter get return
+            "..." write return
         ] when
-        pprinter get [ 1 + ] change-line-count drop
+        [ 1 + ] change-line-count drop
         nl do-indent
     ] if ;
 
 : text-fits? ( len -- ? )
-    margin get
-    [ drop t ] [ [ pprinter get indent>> + ] dip <= ] if-zero ;
+    margin get [
+        drop t
+    ] [
+        [ pprinter get indent>> + ] dip <=
+    ] if-zero ;
 
 ! Section protocol
 GENERIC: section-fits? ( section -- ? )
@@ -213,7 +215,7 @@ M: block short-section ( block -- )
 TUPLE: text-section < section string ;
 
 : <text> ( string style -- text )
-    over length 1 + text-section new-section
+    over length 1 + text-section new-section
         swap >>style
         swap >>string ;