src/Pure/Thy/thy_header.ML
changeset 46737 09ab89658a5d
parent 44357 5f5649ac8235
child 46938 cda018294515
equal deleted inserted replaced
46736:4dc7ddb47350 46737:09ab89658a5d
     6 
     6 
     7 signature THY_HEADER =
     7 signature THY_HEADER =
     8 sig
     8 sig
     9   val args: Token.T list -> (string * string list * (string * bool) list) * Token.T list
     9   val args: Token.T list -> (string * string list * (string * bool) list) * Token.T list
    10   val read: Position.T -> string -> string * string list * (Path.T * bool) list
    10   val read: Position.T -> string -> string * string list * (Path.T * bool) list
    11   val thy_path: string -> Path.T
       
    12   val consistent_name: string -> string -> unit
       
    13 end;
    11 end;
    14 
    12 
    15 structure Thy_Header: THY_HEADER =
    13 structure Thy_Header: THY_HEADER =
    16 struct
    14 struct
    17 
    15 
    65     (case res of
    63     (case res of
    66       SOME ((name, imports, uses), _) => (name, imports, map (apfst Path.explode) uses)
    64       SOME ((name, imports, uses), _) => (name, imports, map (apfst Path.explode) uses)
    67     | NONE => error ("Unexpected end of input" ^ Position.str_of pos))
    65     | NONE => error ("Unexpected end of input" ^ Position.str_of pos))
    68   end;
    66   end;
    69 
    67 
    70 
       
    71 (* file name *)
       
    72 
       
    73 val thy_path = Path.ext "thy" o Path.basic;
       
    74 
       
    75 fun consistent_name name name' =
       
    76   if name = name' then ()
       
    77   else error ("Bad file name " ^ Path.print (thy_path name) ^ " for theory " ^ quote name');
       
    78 
       
    79 end;
    68 end;