# HG changeset patch # User berghofe # Date 1008952268 -3600 # Node ID 7fdc00bb2a9e23d910236106cde5c557ecc18ea2 # Parent f4e0ce28aa8e598e84e3cb3eb1da116579216387 Code generator now adds type constraints to val declarations (to make SML/NJ happy). diff -r f4e0ce28aa8e -r 7fdc00bb2a9e src/Pure/codegen.ML --- a/src/Pure/codegen.ML Fri Dec 21 15:18:07 2001 +0100 +++ b/src/Pure/codegen.ML Fri Dec 21 17:31:08 2001 +0100 @@ -374,10 +374,12 @@ (Graph.add_edge (id, dep) (Graph.new_node (id, (None, "")) gr'), rhs'); val (gr2, xs) = codegens false (gr1, args'); + val (gr3, ty) = invoke_tycodegen thy id false (gr2, T); in Graph.map_node id (K (None, Pretty.string_of (Pretty.block - (Pretty.str (if null args' then "val " else "fun ") :: - separate (Pretty.brk 1) (Pretty.str id :: xs) @ - [Pretty.str " =", Pretty.brk 1, p, Pretty.str ";"])) ^ "\n\n")) gr2 + (separate (Pretty.brk 1) (if null args' then + [Pretty.str ("val " ^ id ^ " :"), ty] + else Pretty.str ("fun " ^ id) :: xs) @ + [Pretty.str " =", Pretty.brk 1, p, Pretty.str ";"])) ^ "\n\n")) gr3 end, mk_app brack (Pretty.str id) ps) end))