src/Pure/Isar/isar_syn.ML
changeset 59901 840d03805755
parent 59890 01aff5aa081d
child 59917 9830c944670f
equal deleted inserted replaced
59900:a5591a15112e 59901:840d03805755
   371   Parse_Spec.locale_expression false --
   371   Parse_Spec.locale_expression false --
   372     Scan.optional (@{keyword "+"} |-- Parse.!!! (Scan.repeat1 Parse_Spec.context_element)) [] ||
   372     Scan.optional (@{keyword "+"} |-- Parse.!!! (Scan.repeat1 Parse_Spec.context_element)) [] ||
   373   Scan.repeat1 Parse_Spec.context_element >> pair ([], []);
   373   Scan.repeat1 Parse_Spec.context_element >> pair ([], []);
   374 
   374 
   375 val _ =
   375 val _ =
   376   Outer_Syntax.command @{command_spec "locale"} "define named proof context"
   376   Outer_Syntax.command @{command_spec "locale"} "define named specification context"
   377     (Parse.binding --
   377     (Parse.binding --
   378       Scan.optional (@{keyword "="} |-- Parse.!!! locale_val) (([], []), []) -- Parse.opt_begin
   378       Scan.optional (@{keyword "="} |-- Parse.!!! locale_val) (([], []), []) -- Parse.opt_begin
   379       >> (fn ((name, (expr, elems)), begin) =>
   379       >> (fn ((name, (expr, elems)), begin) =>
   380           Toplevel.begin_local_theory begin
   380           Toplevel.begin_local_theory begin
   381             (Expression.add_locale_cmd name Binding.empty expr elems #> snd)));
   381             (Expression.add_locale_cmd name Binding.empty expr elems #> snd)));
       
   382 
       
   383 val _ =
       
   384   Outer_Syntax.command @{command_spec "experiment"} "open private specification context"
       
   385     (Scan.repeat Parse_Spec.context_element --| Parse.begin
       
   386       >> (fn elems =>
       
   387           Toplevel.begin_local_theory true (Experiment.experiment_cmd elems #> snd)));
   382 
   388 
   383 fun interpretation_args mandatory =
   389 fun interpretation_args mandatory =
   384   Parse.!!! (Parse_Spec.locale_expression mandatory) --
   390   Parse.!!! (Parse_Spec.locale_expression mandatory) --
   385     Scan.optional
   391     Scan.optional
   386       (Parse.where_ |-- Parse.and_list1 (Parse_Spec.opt_thm_name ":" -- Parse.prop)) [];
   392       (Parse.where_ |-- Parse.and_list1 (Parse_Spec.opt_thm_name ":" -- Parse.prop)) [];