]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/vocabs/prettyprint/prettyprint.factor
factor: trim using lists
[factor.git] / basis / vocabs / prettyprint / prettyprint.factor
index c180beba90421230a416caa5f31cfc6d74829505..986e07ae57b0e6cd9733b7563e4d60bf5447d041 100644 (file)
@@ -1,9 +1,8 @@
 ! Copyright (C) 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors arrays assocs colors colors.constants fry io
-io.styles kernel make math.order namespaces parser
-prettyprint.backend prettyprint.sections prettyprint.stylesheet
-sequences sets sorting vocabs vocabs.parser ;
+USING: accessors assocs colors io io.styles kernel
+make namespaces prettyprint.backend prettyprint.sections
+prettyprint.stylesheet sequences sorting vocabs vocabs.parser ;
 FROM: io.styles => inset ;
 IN: vocabs.prettyprint
 
@@ -28,7 +27,7 @@ IN: vocabs.prettyprint
 
 GENERIC: pprint-qualified ( qualified -- )
 
-M: qualified pprint-qualified ( qualified -- )
+M: qualified pprint-qualified
     [
         dup [ vocab>> vocab-name ] [ prefix>> ] bi = [
             \ QUALIFIED: pprint-word
@@ -39,7 +38,7 @@ M: qualified pprint-qualified ( qualified -- )
         ] if
     ] with-pprint ;
 
-M: from pprint-qualified ( from -- )
+M: from pprint-qualified
     [
         \ FROM: pprint-word
         [ vocab>> pprint-vocab "=>" text ]
@@ -47,7 +46,7 @@ M: from pprint-qualified ( from -- )
         \ ; pprint-word
     ] with-pprint ;
 
-M: exclude pprint-qualified ( exclude -- )
+M: exclude pprint-qualified
     [
         \ EXCLUDE: pprint-word
         [ vocab>> pprint-vocab "=>" text ]
@@ -55,7 +54,7 @@ M: exclude pprint-qualified ( exclude -- )
         \ ; pprint-word
     ] with-pprint ;
 
-M: rename pprint-qualified ( rename -- )
+M: rename pprint-qualified
     [
         \ RENAME: pprint-word
         [ word>> text ]
@@ -83,6 +82,12 @@ PRIVATE>
 : pprint-manifest ( manifest -- )
     (pprint-manifest pprint-manifest) ;
 
+CONSTANT: manifest-style H{
+    { page-color COLOR: FactorLightTan }
+    { border-color COLOR: FactorDarkTan }
+    { inset { 5 5 } }
+}
+
 [
     nl
     { { font-style bold } { font-name "sans-serif" } } [
@@ -90,10 +95,6 @@ PRIVATE>
         "To avoid doing this in the future, add the following forms" print
         "at the top of the source file:" print nl
     ] with-style
-    {
-        { page-color COLOR: FactorLightTan }
-        { border-color COLOR: FactorDarkTan }
-        { inset { 5 5 } }
-    } [ manifest get pprint-manifest ] with-nesting
+    manifest-style [ manifest get pprint-manifest ] with-nesting
     nl nl
 ] print-use-hook set-global