src/Pure/ML/ml_compiler_polyml-5.3.ML
changeset 42327 7c7cc7590eb3
parent 41504 f0f20a5b54df
child 43710 7270ae921cf2
equal deleted inserted replaced
42326:e2d22eb4aeb9 42327:7c7cc7590eb3
    38     val report_text =
    38     val report_text =
    39       (case Context.thread_data () of
    39       (case Context.thread_data () of
    40         SOME (Context.Proof ctxt) => Context_Position.report_text ctxt
    40         SOME (Context.Proof ctxt) => Context_Position.report_text ctxt
    41       | _ => Position.report_text);
    41       | _ => Position.report_text);
    42 
    42 
    43     fun report_decl markup loc decl =
    43     fun report_entity kind loc decl =
    44       report_text (position_of loc) Markup.ML_ref
    44       report_text (position_of loc)
    45         (Markup.markup (Position.markup (position_of decl) markup) "");
    45         (Markup.entityN, (Markup.kindN, kind) :: Position.def_properties_of (position_of decl)) "";
    46 
    46 
    47     fun report loc (PolyML.PTtype types) =
    47     fun report loc (PolyML.PTtype types) =
    48           cons (fn () =>
    48           cons (fn () =>
    49             PolyML.NameSpace.displayTypeExpression (types, depth, space)
    49             PolyML.NameSpace.displayTypeExpression (types, depth, space)
    50             |> pretty_ml |> Pretty.from_ML |> Pretty.string_of
    50             |> pretty_ml |> Pretty.from_ML |> Pretty.string_of
    51             |> report_text (position_of loc) Markup.ML_typing)
    51             |> report_text (position_of loc) Markup.ML_typing)
    52       | report loc (PolyML.PTdeclaredAt decl) = cons (fn () => report_decl Markup.ML_def loc decl)
    52       | report loc (PolyML.PTdeclaredAt decl) =
    53       | report loc (PolyML.PTopenedAt decl) = cons (fn () => report_decl Markup.ML_open loc decl)
    53           cons (fn () => report_entity Markup.ML_defN loc decl)
       
    54       | report loc (PolyML.PTopenedAt decl) =
       
    55           cons (fn () => report_entity Markup.ML_openN loc decl)
    54       | report loc (PolyML.PTstructureAt decl) =
    56       | report loc (PolyML.PTstructureAt decl) =
    55           cons (fn () => report_decl Markup.ML_struct loc decl)
    57           cons (fn () => report_entity Markup.ML_structN loc decl)
    56       | report _ (PolyML.PTnextSibling tree) = report_tree (tree ())
    58       | report _ (PolyML.PTnextSibling tree) = report_tree (tree ())
    57       | report _ (PolyML.PTfirstChild tree) = report_tree (tree ())
    59       | report _ (PolyML.PTfirstChild tree) = report_tree (tree ())
    58       | report _ _ = I
    60       | report _ _ = I
    59     and report_tree (loc, props) = fold (report loc) props;
    61     and report_tree (loc, props) = fold (report loc) props;
    60   in fn tree => List.app (fn e => e ()) (report_tree tree []) end;
    62   in fn tree => List.app (fn e => e ()) (report_tree tree []) end;