src/Pure/Isar/isar_syn.ML
changeset 20621 29d57880ba00
parent 20574 a10885a269cb
child 20803 ac78eee049ce
equal deleted inserted replaced
20620:8b26f58c5646 20621:29d57880ba00
   645 
   645 
   646 
   646 
   647 (** diagnostic commands (for interactive mode only) **)
   647 (** diagnostic commands (for interactive mode only) **)
   648 
   648 
   649 val opt_modes = Scan.optional (P.$$$ "(" |-- P.!!! (Scan.repeat1 P.xname --| P.$$$ ")")) [];
   649 val opt_modes = Scan.optional (P.$$$ "(" |-- P.!!! (Scan.repeat1 P.xname --| P.$$$ ")")) [];
   650 
   650 val opt_bang = Scan.optional (P.$$$ "!" >> K true) false;
   651 
   651 
   652 val pretty_setmarginP =
   652 val pretty_setmarginP =
   653   OuterSyntax.improper_command "pretty_setmargin" "change default margin for pretty printing"
   653   OuterSyntax.improper_command "pretty_setmargin" "change default margin for pretty printing"
   654     K.diag (P.nat >> (Toplevel.no_timing oo IsarCmd.pretty_setmargin));
   654     K.diag (P.nat >> (Toplevel.no_timing oo IsarCmd.pretty_setmargin));
   655 
   655 
   661   OuterSyntax.improper_command "print_context" "print theory context name" K.diag
   661   OuterSyntax.improper_command "print_context" "print theory context name" K.diag
   662     (Scan.succeed (Toplevel.no_timing o IsarCmd.print_context));
   662     (Scan.succeed (Toplevel.no_timing o IsarCmd.print_context));
   663 
   663 
   664 val print_theoryP =
   664 val print_theoryP =
   665   OuterSyntax.improper_command "print_theory" "print logical theory contents (verbose!)" K.diag
   665   OuterSyntax.improper_command "print_theory" "print logical theory contents (verbose!)" K.diag
   666     (Scan.succeed (Toplevel.no_timing o IsarCmd.print_theory));
   666     (opt_bang >> (Toplevel.no_timing oo IsarCmd.print_theory));
   667 
   667 
   668 val print_syntaxP =
   668 val print_syntaxP =
   669   OuterSyntax.improper_command "print_syntax" "print inner syntax of theory (verbose!)" K.diag
   669   OuterSyntax.improper_command "print_syntax" "print inner syntax of theory (verbose!)" K.diag
   670     (Scan.succeed (Toplevel.no_timing o IsarCmd.print_syntax));
   670     (Scan.succeed (Toplevel.no_timing o IsarCmd.print_syntax));
   671 
   671 
   678   OuterSyntax.improper_command "print_locales" "print locales of this theory" K.diag
   678   OuterSyntax.improper_command "print_locales" "print locales of this theory" K.diag
   679     (Scan.succeed (Toplevel.no_timing o IsarCmd.print_locales));
   679     (Scan.succeed (Toplevel.no_timing o IsarCmd.print_locales));
   680 
   680 
   681 val print_localeP =
   681 val print_localeP =
   682   OuterSyntax.improper_command "print_locale" "print locale expression in this theory" K.diag
   682   OuterSyntax.improper_command "print_locale" "print locale expression in this theory" K.diag
   683     (Scan.optional (P.$$$ "!" >> K true) false -- locale_val
   683     (opt_bang -- locale_val >> (Toplevel.no_timing oo IsarCmd.print_locale));
   684       >> (Toplevel.no_timing oo IsarCmd.print_locale));
       
   685 
   684 
   686 val print_registrationsP =
   685 val print_registrationsP =
   687   OuterSyntax.improper_command "print_interps"
   686   OuterSyntax.improper_command "print_interps"
   688     "print interpretations of named locale" K.diag
   687     "print interpretations of named locale" K.diag
   689     (Scan.optional (P.$$$ "!" >> K true) false -- P.xname
   688     (Scan.optional (P.$$$ "!" >> K true) false -- P.xname