src/Pure/Isar/outer_syntax.ML
changeset 60693 044f8bb3dd30
parent 60691 0568c7a2b5db
child 60924 610794dff23c
equal deleted inserted replaced
60692:896704918a1f 60693:044f8bb3dd30
   170   Scan.option (Parse.position (Parse.private >> K true || Parse.qualified >> K false));
   170   Scan.option (Parse.position (Parse.private >> K true || Parse.qualified >> K false));
   171 
   171 
   172 fun parse_command thy =
   172 fun parse_command thy =
   173   Scan.ahead (before_command |-- Parse.position Parse.command_) :|-- (fn (name, pos) =>
   173   Scan.ahead (before_command |-- Parse.position Parse.command_) :|-- (fn (name, pos) =>
   174     let
   174     let
       
   175       val keywords = Thy_Header.get_keywords thy;
   175       val command_tags = Parse.command_ -- Parse.tags;
   176       val command_tags = Parse.command_ -- Parse.tags;
   176       val tr0 = Toplevel.empty |> Toplevel.name name |> Toplevel.position pos;
   177       val tr0 =
       
   178         Toplevel.empty
       
   179         |> Toplevel.name name
       
   180         |> Toplevel.position pos
       
   181         |> Keyword.is_proof_open keywords name ? Toplevel.skip_proof_open
       
   182         |> Keyword.is_proof_close keywords name ? Toplevel.skip_proof_close;
   177     in
   183     in
   178       (case lookup_commands thy name of
   184       (case lookup_commands thy name of
   179         SOME (Command {command_parser = Parser parse, ...}) =>
   185         SOME (Command {command_parser = Parser parse, ...}) =>
   180           Parse.!!! (command_tags |-- parse) >> (fn f => f tr0)
   186           Parse.!!! (command_tags |-- parse) >> (fn f => f tr0)
   181       | SOME (Command {command_parser = Restricted_Parser parse, ...}) =>
   187       | SOME (Command {command_parser = Restricted_Parser parse, ...}) =>