src/Pure/Thy/thy_header.ML
changeset 58864 505a8150368a
parent 58863 64e571275b36
child 58868 c5e1cce7ace3
equal deleted inserted replaced
58863:64e571275b36 58864:505a8150368a
   125 
   125 
   126 fun token_source pos str =
   126 fun token_source pos str =
   127   str
   127   str
   128   |> Source.of_string_limited 8000
   128   |> Source.of_string_limited 8000
   129   |> Symbol.source
   129   |> Symbol.source
   130   |> Token.source {do_recover = false} (K header_lexicons) pos;
   130   |> Token.source_strict (K header_lexicons) pos;
   131 
   131 
   132 fun read_source pos source =
   132 fun read_source pos source =
   133   let val res =
   133   let val res =
   134     source
   134     source
   135     |> Token.source_proper
   135     |> Token.source_proper
   136     |> Source.source Token.stopper (Scan.single (Scan.error (Parse.!!! header))) NONE
   136     |> Source.source Token.stopper (Scan.single (Scan.error (Parse.!!! header)))
   137     |> Source.get_single;
   137     |> Source.get_single;
   138   in
   138   in
   139     (case res of
   139     (case res of
   140       SOME (h, _) => h
   140       SOME (h, _) => h
   141     | NONE => error ("Unexpected end of input" ^ Position.here pos))
   141     | NONE => error ("Unexpected end of input" ^ Position.here pos))