Skip to content

Commit

Permalink
Switching to case from if
Browse files Browse the repository at this point in the history
This moves `:print-fallback` from being a simple boolean to taking a
keyword value, which is checked as part of a case statement in
`unknown-document`
  • Loading branch information
David Jarvis committed Feb 27, 2015
1 parent a1da466 commit bcef0b4
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/puget/printer.clj
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@
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
Takes a keyword argument specifying the desired string representation of
uknown documents. The keyword :print will fall back 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
Expand All @@ -59,7 +60,7 @@
:strict false
:map-delimiter ","
:map-coll-separator " "
:print-fallback false
:print-fallback nil
:print-meta nil
:print-color false
:color-markup :ansi
Expand Down Expand Up @@ -207,9 +208,8 @@
(unknown-document value (.getName (class value)) repr))
([value tag repr]
(illegal-when-strict! value)
(if (:print-fallback *options*)
[:span
(pr-str value)]
(case (:print-fallback *options*)
:print [:span (pr-str value)]
[:span
(color-doc :class-delimiter "#<")
(color-doc :class-name tag)
Expand Down

0 comments on commit bcef0b4

Please sign in to comment.