[MLton-commit] r7227

Matthew Fluet fluet at mlton.org
Tue Sep 15 18:18:29 PDT 2009


Fix bug in IntInf.scan (and IntInf.fromString) where leading spaces
were only accepted if the stream/string had an explicit sign
character.


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

U   mlton/trunk/basis-library/integer/int-inf.sml

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

Modified: mlton/trunk/basis-library/integer/int-inf.sml
===================================================================
--- mlton/trunk/basis-library/integer/int-inf.sml	2009-09-15 12:30:23 UTC (rev 7226)
+++ mlton/trunk/basis-library/integer/int-inf.sml	2009-09-16 01:18:27 UTC (rev 7227)
@@ -242,7 +242,8 @@
                     : (int, 'a) reader =
             let
                fun reader (s: 'a): (int * 'a) option =
-                  case cread (StringCvt.skipWS cread s) of
+                  let val s = StringCvt.skipWS cread s
+                  case cread s of
                      NONE => NONE
                    | SOME (ch, s') =>
                        let
@@ -259,6 +260,7 @@
                                    | SOME (abs, s''') => SOME (~ abs, s''')
                              else uread s''
                        end
+                  end
             in
                reader
             end




More information about the MLton-commit mailing list