Skip to content

Commit

Permalink
Merge a1da466 into 7e523ae
Browse files Browse the repository at this point in the history
  • Loading branch information
venantius committed Feb 27, 2015
2 parents 7e523ae + a1da466 commit 12c8d2d
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions src/puget/printer.clj
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@
The text placed between a map key and a collection value. The keyword :line
will cause line breaks if the whole map does not fit on a single line.
`:print-fallback`
If true, falls back to to using pr-str rather than puget's default
unknown-document representation
`:print-meta`
If true, metadata will be printed before values. If nil, defaults to the
value of *print-meta*.
Expand All @@ -55,6 +59,7 @@
:strict false
:map-delimiter ","
:map-coll-separator " "
:print-fallback false
:print-meta nil
:print-color false
:color-markup :ansi
Expand Down Expand Up @@ -121,7 +126,7 @@


(defn- illegal-when-strict!
"Throws an exception if strict mode is enabled. The error indincates that the
"Throws an exception if strict mode is enabled. The error indicates that the
given value has no EDN representation."
[value]
(when (:strict *options*)
Expand Down Expand Up @@ -202,14 +207,17 @@
(unknown-document value (.getName (class value)) repr))
([value tag repr]
(illegal-when-strict! value)
[:span
(color-doc :class-delimiter "#<")
(color-doc :class-name tag)
(color-doc :class-delimiter "@")
(system-id value)
" "
repr
(color-doc :class-delimiter ">")]))
(if (:print-fallback *options*)
[:span
(pr-str value)]
[:span
(color-doc :class-delimiter "#<")
(color-doc :class-name tag)
(color-doc :class-delimiter "@")
(system-id value)
" "
repr
(color-doc :class-delimiter ">")])))



Expand Down

0 comments on commit 12c8d2d

Please sign in to comment.