639 | token_trans "_numeral" x = SOME (Pretty.mark_str (Isabelle_Markup.numeral, x)) |
639 | token_trans "_numeral" x = SOME (Pretty.mark_str (Isabelle_Markup.numeral, x)) |
640 | token_trans "_inner_string" x = SOME (Pretty.mark_str (Isabelle_Markup.inner_string, x)) |
640 | token_trans "_inner_string" x = SOME (Pretty.mark_str (Isabelle_Markup.inner_string, x)) |
641 | token_trans _ _ = NONE; |
641 | token_trans _ _ = NONE; |
642 |
642 |
643 fun markup_trans a [Ast.Variable x] = token_trans a x |
643 fun markup_trans a [Ast.Variable x] = token_trans a x |
644 | markup_trans "_constrain" [t, ty] = |
644 | markup_trans "_constrain" [t, ty] = constrain_trans t ty |
645 if not show_types andalso show_markup then |
645 | markup_trans "_idtyp" [t, ty] = constrain_trans t ty |
646 let |
|
647 val ((bg1, bg2), en) = typing_elem; |
|
648 val bg = bg1 ^ Pretty.symbolic_output (pretty_typ_ast Markup.empty ty) ^ bg2; |
|
649 in SOME (Pretty.raw_markup (bg, en) (0, [pretty_ast Markup.empty t])) end |
|
650 else NONE |
|
651 | markup_trans _ _ = NONE |
646 | markup_trans _ _ = NONE |
|
647 |
|
648 and constrain_trans t ty = |
|
649 if not show_types andalso show_markup then |
|
650 let |
|
651 val ((bg1, bg2), en) = typing_elem; |
|
652 val bg = bg1 ^ Pretty.symbolic_output (pretty_typ_ast Markup.empty ty) ^ bg2; |
|
653 in SOME (Pretty.raw_markup (bg, en) (0, [pretty_ast Markup.empty t])) end |
|
654 else NONE |
652 |
655 |
653 and pretty_typ_ast m ast = ast |
656 and pretty_typ_ast m ast = ast |
654 |> Printer.pretty_typ_ast ctxt prtabs trf markup_trans markup_extern |
657 |> Printer.pretty_typ_ast ctxt prtabs trf markup_trans markup_extern |
655 |> Pretty.markup m |
658 |> Pretty.markup m |
656 |
659 |