CVS: sml-dist/src/system/Basis/Implementation word64.sml,1.3,1.4

Matthias Blume <[email protected]>
Newsgroups gmane.comp.lang.sml.smlnj.commits
Message-ID <[email protected]>
Update of /cvsroot/smlnj/sml-dist/src/system/Basis/Implementation
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6772/src/system/Basis/Implementation

Modified Files:
	word64.sml 
Log Message:
fixed Word64.fromString

Index: word64.sml
===================================================================
RCS file: /cvsroot/smlnj/sml-dist/src/system/Basis/Implementation/word64.sml,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** word64.sml	11 Nov 2004 23:26:26 -0000	1.3
--- word64.sml	10 May 2005 02:56:53 -0000	1.4
***************
*** 114,123 ****
      (* piggy-back on intinf... *)
      fun scan rdx rdr s =
! 	case IntInfImp.scan rdx rdr s of
! 	    SOME (i, s') =>
! 	      if i < 0 then NONE
! 	      else if i > 0xffffffffffffffff then raise Overflow
! 	      else SOME (fromLargeInt i, s')
! 	  | NONE =>  NONE
  
      val fromString = PreBasis.scanString (scan StringCvt.HEX)
--- 114,147 ----
      (* piggy-back on intinf... *)
      fun scan rdx rdr s =
! 	let fun doword s = IntInfImp.scan rdx rdr s
! 	    val xok = rdx = StringCvt.HEX
! 	    fun startscan s0 =
! 		case rdr s0 of
! 		    SOME (#"0", s1) =>
! 		      let fun wordor0 s =
! 			      case doword s of
! 				  NONE => SOME (0, s1)
! 				| SOME (i, s') => SOME (i, s')
! 			  fun saww s =
! 			      case rdr s of
! 				  SOME (#"x", s') =>
! 				    if xok then wordor0 s'
! 				    else SOME (0, s1)
! 				| _ => wordor0 s
! 		      in case rdr s1 of
! 			     SOME (#"w", s2) => saww s2
! 			   | SOME (#"x", s2) =>
! 			       if xok then wordor0 s2
! 			       else SOME (0, s1)
! 			   | _ => doword s0
! 		      end
! 		  | _ => doword s0
! 	in case startscan s of
! 	       SOME (i, s') =>
! 	         if i < 0 then NONE
! 		 else if i > 0xffffffffffffffff then raise Overflow
! 		 else SOME (fromLargeInt i, s')
! 	     | NONE => NONE
! 	end
  
      val fromString = PreBasis.scanString (scan StringCvt.HEX)



-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.