src/Pure/Syntax/syntax_phases.ML
changeset 62529 8b7bdfc09f3b
parent 62505 9e2a65912111
child 62763 3e9a68bd30a7
equal deleted inserted replaced
62528:c8c532b22947 62529:8b7bdfc09f3b
   177                 (Lexicon.str_of_token tok, pos);
   177                 (Lexicon.str_of_token tok, pos);
   178             val _ = append_reports rs;
   178             val _ = append_reports rs;
   179           in [Ast.Constant (Lexicon.mark_type c)] end
   179           in [Ast.Constant (Lexicon.mark_type c)] end
   180       | asts_of (Parser.Node ("_position", [Parser.Tip tok])) = asts_of_position "_constrain" tok
   180       | asts_of (Parser.Node ("_position", [Parser.Tip tok])) = asts_of_position "_constrain" tok
   181       | asts_of (Parser.Node ("_position_sort", [Parser.Tip tok])) = asts_of_position "_ofsort" tok
   181       | asts_of (Parser.Node ("_position_sort", [Parser.Tip tok])) = asts_of_position "_ofsort" tok
   182       | asts_of (Parser.Node (a as "\\<^const>Pure.dummy_pattern", [Parser.Tip tok])) =
   182       | asts_of (Parser.Node (a as "\<^const>Pure.dummy_pattern", [Parser.Tip tok])) =
   183           [ast_of_dummy a tok]
   183           [ast_of_dummy a tok]
   184       | asts_of (Parser.Node (a as "_idtdummy", [Parser.Tip tok])) =
   184       | asts_of (Parser.Node (a as "_idtdummy", [Parser.Tip tok])) =
   185           [ast_of_dummy a tok]
   185           [ast_of_dummy a tok]
   186       | asts_of (Parser.Node ("_idtypdummy", pts as [Parser.Tip tok, _, _])) =
   186       | asts_of (Parser.Node ("_idtypdummy", pts as [Parser.Tip tok, _, _])) =
   187           [Ast.Appl (Ast.Constant "_constrain" :: ast_of_dummy "_idtdummy" tok :: maps asts_of pts)]
   187           [Ast.Appl (Ast.Constant "_constrain" :: ast_of_dummy "_idtdummy" tok :: maps asts_of pts)]
   795 
   795 
   796 (** translations **)
   796 (** translations **)
   797 
   797 
   798 (* type propositions *)
   798 (* type propositions *)
   799 
   799 
   800 fun type_prop_tr' ctxt T [Const ("\\<^const>Pure.sort_constraint", _)] =
   800 fun type_prop_tr' ctxt T [Const ("\<^const>Pure.sort_constraint", _)] =
   801       Syntax.const "_sort_constraint" $ term_of_typ (Config.put show_sorts true ctxt) T
   801       Syntax.const "_sort_constraint" $ term_of_typ (Config.put show_sorts true ctxt) T
   802   | type_prop_tr' ctxt T [t] =
   802   | type_prop_tr' ctxt T [t] =
   803       Syntax.const "_ofclass" $ term_of_typ ctxt T $ t
   803       Syntax.const "_ofclass" $ term_of_typ ctxt T $ t
   804   | type_prop_tr' _ T ts = raise TYPE ("type_prop_tr'", [T], ts);
   804   | type_prop_tr' _ T ts = raise TYPE ("type_prop_tr'", [T], ts);
   805 
   805 
   837  (Sign.parse_ast_translation
   837  (Sign.parse_ast_translation
   838    [("_context_const", const_ast_tr true),
   838    [("_context_const", const_ast_tr true),
   839     ("_context_xconst", const_ast_tr false)] #>
   839     ("_context_xconst", const_ast_tr false)] #>
   840   Sign.typed_print_translation
   840   Sign.typed_print_translation
   841    [("_type_prop", type_prop_tr'),
   841    [("_type_prop", type_prop_tr'),
   842     ("\\<^const>Pure.type", type_tr'),
   842     ("\<^const>Pure.type", type_tr'),
   843     ("_type_constraint_", type_constraint_tr')]);
   843     ("_type_constraint_", type_constraint_tr')]);
   844 
   844 
   845 
   845 
   846 
   846 
   847 (** check/uncheck **)
   847 (** check/uncheck **)