src/Pure/Isar/isar_syn.ML
changeset 17142 76a5a2cc3171
parent 17139 165c97f9bb63
child 17219 515badbfc4d6
equal deleted inserted replaced
17141:4b0dc89de43b 17142:76a5a2cc3171
   312 
   312 
   313 val localeP =
   313 val localeP =
   314   OuterSyntax.command "locale" "define named proof context" K.thy_decl
   314   OuterSyntax.command "locale" "define named proof context" K.thy_decl
   315     ((P.opt_keyword "open" >> not) -- P.name
   315     ((P.opt_keyword "open" >> not) -- P.name
   316         -- Scan.optional (P.$$$ "=" |-- P.!!! locale_val) (Locale.empty, [])
   316         -- Scan.optional (P.$$$ "=" |-- P.!!! locale_val) (Locale.empty, [])
   317       >> (Toplevel.theory_context o (fn ((x, y), (z, w)) => Locale.add_locale_context x y z w)));
   317       >> (Toplevel.theory_context o (fn ((x, y), (z, w)) => Locale.add_locale_context x y z w #> (fn ((_, ctxt), thy) => (thy, ctxt)))));
   318 
   318 
   319 val opt_inst =
   319 val opt_inst =
   320   Scan.optional (P.$$$ "[" |-- Scan.repeat1 (P.maybe P.term) --| P.$$$ "]") [];
   320   Scan.optional (P.$$$ "[" |-- Scan.repeat1 (P.maybe P.term) --| P.$$$ "]") [];
   321 
   321 
   322 val interpretationP =
   322 val interpretationP =