src/HOL/Tools/record_package.ML
changeset 6384 eed1273c9146
parent 6358 92dbe243555f
child 6394 3d9fd50fcc43
equal deleted inserted replaced
6383:45bb139e6ceb 6384:eed1273c9146
   881   add_wrapper record_split_wrapper];
   881   add_wrapper record_split_wrapper];
   882 
   882 
   883 
   883 
   884 (* outer syntax *)
   884 (* outer syntax *)
   885 
   885 
   886 open OuterParse;
   886 local open OuterParse in
   887 
   887 
   888 val record_decl =
   888 val record_decl =
   889   type_args -- name -- ($$$ "=" |-- Scan.option (typ --| $$$ "+")
   889   type_args -- name -- ($$$ "=" |-- Scan.option (typ --| $$$ "+")
   890     -- Scan.repeat1 (name -- ($$$ "::" |-- typ)));
   890     -- Scan.repeat1 (name -- ($$$ "::" |-- typ)));
   891 
   891 
   892 val recordP =
   892 val recordP =
   893   OuterSyntax.parser false "record" "define extensible record"
   893   OuterSyntax.command "record" "define extensible record"
   894     (record_decl >> (fn (x, (y, z)) => Toplevel.theory (add_record x y z)));
   894     (record_decl >> (fn (x, (y, z)) => Toplevel.theory (add_record x y z)));
   895 
   895 
   896 val _ = OuterSyntax.add_parsers [recordP];
   896 val _ = OuterSyntax.add_parsers [recordP];
   897 
   897 
   898 end;
   898 end;
   899 
   899 
       
   900 
       
   901 end;
   900 
   902 
   901 structure BasicRecordPackage: BASIC_RECORD_PACKAGE = RecordPackage;
   903 structure BasicRecordPackage: BASIC_RECORD_PACKAGE = RecordPackage;
   902 open BasicRecordPackage;
   904 open BasicRecordPackage;