[MLton-commit] r4372

Matthew Fluet MLton@mlton.org
Sat, 4 Mar 2006 06:35:23 -0800


Canonicalize re-anchored paths for conversion
----------------------------------------------------------------------

U   mlton/trunk/util/cm2mlb/cm2mlb-map
U   mlton/trunk/util/cm2mlb/cm2mlb.sml

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

Modified: mlton/trunk/util/cm2mlb/cm2mlb-map
===================================================================
--- mlton/trunk/util/cm2mlb/cm2mlb-map	2006-03-03 22:10:55 UTC (rev 4371)
+++ mlton/trunk/util/cm2mlb/cm2mlb-map	2006-03-04 14:35:22 UTC (rev 4372)
@@ -1,8 +1,11 @@
+$SMLNJ-BASIS           $(SML_LIB)/basis
 $basis.cm              $(SML_LIB)/basis
 $basis.cm/basis.cm     $(SML_LIB)/basis/basis.mlb
 
-$ml-yacc-lib.cm                    $(SML_LIB)/mlyacc-lib
-$ml-yacc-lib.cm/ml-yacc-lib.cm     $(SML_LIB)/mlyacc-lib/mlyacc-lib.mlb
+$SMLNJ-ML-YACC-LIB                    $(SML_LIB)/mlyacc-lib
+$SMLNJ-ML-YACC-LIB/ml-yacc-lib.cm     $(SML_LIB)/mlyacc-lib/mlyacc-lib.mlb
+$ml-yacc-lib.cm                       $(SML_LIB)/mlyacc-lib
+$ml-yacc-lib.cm/ml-yacc-lib.cm        $(SML_LIB)/mlyacc-lib/mlyacc-lib.mlb
 
 $cml            $(SML_LIB)/cml
 $cml/cml.cm     $(SML_LIB)/cml/cml.mlb
@@ -10,6 +13,7 @@
 $c          $(SML_LIB)/mlnlffi-lib
 $c/c.cm     $(SML_LIB)/mlnlffi-lib/mlnlffi-lib.mlb
 
+$SMLNJ-LIB            $(SML_LIB)/smlnj-lib
 $smlnj-lib.cm         $(SML_LIB)/smlnj-lib/Util
 $controls-lib.cm      $(SML_LIB)/smlnj-lib/Controls
 $hash-cons-lib.cm     $(SML_LIB)/smlnj-lib/HashCons

Modified: mlton/trunk/util/cm2mlb/cm2mlb.sml
===================================================================
--- mlton/trunk/util/cm2mlb/cm2mlb.sml	2006-03-03 22:10:55 UTC (rev 4371)
+++ mlton/trunk/util/cm2mlb/cm2mlb.sml	2006-03-04 14:35:22 UTC (rev 4372)
@@ -175,6 +175,16 @@
                                then case String.fields (fn #"/" => true | _ => false) cmLibDescr of
                                        "$" :: (arcs as (arc0 :: _)) => 
                                           doitAnchoredPath (("$" ^ arc0) :: arcs)
+                                     | arc0 :: arcs =>
+                                          let
+                                             val arc0 =
+                                                case CharVector.findi (fn (_, #"(") => true | _ => false) arc0 of
+                                                   SOME (i, _) => 
+                                                      String.extract (arc0, i + 2, SOME (String.size arc0 - i - 3))
+                                                 | NONE => arc0
+                                          in 
+                                             doitAnchoredPath (arc0 :: arcs)
+                                          end
                                      | arcs => doitAnchoredPath arcs
                                else concat ["(* ", cmLibOSString, " ===> *) ", mlbLibDef ()]
                       in