diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index 57d6ead4a7..1f84daa88d 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -59,6 +59,9 @@ Here are the changes from version 20180206 to version YYYYMMDD. === Details +* 2020-07-18 + ** Update SML/NJ libraries to SML/NJ 110.98. + * 2020-07-08 ** Fix `Real{32,64}_gdtoa` race condition. diff --git a/doc/guide/src/CKitLibrary.adoc b/doc/guide/src/CKitLibrary.adoc index 1c20f009f6..6f6f10d80e 100644 --- a/doc/guide/src/CKitLibrary.adoc +++ b/doc/guide/src/CKitLibrary.adoc @@ -7,8 +7,8 @@ into abstract syntax represented as a set of SML datatypes. The ckit Library is distributed with SML/NJ. Due to differences between SML/NJ and MLton, this library will not work out-of-the box with MLton. -As of 20200626, MLton includes a port of the ckit Library synchronized -with SML/NJ version 110.97. +As of 20200718, MLton includes a port of the ckit Library synchronized +with SML/NJ version 110.98. == Usage == diff --git a/doc/guide/src/MLLPTLibrary.adoc b/doc/guide/src/MLLPTLibrary.adoc index 358fd59714..4d395b19fc 100644 --- a/doc/guide/src/MLLPTLibrary.adoc +++ b/doc/guide/src/MLLPTLibrary.adoc @@ -7,8 +7,8 @@ is a support library for the <:MLULex:> scanner generator and the <:MLAntlr:> parser generator. The ML-LPT Library is distributed with SML/NJ. -As of 20200626, MLton includes the ML-LPT Library synchronized with -SML/NJ version 110.87. +As of 20200718, MLton includes the ML-LPT Library synchronized with +SML/NJ version 110.98. == Usage == diff --git a/doc/guide/src/MLRISCLibrary.adoc b/doc/guide/src/MLRISCLibrary.adoc index 741a2600db..2c88779037 100644 --- a/doc/guide/src/MLRISCLibrary.adoc +++ b/doc/guide/src/MLRISCLibrary.adoc @@ -7,8 +7,8 @@ ends. The MLRISC Library is distributed with SML/NJ. Due to differences between SML/NJ and MLton, this library will not work out-of-the box with MLton. -As of 20200626, MLton includes a port of the MLRISC Library -synchronized with SML/NJ version 110.97. +As of 20200718, MLton includes a port of the MLRISC Library +synchronized with SML/NJ version 110.98. == Usage == diff --git a/doc/guide/src/SMLNJLibrary.adoc b/doc/guide/src/SMLNJLibrary.adoc index 5972193636..1022cf1a96 100644 --- a/doc/guide/src/SMLNJLibrary.adoc +++ b/doc/guide/src/SMLNJLibrary.adoc @@ -6,8 +6,8 @@ collection of libraries that are distributed with SML/NJ. Due to differences between SML/NJ and MLton, these libraries will not work out-of-the box with MLton. -As of 20200626, MLton includes a port of the SML/NJ Library -synchronized with SML/NJ version 110.97. +As of 20200718, MLton includes a port of the SML/NJ Library +synchronized with SML/NJ version 110.98. == Usage == diff --git a/lib/ckit-lib/ckit.tgz b/lib/ckit-lib/ckit.tgz index 79cdb3276d..b665744fae 100644 Binary files a/lib/ckit-lib/ckit.tgz and b/lib/ckit-lib/ckit.tgz differ diff --git a/lib/mllpt-lib/ml-lpt.patch b/lib/mllpt-lib/ml-lpt.patch index a43ca9b433..b093b50580 100644 --- a/lib/mllpt-lib/ml-lpt.patch +++ b/lib/mllpt-lib/ml-lpt.patch @@ -1,3 +1,47 @@ +diff --git a/doc/history.tex b/doc/history.tex +index 19be755..8ca8d79 100644 +--- a/doc/history.tex ++++ b/doc/history.tex +@@ -6,12 +6,6 @@ + Here is a history of changes to the SML/NJ Language Processing Tools. + More details can be found in the SML/NJ \texttt{NOTES} and \texttt{README} files. + \begin{description} +- \item[SML/NJ 110.98] +- \mbox{}\\[0.5em] +- Changed the semantics of the \texttt{--debug} command-line option for \mlantlr{}. +- Previously this option replaced the actions with a print expression, but that +- limited its usefulness because of type errors in the generated code. The new +- behavior is to preserve the existing actions and just add the printing code. + \item[SML/NJ 110.96] + \mbox{}\\[0.5em] + Added the `FilePos` sub-structure to the `AntlrStreamPos` structure. This +diff --git a/doc/manual.tex b/doc/manual.tex +index ec635db..26c0815 100644 +--- a/doc/manual.tex ++++ b/doc/manual.tex +@@ -28,7 +28,7 @@ + \texttt{adrassi@gmail.com}\\[0.5em] + John Reppy\\ + \texttt{jhr@cs.chicago.edu}} +-\date{Revised: May 2020} ++\date{Revised: September 2016} + + \newcommand{\Carat}{\^{ }} + \newcommand{\RE}{r} +diff --git a/doc/usage-ml-antlr.tex b/doc/usage-ml-antlr.tex +index 7dab077..0b742ed 100644 +--- a/doc/usage-ml-antlr.tex ++++ b/doc/usage-ml-antlr.tex +@@ -47,7 +47,8 @@ where \texttt{file} is the name of the input \ulex{} specification, and where \t + \texttt{--unit-actions} & ignore the action code in the grammar, and instead return \texttt{()} + for every production. \\ + \\ +- \texttt{--debug} & add code to the actions to print the left-hand-side of the production. ++ \texttt{--debug} & ignore the action code in the grammar, and instead print the ++ left-hand-side of the production. + \end{tabular}% + + \vskip 10pt \noindent diff --git a/lib/mllpt-lib.mlb b/lib/mllpt-lib.mlb new file mode 100644 index 0000000..0d6bf2a @@ -5,3 +49,236 @@ index 0000000..0d6bf2a +++ b/lib/mllpt-lib.mlb @@ -0,0 +1 @@ +ml-lpt-lib.mlb +diff --git a/ml-antlr/BackEnds/SML/sml-output.sml b/ml-antlr/BackEnds/SML/sml-output.sml +index 5501c0b..cd67eb2 100644 +--- a/ml-antlr/BackEnds/SML/sml-output.sml ++++ b/ml-antlr/BackEnds/SML/sml-output.sml +@@ -68,7 +68,9 @@ structure SMLOutput = + else + withSuffix @ withSpan @ [fullSpan ^ spanTySuffix] @ refs + in +- String.concat [name, " (", String.concatWith ", " args, ")"] ++ String.concat [name, " (", ++ String.concatWith ", " args, ++ ")"] + end + + (* make an expression that will pull the next token off the stream *) +@@ -106,17 +108,15 @@ structure SMLOutput = + fun mkTok (t, strmExp, letFn) = + letFn (ML_App (tokMatch t, [strmExp])) + fun mkNT (nt, strmExp, args, letFn, item) = let +- val name = (case (args, !Options.unitActions) +- of (SOME args, false) => concat [ +- "(", NTFnName nt, " (", +- actionHeader ( +- "UserCode.ARGS_" ^ Action.name args, +- Item.bindingsLeftOf (item, prod), +- bindingSuffix, true, refcells, rcSuffix), +- "))" +- ] +- | _ => NTFnName nt +- (* end case *)) ++ val name = case (args, !Options.actStyle) ++ of (SOME args, Options.ActNormal) => ++ "(" ^ NTFnName nt ^ " (" ++ ^ actionHeader ++ ("UserCode.ARGS_" ^ Action.name args, ++ Item.bindingsLeftOf (item, prod), ++ bindingSuffix, true, refcells, rcSuffix) ++ ^ "))" ++ | _ => NTFnName nt + val innerExp = ML_App (name, [strmExp]) + in + if NT.isSubrule nt +@@ -153,30 +153,29 @@ structure SMLOutput = + | S.OPT nt => mkEBNF (nt, strmExp, "EBNF.optional", mkLet) + end + val itemBindings = Prod.itemBindings prod +- fun debugCode () = concat[ +- "print \"", Nonterm.qualName (Prod.lhs prod), "\\n\"" +- ] +- val action = if !Options.unitActions +- then "()" +- else (case Prod.action prod +- of SOME _ => actionHeader ( +- concat ["UserCode.", Prod.fullName prod, "_ACT"], +- Prod.bindingsAtAction prod, bindingSuffix, false, +- refcells, rcSuffix) +- | NONE => let +- val bindings = ListPair.mapPartial +- (fn (binding, hasValue) => +- if hasValue +- then SOME (binding ^ bindingSuffix) +- else NONE) +- (itemBindings, Prod.itemYields prod) +- in +- case bindings +- of [] => "()" +- | _ => concat["(", String.concatWith ", " bindings, ")"] +- (* end case *) +- end +- (* end case *)) ++ val action = ++ case !Options.actStyle ++ of Options.ActDebug => ++ "( print \"" ^ (Nonterm.qualName (Prod.lhs prod)) ^ "\\n\" )" ++ | Options.ActUnit => "()" ++ | Options.ActNormal => (case Prod.action prod ++ of SOME _ => actionHeader ("UserCode." ^ Prod.fullName prod ^ "_ACT", ++ Prod.bindingsAtAction prod, bindingSuffix, false, ++ refcells, rcSuffix) ++ | NONE => let ++ val bindings = ++ List.mapPartial ++ (fn (binding, hasValue) => ++ if hasValue ++ then SOME (binding ^ bindingSuffix) ++ else NONE) ++ (ListPair.zip (itemBindings, Prod.itemYields prod)) ++ in ++ if List.length bindings > 0 ++ then "(" ^ (String.concatWith ", " bindings) ^ ")" ++ else "()" ++ end ++ (* end case *)) + fun innerExp strm = let + val strmVar = ML_Var (strm) + val span = if List.length itemBindings = 0 then +@@ -186,17 +185,9 @@ structure SMLOutput = + ML_Tuple [ML_App ("#1", [ML_Var (hd itemBindings ^ spanSuffix)]), + ML_App ("#2", [ML_Var (hd (rev itemBindings) ^ spanSuffix)])] + val act = ML_Tuple [ML_Raw [ML.Tok action], ML_Var fullSpan, strmVar] +- val act = if !Options.debug +- then ML_Seq[ +- ML_Raw[ML.Tok(concat[ +- "print \"", Nonterm.qualName (Prod.lhs prod), "\\n\"" +- ])], +- act +- ] +- else act + val spanExp = ML_Let (fullSpan, span, act) +- in case (Prod.pred prod, !Options.unitActions) +- of (SOME pred, false) => ++ in case (Prod.pred prod, !Options.actStyle) ++ of (SOME pred, Options.ActNormal) => + ML_If (ML_Raw [ML.Tok ("(" + ^ actionHeader + ("UserCode." ^ Prod.fullName prod ^ "_PRED", +@@ -233,20 +224,19 @@ structure SMLOutput = + end + + and mkNonterm' (grm, pm) nt = let +- val formals = (case (!Options.unitActions, Nonterm.formals nt) +- of (false, _::_) => concat[ +- " (", +- String.concatWithMap ", " +- (fn f => Atom.toString f ^ bindingSuffix) +- (Nonterm.formals nt), +- ")" +- ] +- | _ => "" +- (* end case *)) +- val exp = (case Nonterm.prods nt +- of [prod] => mkProd (grm, pm) prod +- | _ => mknProds(grm, pm, nt) +- (* end case *)) ++ val formals = case !Options.actStyle ++ of Options.ActNormal => ++ if length (Nonterm.formals nt) > 0 ++ then " (" ^ (String.concatWith ", " ++ (map ++ (fn f => Atom.toString f ^ bindingSuffix) ++ (Nonterm.formals nt))) ++ ^ ")" ++ else "" ++ | _ => "" ++ val exp = if List.length (Nonterm.prods nt) = 1 ++ then mkProd (grm, pm) (hd (Nonterm.prods nt)) ++ else mknProds(grm, pm, nt) + in + (NTFnName nt ^ formals, ["strm"], exp) + end +diff --git a/ml-antlr/options.sml b/ml-antlr/options.sml +index 6b447ae..ee7289c 100644 +--- a/ml-antlr/options.sml ++++ b/ml-antlr/options.sml +@@ -5,21 +5,22 @@ + * Processing of command line arguments + *) + +-structure Options = ++structure Options = + struct + +- val unitActions = ref false +- val debug = ref false +- val dotOutput = ref false +- val texOutput = ref false +- val fname = ref "" ++ datatype action_style = ActNormal | ActUnit | ActDebug ++ ++ val actStyle : action_style ref = ref ActNormal ++ val dotOutput : bool ref = ref false ++ val texOutput : bool ref = ref false ++ val fname : string ref = ref "" + + (* process the command line arguments; return true if there is an error *) + fun processArgs args = let + fun procArg "--dot" = (dotOutput := true; false) + | procArg "--latex" = (texOutput := true; false) +- | procArg "--unit-actions" = (unitActions := true; false) +- | procArg "--debug" = (debug := true; false) ++ | procArg "--unit-actions" = (actStyle := ActUnit; false) ++ | procArg "--debug" = (actStyle := ActDebug; false) + | procArg _ = true + in + case List.filter procArg args +diff --git a/ml-ulex/FrontEnds/common/lex-spec.sml b/ml-ulex/FrontEnds/common/lex-spec.sml +index b9b4e99..99f9c93 100644 +--- a/ml-ulex/FrontEnds/common/lex-spec.sml ++++ b/ml-ulex/FrontEnds/common/lex-spec.sml +@@ -1,6 +1,6 @@ + (* lex-spec.sml + * +- * COPYRIGHT (c) 2005 ++ * COPYRIGHT (c) 2005 + * John Reppy (http://www.cs.uchicago.edu/~jhr) + * Aaron Turon (adrassi@gmail.com) + * All rights reserved. +@@ -8,7 +8,7 @@ + * Input specification to ml-ulex + *) + +-structure LexSpec = ++structure LexSpec = + struct + + datatype clamp = CLAMP127 | CLAMP255 | NO_CLAMP +@@ -52,7 +52,6 @@ structure LexSpec = + + fun updHeader (conf, new) = let + val Conf {structName, header, startStates, arg, clamp} = conf +-(* FIXME: we should be reporting an error instead of raising an exception here! *) + val _ = if String.size structName > 0 + then raise Fail "Cannot have both %structure and %header" + else () +@@ -67,7 +66,6 @@ structure LexSpec = + + fun updStructName (conf, new) = let + val Conf {structName, header, startStates, arg, clamp} = conf +-(* FIXME: we should be reporting an error instead of raising an exception here! *) + val _ = if String.size header > 0 + then raise Fail "Cannot have both %structure and %header" + else () +@@ -147,8 +145,8 @@ structure LexSpec = + } + fun clearRule (rspec, action) = (rspec, "()") + in Spec { +- decls = "fun eof() = ()\ntype lex_result = unit", +- conf = conf', ++ decls = "fun eof() = ()\ntype lex_result = unit", ++ conf = conf', + rules = List.map clearRule rules, + eofRules = List.map clearRule eofRules + } diff --git a/lib/mllpt-lib/ml-lpt.tgz b/lib/mllpt-lib/ml-lpt.tgz index ff8bd56753..14e4faf990 100644 Binary files a/lib/mllpt-lib/ml-lpt.tgz and b/lib/mllpt-lib/ml-lpt.tgz differ diff --git a/lib/mlrisc-lib/MLRISC.patch b/lib/mlrisc-lib/MLRISC.patch index 2ae02a0fe4..a9e784f181 100644 --- a/lib/mlrisc-lib/MLRISC.patch +++ b/lib/mlrisc-lib/MLRISC.patch @@ -1250,7 +1250,7 @@ index c6c1eb8..7c0069d 100644 struct diff --git a/amd64/mltree/amd64-gen.sml b/amd64/mltree/amd64-gen.sml -index 7543483..982dae3 100644 +index 2255bcc..1d56946 100644 --- a/amd64/mltree/amd64-gen.sml +++ b/amd64/mltree/amd64-gen.sml @@ -9,10 +9,53 @@ @@ -18147,7 +18147,7 @@ index 60a8610..43977b8 100644 - -end (* local *) diff --git a/x86/mltree/x86.sml b/x86/mltree/x86.sml -index b6975c1..3388337 100644 +index 16c7103..050be4a 100644 --- a/x86/mltree/x86.sml +++ b/x86/mltree/x86.sml @@ -32,19 +32,77 @@ diff --git a/lib/mlrisc-lib/MLRISC.tgz b/lib/mlrisc-lib/MLRISC.tgz index 6f5429ef34..f4c180edc2 100644 Binary files a/lib/mlrisc-lib/MLRISC.tgz and b/lib/mlrisc-lib/MLRISC.tgz differ diff --git a/lib/smlnj-lib/smlnj-lib.patch b/lib/smlnj-lib/smlnj-lib.patch index 935e05fe51..fbf582a56c 100644 --- a/lib/smlnj-lib/smlnj-lib.patch +++ b/lib/smlnj-lib/smlnj-lib.patch @@ -1942,10 +1942,10 @@ index 0000000..cffb30e + +end diff --git a/JSON/json-lib.mlb b/JSON/json-lib.mlb -index ff960d3..3fc3236 100644 +index ff960d3..d497783 100644 --- a/JSON/json-lib.mlb +++ b/JSON/json-lib.mlb -@@ -1,47 +1,360 @@ +@@ -1,47 +1,369 @@ -(* json-lib.mlb - * - * COPYRIGHT (c) 2008 The Fellowship of SML/NJ (http://www.smlnj.org) @@ -2001,11 +2001,11 @@ index ff960d3..3fc3236 100644 + bas + (* $/basis.cm ====> *) $(SML_LIB)/basis/basis.mlb $(SML_LIB)/basis/sml-nj.mlb + end -+ basis l71 = ++ basis l75 = + bas + (* $/smlnj-lib.cm ====> *) $(SML_LIB)/smlnj-lib/Util/smlnj-lib.mlb + end -+ basis l40 = ++ basis l44 = + bas + (* $/ml-lpt-lib.cm ====> *) $(SML_LIB)/mllpt-lib/mllpt-lib.mlb + end @@ -2052,19 +2052,14 @@ index ff960d3..3fc3236 100644 + structure gs_30 = TextIO + end + local -+ open l40 -+ in -+ structure gs_31 = AntlrStreamPos -+ end -+ local + open l33 + in -+ structure gs_32 = List ++ structure gs_31 = List + end + local -+ open l40 ++ open l44 + in -+ structure gs_33 = UTF8 ++ structure gs_32 = UTF8 + end + local + structure Char = gs_0 @@ -2079,7 +2074,7 @@ index ff960d3..3fc3236 100644 + structure LargeInt = gs_9 + structure LargeReal = gs_10 + structure LargeWord = gs_11 -+ structure List = gs_32 ++ structure List = gs_31 + structure OS = gs_12 + structure Position = gs_13 + structure Real = gs_14 @@ -2094,19 +2089,24 @@ index ff960d3..3fc3236 100644 + structure Substring = gs_23 + structure SysWord = gs_24 + structure Time = gs_25 -+ structure UTF8 = gs_33 ++ structure UTF8 = gs_32 + structure Word = gs_26 + structure Word32 = gs_27 + structure Word64 = gs_28 + structure Word8 = gs_29 + json-tokens.sml + in -+ structure gs_34 = JSONTokens ++ structure gs_33 = JSONTokens + end + local + open l33 + in -+ structure gs_35 = Vector ++ structure gs_34 = Vector ++ end ++ local ++ open l44 ++ in ++ structure gs_35 = AntlrStreamPos + end + local + open l33 @@ -2114,12 +2114,12 @@ index ff960d3..3fc3236 100644 + structure gs_36 = StringCvt + end + local -+ open l40 ++ open l44 + in + structure gs_37 = ULexBuffer + end + local -+ structure AntlrStreamPos = gs_31 ++ structure AntlrStreamPos = gs_35 + structure Char = gs_0 + structure CharArray = gs_1 + structure CharVector = gs_2 @@ -2129,11 +2129,11 @@ index ff960d3..3fc3236 100644 + structure Int32 = gs_6 + structure Int64 = gs_7 + structure IntInf = gs_8 -+ structure JSONTokens = gs_34 ++ structure JSONTokens = gs_33 + structure LargeInt = gs_9 + structure LargeReal = gs_10 + structure LargeWord = gs_11 -+ structure List = gs_32 ++ structure List = gs_31 + structure OS = gs_12 + structure Position = gs_13 + structure Real = gs_14 @@ -2151,8 +2151,8 @@ index ff960d3..3fc3236 100644 + structure TextIO = gs_30 + structure Time = gs_25 + structure ULexBuffer = gs_37 -+ structure UTF8 = gs_33 -+ structure Vector = gs_35 ++ structure UTF8 = gs_32 ++ structure Vector = gs_34 + structure Word = gs_26 + structure Word32 = gs_27 + structure Word64 = gs_28 @@ -2162,7 +2162,15 @@ index ff960d3..3fc3236 100644 + structure gs_38 = JSONLexer + end + local -+ structure AntlrStreamPos = gs_31 ++ structure AntlrStreamPos = gs_35 ++ structure JSONLexer = gs_38 ++ structure JSONTokens = gs_33 ++ structure TextIO = gs_30 ++ json-source.sml ++ in ++ structure gs_39 = JSONSource ++ end ++ local + structure Char = gs_0 + structure CharArray = gs_1 + structure CharVector = gs_2 @@ -2173,7 +2181,8 @@ index ff960d3..3fc3236 100644 + structure Int64 = gs_7 + structure IntInf = gs_8 + structure JSONLexer = gs_38 -+ structure JSONTokens = gs_34 ++ structure JSONSource = gs_39 ++ structure JSONTokens = gs_33 + structure LargeInt = gs_9 + structure LargeReal = gs_10 + structure LargeWord = gs_11 @@ -2198,19 +2207,19 @@ index ff960d3..3fc3236 100644 + structure Word8 = gs_29 + json-stream-parser.sml + in -+ structure gs_39 = JSONStreamParser ++ structure gs_40 = JSONStreamParser + end + local -+ open l71 ++ open l75 + in -+ structure gs_40 = Format ++ structure gs_41 = Format + end + local + structure Char = gs_0 + structure CharArray = gs_1 + structure CharVector = gs_2 + structure FixedInt = gs_3 -+ structure Format = gs_40 ++ structure Format = gs_41 + structure General = gs_4 + structure Int = gs_5 + structure Int32 = gs_6 @@ -2219,7 +2228,7 @@ index ff960d3..3fc3236 100644 + structure LargeInt = gs_9 + structure LargeReal = gs_10 + structure LargeWord = gs_11 -+ structure List = gs_32 ++ structure List = gs_31 + structure OS = gs_12 + structure Position = gs_13 + structure Real = gs_14 @@ -2235,14 +2244,14 @@ index ff960d3..3fc3236 100644 + structure SysWord = gs_24 + structure TextIO = gs_30 + structure Time = gs_25 -+ structure UTF8 = gs_33 ++ structure UTF8 = gs_32 + structure Word = gs_26 + structure Word32 = gs_27 + structure Word64 = gs_28 + structure Word8 = gs_29 + json-stream-printer.sml + in -+ structure gs_41 = JSONStreamPrinter ++ structure gs_42 = JSONStreamPrinter + end + local + structure Char = gs_0 @@ -2277,7 +2286,7 @@ index ff960d3..3fc3236 100644 + structure Word8 = gs_29 + json.sml + in -+ structure gs_42 = JSON ++ structure gs_43 = JSON + end + local + structure Char = gs_0 @@ -2289,11 +2298,11 @@ index ff960d3..3fc3236 100644 + structure Int32 = gs_6 + structure Int64 = gs_7 + structure IntInf = gs_8 -+ structure JSON = gs_42 ++ structure JSON = gs_43 + structure LargeInt = gs_9 + structure LargeReal = gs_10 + structure LargeWord = gs_11 -+ structure List = gs_32 ++ structure List = gs_31 + structure OS = gs_12 + structure Position = gs_13 + structure Real = gs_14 @@ -2308,88 +2317,46 @@ index ff960d3..3fc3236 100644 + structure Substring = gs_23 + structure SysWord = gs_24 + structure Time = gs_25 -+ structure Vector = gs_35 ++ structure Vector = gs_34 + structure Word = gs_26 + structure Word32 = gs_27 + structure Word64 = gs_28 + structure Word8 = gs_29 + json-util.sml + in -+ structure gs_43 = JSONUtil ++ structure gs_44 = JSONUtil + end + local -+ structure AntlrStreamPos = gs_31 -+ structure JSON = gs_42 ++ structure JSON = gs_43 + structure JSONLexer = gs_38 -+ structure JSONTokens = gs_34 -+ structure List = gs_32 ++ structure JSONSource = gs_39 ++ structure JSONTokens = gs_33 ++ structure List = gs_31 + structure TextIO = gs_30 + json-parser.sml + in -+ structure gs_44 = JSONParser ++ structure gs_45 = JSONParser + end + local -+ structure JSON = gs_42 -+ structure JSONStreamPrinter = gs_41 -+ structure List = gs_32 ++ structure JSON = gs_43 ++ structure JSONStreamPrinter = gs_42 ++ structure List = gs_31 + structure TextIO = gs_30 + json-printer.sml + in -+ structure gs_45 = JSONPrinter ++ structure gs_46 = JSONPrinter + end +in -+ structure JSON = gs_42 -+ structure JSONParser = gs_44 -+ structure JSONPrinter = gs_45 -+ structure JSONStreamParser = gs_39 -+ structure JSONStreamPrinter = gs_41 -+ structure JSONUtil = gs_43 ++ structure JSON = gs_43 ++ structure JSONParser = gs_45 ++ structure JSONPrinter = gs_46 ++ structure JSONStreamParser = gs_40 ++ structure JSONStreamPrinter = gs_42 ++ structure JSONUtil = gs_44 +end +end end -diff --git a/JSON/json.lex.sml b/JSON/json.lex.sml -index 87e5f17..d488353 100644 ---- a/JSON/json.lex.sml -+++ b/JSON/json.lex.sml -@@ -2,6 +2,8 @@ structure JSONLexer = struct - - datatype yystart_state = - S | INITIAL -+ local -+ - structure UserDeclarations = - struct - -@@ -23,10 +25,8 @@ S | INITIAL - end - fun finishString () = (T.STRING(String.concat(List.rev(!sbuf))) before sbuf := []) - -- - end - -- local - datatype yymatch - = yyNO_MATCH - | yyMATCH of ULexBuffer.stream * action * yymatch -@@ -70,7 +70,7 @@ Vector.fromList [] - (* start position of token -- can be updated via skip() *) - val yystartPos = ref (yygetPos()) - (* get one char of input *) -- fun yygetc strm = (case UTF8.getu ULexBuffer.getc strm -+ fun yygetc strm = (case ULexBuffer.getu strm - of (SOME (0w10, s')) => - (AntlrStreamPos.markNewLine yysm (ULexBuffer.getpos strm); - SOME (0w10, s')) -@@ -104,7 +104,7 @@ Vector.fromList [] - (fn (~1, _, oldMatches) => yystuck oldMatches - | (curState, strm, oldMatches) => let - val (transitions, finals') = Vector.sub (yytable, curState) -- val finals = map (fn i => Vector.sub (actTable, i)) finals' -+ val finals = List.map (fn i => Vector.sub (actTable, i)) finals' - fun tryfinal() = - yystuck (yyactsToMatches (strm, finals, oldMatches)) - fun find (c, []) = NONE diff --git a/PP/mono-buffer/mono-buffer.fun b/PP/mono-buffer/mono-buffer.fun new file mode 100644 index 0000000..208e159 @@ -2686,10 +2653,10 @@ index 0000000..5468e29 + ); diff --git a/PP/pp-lib.mlb b/PP/pp-lib.mlb new file mode 100644 -index 0000000..0694ef1 +index 0000000..fe1c958 --- /dev/null +++ b/PP/pp-lib.mlb -@@ -0,0 +1,404 @@ +@@ -0,0 +1,357 @@ + +ann + "nonexhaustiveBind warn" "nonexhaustiveMatch ignore" @@ -2707,10 +2674,6 @@ index 0000000..0694ef1 + bas + (* $/smlnj-lib.cm ====> *) $(SML_LIB)/smlnj-lib/Util/smlnj-lib.mlb + end -+ basis l95 = -+ bas -+ (* $/html-lib.cm ====> *) $(SML_LIB)/smlnj-lib/HTML/html-lib.mlb -+ end +in +local + $(SML_LIB)/basis/pervasive.mlb @@ -2891,15 +2854,20 @@ index 0000000..0694ef1 + local + open l37 + in -+ structure gs_43 = TextPrimIO ++ structure gs_43 = List ++ end ++ local ++ open l37 ++ in ++ structure gs_44 = TextPrimIO + end + local + open l55 + in -+ structure gs_44 = ANSITerm ++ structure gs_45 = ANSITerm + end + local -+ structure ANSITerm = gs_44 ++ structure ANSITerm = gs_45 + structure Char = gs_1 + structure CharArray = gs_2 + structure CharVector = gs_3 @@ -2912,6 +2880,7 @@ index 0000000..0694ef1 + structure LargeInt = gs_10 + structure LargeReal = gs_11 + structure LargeWord = gs_12 ++ structure List = gs_43 + structure OS = gs_13 + signature PP_DEVICE = gs_39 + structure Position = gs_14 @@ -2928,7 +2897,7 @@ index 0000000..0694ef1 + structure Substring = gs_24 + structure SysWord = gs_25 + structure TextIO = gs_33 -+ structure TextPrimIO = gs_43 ++ structure TextPrimIO = gs_44 + structure Time = gs_26 + structure Word = gs_27 + structure Word32 = gs_28 @@ -2936,10 +2905,10 @@ index 0000000..0694ef1 + structure Word8 = gs_30 + devices/ansi-term-dev.sml + in -+ structure gs_45 = ANSITermDev ++ structure gs_46 = ANSITermDev + end + local -+ structure ANSITermDev = gs_45 ++ structure ANSITermDev = gs_46 + structure Char = gs_1 + structure CharArray = gs_2 + structure CharVector = gs_3 @@ -2976,75 +2945,27 @@ index 0000000..0694ef1 + structure Word8 = gs_30 + devices/ansi-term-pp.sml + in -+ structure gs_46 = ANSITermPP -+ end -+ local -+ open l95 -+ in -+ structure gs_47 = HTML -+ end -+ local -+ open l37 -+ in -+ structure gs_48 = List -+ end -+ local -+ structure Char = gs_1 -+ structure CharArray = gs_2 -+ structure CharVector = gs_3 -+ structure FixedInt = gs_4 -+ structure General = gs_5 -+ structure HTML = gs_47 -+ structure Int = gs_6 -+ structure Int32 = gs_7 -+ structure Int64 = gs_8 -+ structure IntInf = gs_9 -+ structure LargeInt = gs_10 -+ structure LargeReal = gs_11 -+ structure LargeWord = gs_12 -+ structure List = gs_48 -+ structure OS = gs_13 -+ signature PP_DEVICE = gs_39 -+ structure Position = gs_14 -+ structure Real = gs_15 -+ structure Real64 = gs_16 -+ structure RealArray = gs_17 -+ structure RealArraySlice = gs_18 -+ structure RealVector = gs_19 -+ structure RealVectorSlice = gs_20 -+ structure SMLofNJ = gs_21 -+ structure Socket = gs_22 -+ structure String = gs_23 -+ structure Substring = gs_24 -+ structure SysWord = gs_25 -+ structure Time = gs_26 -+ structure Word = gs_27 -+ structure Word32 = gs_28 -+ structure Word64 = gs_29 -+ structure Word8 = gs_30 -+ devices/html-dev.sml -+ in -+ structure gs_49 = HTMLDev ++ structure gs_47 = ANSITermPP + end + local + signature PP_STREAM = gs_32 + src/pp-desc-sig.sml + in -+ signature gs_50 = PP_DESC ++ signature gs_48 = PP_DESC + end + local + signature PP_STREAM = gs_32 + structure TextIO = gs_33 + src/pp-debug-fn.sml + in -+ functor gs_51 = PPDebugFn ++ functor gs_49 = PPDebugFn + end + local -+ signature PP_DESC = gs_50 ++ signature PP_DESC = gs_48 + signature PP_STREAM = gs_32 + src/pp-desc-fn.sml + in -+ functor gs_52 = PPDescFn ++ functor gs_50 = PPDescFn + end + local + structure CharBuffer = gs_34 @@ -3054,7 +2975,7 @@ index 0000000..0694ef1 + structure StringToken = gs_31 + devices/char-buffer-pp.sml + in -+ structure gs_53 = CharBufferPP ++ structure gs_51 = CharBufferPP + end + local + signature PP_DEVICE = gs_39 @@ -3062,33 +2983,32 @@ index 0000000..0694ef1 + structure TextIO = gs_33 + devices/simple-textio-dev.sml + in -+ structure gs_54 = SimpleTextIODev ++ structure gs_52 = SimpleTextIODev + end + local + functor PPStreamFn = gs_40 + signature PP_STREAM = gs_32 -+ structure SimpleTextIODev = gs_54 ++ structure SimpleTextIODev = gs_52 + structure StringToken = gs_31 + structure TextIO = gs_33 + devices/textio-pp.sml + in -+ structure gs_55 = TextIOPP ++ structure gs_53 = TextIOPP + end +in -+ structure ANSITermDev = gs_45 -+ structure ANSITermPP = gs_46 -+ structure CharBufferPP = gs_53 -+ structure HTMLDev = gs_49 -+ functor PPDebugFn = gs_51 -+ functor PPDescFn = gs_52 ++ structure ANSITermDev = gs_46 ++ structure ANSITermPP = gs_47 ++ structure CharBufferPP = gs_51 ++ functor PPDebugFn = gs_49 ++ functor PPDescFn = gs_50 + functor PPStreamFn = gs_40 -+ signature PP_DESC = gs_50 ++ signature PP_DESC = gs_48 + signature PP_DEVICE = gs_39 + signature PP_STREAM = gs_32 + signature PP_TOKEN = gs_0 -+ structure SimpleTextIODev = gs_54 ++ structure SimpleTextIODev = gs_52 + structure StringToken = gs_31 -+ structure TextIOPP = gs_55 ++ structure TextIOPP = gs_53 + structure TextPP = gs_42 +end +end @@ -3096,15 +3016,16 @@ index 0000000..0694ef1 +end diff --git a/README.mlton b/README.mlton new file mode 100644 -index 0000000..4bd5fed +index 0000000..ac78fd8 --- /dev/null +++ b/README.mlton -@@ -0,0 +1,16 @@ +@@ -0,0 +1,17 @@ +The following changes were made to the SML/NJ Library, in addition to +deriving the `.mlb` files from the `.cm` files: + +* `HTML4/pp-init.sml` (added): Implements `structure PrettyPrint` using the SML/NJ PP Library. This implementation is taken from the SML/NJ compiler source, since the SML/NJ HTML4 Library used the `structure PrettyPrint` provided by the SML/NJ compiler itself. -+* `PP/mono-buffer` (added): Implements `signature MONO_BUFFER` and `structure CharBuffer: MONO_BUFFER`. ++* `PP/mono-buffer` (added): Implements `signature MONO_BUFFER` and `structure CharBuffer: MONO_BUFFER` (see https://github.com/SMLFamily/BasisLibrary/wiki/2018-001-Addition-of-monomorphic-buffers). ++* `RegExp/Glue/match-tree.sml` (modified): Rewrote use of `Either.either` (see https://github.com/SMLFamily/BasisLibrary/wiki/2015-002-Addition-of-Either-module). +* `SExp/sexp.sml` (modified): Fixed non-exhaustive match warning (and latent bug) in `compare` function. +* `Util/dynamic-array.sml` (modified): Rewrote use of `Array.fromVector`. +* `Util/base64.sml` (modified): Rewrote use of `Unsafe.CharVector.create` and `Unsafe.CharVector.update`; MLton assumes that vectors are immutable. @@ -3115,7 +3036,7 @@ index 0000000..4bd5fed +* `Util/redblack-set-fn.sml` (modified): Rewrote use of `where` structure specification. +* `Util/time-limit.mlb` (added): Exports `structure TimeLimit`, which is _not_ exported by `smlnj-lib.mlb`. Since MLton is very conservative in the presence of threads and signals, program performance may be adversely affected by unnecessarily including `structure TimeLimit`. +* `Util/time-limit.mlton.sml` (added): Implements `structure TimeLimit` using `structure Engine`. The SML/NJ implementation of `structure TimeLimit` uses SML/NJ's first-class continuations, signals, and interval timer. -+* `Util/utf8.sml` (modified): Rewrote use of `String.implodeRev`. ++* `Util/utf8.sml` (modified): Rewrote use of `String.implodeRev` (see https://github.com/SMLFamily/BasisLibrary/wiki/2015-003d-STRING). diff --git a/Reactive/reactive-lib.mlb b/Reactive/reactive-lib.mlb new file mode 100644 index 0000000..b082ba7 @@ -3194,12 +3115,25 @@ index 0000000..b082ba7 +end + +end +diff --git a/RegExp/Glue/match-tree.sml b/RegExp/Glue/match-tree.sml +index 080971c..b56aa9d 100644 +--- a/RegExp/Glue/match-tree.sml ++++ b/RegExp/Glue/match-tree.sml +@@ -55,7 +55,7 @@ structure MatchTree :> MATCH_TREE = + * starting at 0. + *) + fun nth (t, n) = let +- datatype sum = datatype Either.either ++ datatype 'a sum = INL of int | INR of 'a + fun walk (0, Match (x, _)) = INR x + | walk (i, Match (_, children)) = let + fun walkList (i, []) = INL i diff --git a/RegExp/regexp-lib.mlb b/RegExp/regexp-lib.mlb new file mode 100644 -index 0000000..1c11852 +index 0000000..44d1765 --- /dev/null +++ b/RegExp/regexp-lib.mlb -@@ -0,0 +1,367 @@ +@@ -0,0 +1,366 @@ + +ann + "nonexhaustiveBind ignore" "nonexhaustiveMatch ignore" @@ -3371,7 +3305,6 @@ index 0000000..1c11852 + signature REGEXP = gs_41 + signature REGEXP_ENGINE = gs_39 + signature REGEXP_PARSER = gs_42 -+ structure RegExpSyntax = gs_38 + structure StringCvt = gs_6 + Glue/regexp-fn.sml + in @@ -4523,38 +4456,12 @@ index 781a7fa..6b5560d 100644 in f 0x10000 end -diff --git a/Util/redblack-map-fn.sml b/Util/redblack-map-fn.sml -index 94ab963..cdedaaa 100644 ---- a/Util/redblack-map-fn.sml -+++ b/Util/redblack-map-fn.sml -@@ -23,7 +23,7 @@ - * will be black and its child will be a red leaf. - *) - --functor RedBlackMapFn (K : ORD_KEY) :> ORD_MAP where Key = K = -+functor RedBlackMapFn (K : ORD_KEY) :> ORD_MAP where type Key.ord_key = K.ord_key = - struct - - structure Key = K -diff --git a/Util/redblack-set-fn.sml b/Util/redblack-set-fn.sml -index 66ce0b4..acd422f 100644 ---- a/Util/redblack-set-fn.sml -+++ b/Util/redblack-set-fn.sml -@@ -23,7 +23,7 @@ - * will be black and its child will be a red leaf. - *) - --functor RedBlackSetFn (K : ORD_KEY) :> ORD_SET where Key = K = -+functor RedBlackSetFn (K : ORD_KEY) :> ORD_SET where type Key.ord_key = K.ord_key = - struct - - structure Key = K diff --git a/Util/smlnj-lib.mlb b/Util/smlnj-lib.mlb new file mode 100644 -index 0000000..3ef05b1 +index 0000000..905ff0e --- /dev/null +++ b/Util/smlnj-lib.mlb -@@ -0,0 +1,2257 @@ +@@ -0,0 +1,2258 @@ + +ann + "nonexhaustiveBind ignore" "nonexhaustiveMatch warn" @@ -6583,6 +6490,7 @@ index 0000000..3ef05b1 + structure LargeInt = gs_13 + structure LargeReal = gs_14 + structure LargeWord = gs_15 ++ structure List = gs_34 + signature MONO_ARRAY = gs_56 + signature MONO_DYNAMIC_ARRAY = gs_61 + structure OS = gs_16 @@ -6879,10 +6787,10 @@ index 71259a3..00b526c 100644 in diff --git a/XML/xml-lib.mlb b/XML/xml-lib.mlb new file mode 100644 -index 0000000..630809d +index 0000000..b722d6d --- /dev/null +++ b/XML/xml-lib.mlb -@@ -0,0 +1,254 @@ +@@ -0,0 +1,255 @@ + +ann + "nonexhaustiveBind warn" "nonexhaustiveMatch warn" @@ -7122,6 +7030,7 @@ index 0000000..630809d + structure Word64 = gs_30 + structure Word8 = gs_31 + functor XMLTreeFn = gs_44 ++ signature XML_TREE = gs_40 + generic-xml-tree.sml + in + structure gs_45 = GenericXMLTree diff --git a/lib/smlnj-lib/smlnj-lib.tgz b/lib/smlnj-lib/smlnj-lib.tgz index 1edfbf0166..5b1e37deb0 100644 Binary files a/lib/smlnj-lib/smlnj-lib.tgz and b/lib/smlnj-lib/smlnj-lib.tgz differ diff --git a/mlnlffigen/main.sml b/mlnlffigen/main.sml index 0be3d85907..407830a4b1 100644 --- a/mlnlffigen/main.sml +++ b/mlnlffigen/main.sml @@ -1,4 +1,5 @@ -(* Copyright (C) 2005-2008 Henry Cejtin, Matthew Fluet, Suresh +(* Copyright (C) 2020 Matthew Fluet. + * Copyright (C) 2005-2008 Henry Cejtin, Matthew Fluet, Suresh * Jagannathan, and Stephen Weeks. * * MLton is released under a HPND-style license. @@ -65,8 +66,7 @@ fun makeOptions {usage} = let val regexp = SOME (RE.compileString re) - handle RegExpSyntax.CannotParse => NONE - | RegExpSyntax.CannotCompile => NONE + handle RegExpSyntax.CannotCompile => NONE in case regexp of SOME regexp =>