You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
MLton's Word.scan seems to be buggy when 0 is followed by w/x but not by more digits.
Example:
funtestScan scan s = case scan Substring.getc (Substring.full s) ofNONE => print "NONE\n"
| SOME (result, rest) => print ("SOME (0w" ^ Word.fmt StringCvt.DEC result ^ ", \"" ^ Substring.string rest ^ "\")\n")
val () = List.app (testScan (Word.scan StringCvt.BIN))
["0", "0w", "0wx", "0x"];
val () = List.app (testScan (Word.scan StringCvt.OCT))
["0", "0w", "0wx", "0x"];
val () = List.app (testScan (Word.scan StringCvt.DEC))
["0", "0w", "0wx", "0x"];
val () = List.app (testScan (Word.scan StringCvt.HEX))
["0", "0w", "0wx", "0x"];
Expected output:
SOME (0w0, "")
SOME (0w0, "w")
SOME (0w0, "wx")
SOME (0w0, "x")
SOME (0w0, "")
SOME (0w0, "w")
SOME (0w0, "wx")
SOME (0w0, "x")
SOME (0w0, "")
SOME (0w0, "w")
SOME (0w0, "wx")
SOME (0w0, "x")
SOME (0w0, "")
SOME (0w0, "w")
SOME (0w0, "wx")
SOME (0w0, "x")
MLton's output:
SOME (0w0, "")
SOME (0w0, "")
SOME (0w0, "x")
NONE
SOME (0w0, "")
SOME (0w0, "")
SOME (0w0, "x")
NONE
SOME (0w0, "")
SOME (0w0, "")
SOME (0w0, "x")
NONE
SOME (0w0, "")
SOME (0w0, "w")
SOME (0w0, "")
SOME (0w0, "")
The text was updated successfully, but these errors were encountered:
MLton's
Word.scan
seems to be buggy when0
is followed byw
/x
but not by more digits.Example:
Expected output:
MLton's output:
The text was updated successfully, but these errors were encountered: