[MLton-commit] r5171

Wesley Terpstra wesley at mlton.org
Sun Feb 11 17:05:32 PST 2007


add a new control for setting the width of a widechar to 16/32 bits
----------------------------------------------------------------------

A   mlton/trunk/basis-library/config/default/default-widechar16.sml
A   mlton/trunk/basis-library/config/default/default-widechar32.sml
U   mlton/trunk/mlton/control/control-flags.sig
U   mlton/trunk/mlton/control/control-flags.sml
U   mlton/trunk/mlton/main/main.fun

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

Added: mlton/trunk/basis-library/config/default/default-widechar16.sml
===================================================================
--- mlton/trunk/basis-library/config/default/default-widechar16.sml	2007-02-12 01:02:27 UTC (rev 5170)
+++ mlton/trunk/basis-library/config/default/default-widechar16.sml	2007-02-12 01:05:31 UTC (rev 5171)
@@ -0,0 +1,17 @@
+(* Copyright (C) 1999-2006 Henry Cejtin, Matthew Fluet, Suresh
+ *    Jagannathan, and Stephen Weeks.
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+structure WideChar = Char16
+structure WideString = String16
+
+functor WideChar_ChooseChar (A: CHOOSE_CHARN_ARG) :
+   sig val f : WideChar.char A.t end =
+   ChooseCharN_Char16 (A)
+
+functor WideString_ChooseString (A: CHOOSE_STRINGN_ARG) :
+   sig val f : WideString.string A.t end =
+   ChooseStringN_String16 (A)

Added: mlton/trunk/basis-library/config/default/default-widechar32.sml
===================================================================
--- mlton/trunk/basis-library/config/default/default-widechar32.sml	2007-02-12 01:02:27 UTC (rev 5170)
+++ mlton/trunk/basis-library/config/default/default-widechar32.sml	2007-02-12 01:05:31 UTC (rev 5171)
@@ -0,0 +1,17 @@
+(* Copyright (C) 1999-2006 Henry Cejtin, Matthew Fluet, Suresh
+ *    Jagannathan, and Stephen Weeks.
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+structure WideChar = Char32
+structure WideString = String32
+
+functor WideChar_ChooseChar (A: CHOOSE_CHARN_ARG) :
+   sig val f : WideChar.char A.t end =
+   ChooseCharN_Char32 (A)
+
+functor WideString_ChooseString (A: CHOOSE_STRINGN_ARG) :
+   sig val f : WideString.string A.t end =
+   ChooseStringN_String32 (A)

Modified: mlton/trunk/mlton/control/control-flags.sig
===================================================================
--- mlton/trunk/mlton/control/control-flags.sig	2007-02-12 01:02:27 UTC (rev 5170)
+++ mlton/trunk/mlton/control/control-flags.sig	2007-02-12 01:05:31 UTC (rev 5171)
@@ -48,6 +48,7 @@
       val debug: bool ref
 
       val defaultChar: string ref
+      val defaultWideChar: string ref
       val defaultInt: string ref
       val defaultReal: string ref
       val defaultWord: string ref

Modified: mlton/trunk/mlton/control/control-flags.sml
===================================================================
--- mlton/trunk/mlton/control/control-flags.sml	2007-02-12 01:02:27 UTC (rev 5170)
+++ mlton/trunk/mlton/control/control-flags.sml	2007-02-12 01:05:31 UTC (rev 5171)
@@ -84,6 +84,9 @@
 val defaultChar = control {name = "defaultChar",
                            default = "char8",
                            toString = fn s => s}
+val defaultWideChar = control {name = "defaultWideChar",
+                               default = "widechar32",
+                               toString = fn s => s}
 val defaultInt = control {name = "defaultInt",
                           default = "int32",
                           toString = fn s => s}
@@ -1029,6 +1032,8 @@
                 path = "seqindex-int32.sml"},
                {var = "DEFAULT_CHAR",
                 path = concat ["default-", !defaultChar, ".sml"]},
+               {var = "DEFAULT_WIDECHAR",
+                path = concat ["default-", !defaultWideChar, ".sml"]},
                {var = "DEFAULT_INT",
                 path = concat ["default-", !defaultInt, ".sml"]},
                {var = "DEFAULT_REAL",

Modified: mlton/trunk/mlton/main/main.fun
===================================================================
--- mlton/trunk/mlton/main/main.fun	2007-02-12 01:02:27 UTC (rev 5170)
+++ mlton/trunk/mlton/main/main.fun	2007-02-12 01:05:31 UTC (rev 5171)
@@ -229,6 +229,8 @@
                    | "intinf" => Control.defaultInt := s
                    | "real32" => Control.defaultReal := s
                    | "real64" => Control.defaultReal := s
+                   | "widechar16" => Control.defaultWideChar := s
+                   | "widechar32" => Control.defaultWideChar := s
                    | "word8" => Control.defaultWord := s
                    | "word16" => Control.defaultWord := s
                    | "word32" => Control.defaultWord := s




More information about the MLton-commit mailing list