src/HOL/Tools/Old_Datatype/old_datatype.ML
changeset 67318 0ee38196509e
parent 67091 1393c2340eec
child 67320 6afba546f0e5
equal deleted inserted replaced
67317:15ea49331fc7 67318:0ee38196509e
   792   end;
   792   end;
   793 
   793 
   794 val add_datatype = gen_add_datatype check_specs;
   794 val add_datatype = gen_add_datatype check_specs;
   795 val add_datatype_cmd = gen_add_datatype read_specs;
   795 val add_datatype_cmd = gen_add_datatype read_specs;
   796 
   796 
   797 
       
   798 (* outer syntax *)
       
   799 
       
   800 val spec_cmd =
       
   801   Parse.type_args_constrained -- Parse.binding -- Parse.opt_mixfix --
       
   802   (@{keyword "="} |-- Parse.enum1 "|" (Parse.binding -- Scan.repeat Parse.typ -- Parse.opt_mixfix))
       
   803   >> (fn (((vs, t), mx), cons) => ((t, vs, mx), map Scan.triple1 cons));
       
   804 
       
   805 val _ =
       
   806   Outer_Syntax.command @{command_keyword old_datatype} "define old-style inductive datatypes"
       
   807     (Parse.and_list1 spec_cmd
       
   808       >> (Toplevel.theory o (snd oo add_datatype_cmd Old_Datatype_Aux.default_config)));
       
   809 
       
   810 open Old_Datatype_Aux;
   797 open Old_Datatype_Aux;
   811 
   798 
   812 end;
   799 end;