src/Pure/Isar/outer_syntax.ML
changeset 68184 6c693b2700b3
parent 67499 bbb86f719d4b
child 68729 3a02b424d5fb
equal deleted inserted replaced
68183:6560324b1e4d 68184:6c693b2700b3
    23     (local_theory -> Proof.state) parser -> unit
    23     (local_theory -> Proof.state) parser -> unit
    24   val bootstrap: bool Config.T
    24   val bootstrap: bool Config.T
    25   val parse_tokens: theory -> Token.T list -> Toplevel.transition list
    25   val parse_tokens: theory -> Token.T list -> Toplevel.transition list
    26   val parse: theory -> Position.T -> string -> Toplevel.transition list
    26   val parse: theory -> Position.T -> string -> Toplevel.transition list
    27   val parse_spans: Token.T list -> Command_Span.span list
    27   val parse_spans: Token.T list -> Command_Span.span list
       
    28   val make_span: Token.T list -> Command_Span.span
    28   val command_reports: theory -> Token.T -> Position.report_text list
    29   val command_reports: theory -> Token.T -> Position.report_text list
    29   val check_command: Proof.context -> command_keyword -> string
    30   val check_command: Proof.context -> command_keyword -> string
    30 end;
    31 end;
    31 
    32 
    32 structure Outer_Syntax: OUTER_SYNTAX =
    33 structure Outer_Syntax: OUTER_SYNTAX =
   258 fun parse_spans toks =
   259 fun parse_spans toks =
   259   fold parse toks ([], [], []) |> flush |> rev;
   260   fold parse toks ([], [], []) |> flush |> rev;
   260 
   261 
   261 end;
   262 end;
   262 
   263 
       
   264 fun make_span toks =
       
   265   (case parse_spans toks of
       
   266     [span] => span
       
   267   | _ => Command_Span.Span (Command_Span.Malformed_Span, toks));
       
   268 
   263 
   269 
   264 (* check commands *)
   270 (* check commands *)
   265 
   271 
   266 fun command_reports thy tok =
   272 fun command_reports thy tok =
   267   if Token.is_command tok then
   273   if Token.is_command tok then