src/Pure/Isar/outer_syntax.ML
changeset 74262 839a6e284545
parent 74183 af81e4a307be
child 74561 8e6c973003c8
equal deleted inserted replaced
74261:d28a51dd9da6 74262:839a6e284545
    69 
    69 
    70 fun pretty_command (cmd as (name, Command {comment, ...})) =
    70 fun pretty_command (cmd as (name, Command {comment, ...})) =
    71   Pretty.block
    71   Pretty.block
    72     (Pretty.marks_str
    72     (Pretty.marks_str
    73       ([Active.make_markup Markup.sendbackN {implicit = true, properties = [Markup.padding_line]},
    73       ([Active.make_markup Markup.sendbackN {implicit = true, properties = [Markup.padding_line]},
    74         command_markup false cmd], name) :: Pretty.str ":" :: Pretty.brk 2 :: Pretty.text comment);
    74         command_markup {def = false} cmd], name) :: Pretty.str ":" ::
       
    75         Pretty.brk 2 :: Pretty.text comment);
    75 
    76 
    76 
    77 
    77 (* theory data *)
    78 (* theory data *)
    78 
    79 
    79 structure Data = Theory_Data
    80 structure Data = Theory_Data
   122         (case lookup_commands thy name of
   123         (case lookup_commands thy name of
   123           NONE => ()
   124           NONE => ()
   124         | SOME cmd' => err_dup_command name [command_pos cmd, command_pos cmd']);
   125         | SOME cmd' => err_dup_command name [command_pos cmd, command_pos cmd']);
   125       val _ =
   126       val _ =
   126         Context_Position.report_generic (Context.the_generic_context ())
   127         Context_Position.report_generic (Context.the_generic_context ())
   127           (command_pos cmd) (command_markup true (name, cmd));
   128           (command_pos cmd) (command_markup {def = true} (name, cmd));
   128     in Data.map (Symtab.update (name, cmd)) thy end;
   129     in Data.map (Symtab.update (name, cmd)) thy end;
   129 
   130 
   130 val _ = Theory.setup (Theory.at_end (fn thy =>
   131 val _ = Theory.setup (Theory.at_end (fn thy =>
   131   let
   132   let
   132     val command_keywords =
   133     val command_keywords =
   286 fun command_reports thy tok =
   287 fun command_reports thy tok =
   287   if Token.is_command tok then
   288   if Token.is_command tok then
   288     let val name = Token.content_of tok in
   289     let val name = Token.content_of tok in
   289       (case lookup_commands thy name of
   290       (case lookup_commands thy name of
   290         NONE => []
   291         NONE => []
   291       | SOME cmd => [((Token.pos_of tok, command_markup false (name, cmd)), "")])
   292       | SOME cmd => [((Token.pos_of tok, command_markup {def = false} (name, cmd)), "")])
   292     end
   293     end
   293   else [];
   294   else [];
   294 
   295 
   295 fun check_command ctxt (name, pos) =
   296 fun check_command ctxt (name, pos) =
   296   let
   297   let