[MLton-commit] r6372

Vesa Karvonen vesak at mlton.org
Mon Feb 4 05:38:12 PST 2008


Removed a relatively costly and not very critical assertion to check that
text passed to the txt combinator contains only printable characters.

----------------------------------------------------------------------

U   mltonlib/trunk/com/ssh/prettier/unstable/detail/prettier.sml

----------------------------------------------------------------------

Modified: mltonlib/trunk/com/ssh/prettier/unstable/detail/prettier.sml
===================================================================
--- mltonlib/trunk/com/ssh/prettier/unstable/detail/prettier.sml	2008-02-04 13:25:09 UTC (rev 6371)
+++ mltonlib/trunk/com/ssh/prettier/unstable/detail/prettier.sml	2008-02-04 13:38:11 UTC (rev 6372)
@@ -20,7 +20,7 @@
    datatype t =
       EMPTY
     | LAZY of t Lazy.t
-    | LINE of bool
+    | LINE of Bool.t
     | JOIN of t Sq.t
     | NEST of Int.t * t
     | TEXT of String.t
@@ -36,14 +36,8 @@
    val column = COLUMN
    val nesting = NESTING
 
-   local
-      fun assertAllPrint str =
-          if S.all C.isPrint str then ()
-          else fail "Unprintable characters given to Prettier.txt"
-   in
-      val txt = TEXT o Effect.obs assertAllPrint
-      val chr = txt o str
-   end
+   val txt = TEXT
+   val chr = TEXT o str
 
    val parens   as (lparen,   rparen)   = (TEXT "(", TEXT ")")
    val angles   as (langle,   rangle)   = (TEXT "<", TEXT ">")
@@ -65,7 +59,7 @@
     fn []    => []
      | d::ds => let
           fun lp rs d1 =
-           fn [] => List.revAppend (rs, [d1])
+           fn []     => List.revAppend (rs, [d1])
             | d2::ds => lp (d1 <^> sep::rs) d2 ds
        in
           lp [] d ds
@@ -210,7 +204,7 @@
 
    local
       val join =
-          fn [] => empty
+          fn []         => empty
            | (_, d)::xs =>
              group d <^> hcat (map (group o uncurry nest o
                                     Pair.map (id, line <\ op <^>)) xs)




More information about the MLton-commit mailing list