equal
deleted
inserted
replaced
284 ((P.name --| P.$$$ "=") -- P.text -- P.marg_comment >> (Toplevel.theory o IsarThy.add_oracle)); |
284 ((P.name --| P.$$$ "=") -- P.text -- P.marg_comment >> (Toplevel.theory o IsarThy.add_oracle)); |
285 |
285 |
286 |
286 |
287 (* locales *) |
287 (* locales *) |
288 |
288 |
289 val locale_decl = |
289 val locale_val = |
290 (P.name --| P.$$$ "=") -- |
290 (P.locale_expr -- |
291 (P.locale_expr -- Scan.optional |
291 Scan.optional (P.$$$ "+" |-- P.!!! (Scan.repeat1 (P.locale_element -- P.marg_comment))) [] || |
292 (P.$$$ "+" |-- P.!!! (Scan.repeat1 (P.locale_element -- P.marg_comment))) [] || |
292 Scan.repeat1 (P.locale_element -- P.marg_comment) >> pair Locale.empty); |
293 Scan.repeat1 (P.locale_element -- P.marg_comment) >> pair Locale.empty) >> P.triple2; |
|
294 |
293 |
295 val localeP = |
294 val localeP = |
296 OuterSyntax.command "locale" "define named proof context" K.thy_decl |
295 OuterSyntax.command "locale" "define named proof context" K.thy_decl |
297 (locale_decl >> (Toplevel.theory o IsarThy.add_locale)); |
296 ((P.name --| P.$$$ "=") -- locale_val >> (Toplevel.theory o IsarThy.add_locale o P.triple2)); |
298 |
297 |
299 |
298 |
300 |
299 |
301 (** proof commands **) |
300 (** proof commands **) |
302 |
301 |
561 OuterSyntax.improper_command "print_locales" "print locales of this theory" K.diag |
560 OuterSyntax.improper_command "print_locales" "print locales of this theory" K.diag |
562 (Scan.succeed (Toplevel.no_timing o IsarCmd.print_locales)); |
561 (Scan.succeed (Toplevel.no_timing o IsarCmd.print_locales)); |
563 |
562 |
564 val print_localeP = |
563 val print_localeP = |
565 OuterSyntax.improper_command "print_locale" "print named locale of this theory" K.diag |
564 OuterSyntax.improper_command "print_locale" "print named locale of this theory" K.diag |
566 (P.locale_expr >> (Toplevel.no_timing oo IsarCmd.print_locale)); |
565 (locale_val >> (Toplevel.no_timing oo IsarCmd.print_locale)); |
567 |
566 |
568 val print_attributesP = |
567 val print_attributesP = |
569 OuterSyntax.improper_command "print_attributes" "print attributes of this theory" K.diag |
568 OuterSyntax.improper_command "print_attributes" "print attributes of this theory" K.diag |
570 (Scan.succeed (Toplevel.no_timing o IsarCmd.print_attributes)); |
569 (Scan.succeed (Toplevel.no_timing o IsarCmd.print_attributes)); |
571 |
570 |