src/Pure/Isar/token.ML
changeset 78098 2cd7e5518d0d
parent 78090 79ad3181071b
child 78690 e10ef4f9c848
equal deleted inserted replaced
78097:2ea20bb1493c 78098:2cd7e5518d0d
   556   | closure tok = tok;
   556   | closure tok = tok;
   557 
   557 
   558 
   558 
   559 (* pretty *)
   559 (* pretty *)
   560 
   560 
       
   561 fun pretty_keyword3 tok =
       
   562   let val props = Position.properties_of (pos_of tok)
       
   563   in Pretty.mark_str (Markup.properties props Markup.keyword3, unparse tok) end;
       
   564 
   561 fun pretty_value ctxt tok =
   565 fun pretty_value ctxt tok =
   562   (case get_value tok of
   566   (case get_value tok of
   563     SOME (Literal markup) =>
   567     SOME (Literal markup) =>
   564       let val x = content_of tok
   568       let val x = content_of tok
   565       in Pretty.mark_str (keyword_markup markup x, x) end
   569       in Pretty.mark_str (keyword_markup markup x, x) end
   566   | SOME (Name ({print, ...}, _)) => Pretty.quote (Pretty.mark_str (print ctxt))
   570   | SOME (Name ({print, ...}, _)) => Pretty.quote (Pretty.mark_str (print ctxt))
   567   | SOME (Typ T) => Syntax.pretty_typ ctxt T
   571   | SOME (Typ T) => Syntax.pretty_typ ctxt T
   568   | SOME (Term t) => Syntax.pretty_term ctxt t
   572   | SOME (Term t) => Syntax.pretty_term ctxt t
   569   | SOME (Fact (_, ths)) =>
   573   | SOME (Fact (_, ths)) =>
   570       Pretty.enclose "(" ")" (Pretty.breaks (map (Pretty.cartouche o Thm.pretty_thm ctxt) ths))
   574       Pretty.enclose "(" ")" (Pretty.breaks (map (Pretty.cartouche o Thm.pretty_thm ctxt) ths))
       
   575   | SOME (Attribute _) => pretty_keyword3 tok
       
   576   | SOME (Declaration _) => pretty_keyword3 tok
   571   | _ => Pretty.marks_str (markups Keyword.empty_keywords tok, unparse tok));
   577   | _ => Pretty.marks_str (markups Keyword.empty_keywords tok, unparse tok));
   572 
   578 
   573 
   579 
   574 (* src *)
   580 (* src *)
   575 
   581