src/Pure/Pure.thy
changeset 67283 0493be7f2d9b
parent 67281 338fb884286b
child 67386 998e01d6f8fd
equal deleted inserted replaced
67282:352c2c93a1c0 67283:0493be7f2d9b
   109 
   109 
   110 subsection \<open>Other files\<close>
   110 subsection \<open>Other files\<close>
   111 
   111 
   112 ML \<open>
   112 ML \<open>
   113 local
   113 local
   114   fun check_path ctxt (s, pos) =
       
   115     let
       
   116       val _ = Context_Position.report ctxt pos Markup.language_path;
       
   117       val path = Path.explode s;
       
   118       val _ = Context_Position.report ctxt pos (Markup.path (Path.smart_implode path));
       
   119     in () end;
       
   120 
       
   121   val _ =
   114   val _ =
   122     Outer_Syntax.command \<^command_keyword>\<open>external_file\<close> "formal dependency on external file"
   115     Outer_Syntax.command \<^command_keyword>\<open>external_file\<close> "formal dependency on external file"
   123       (Parse.position Parse.path >> (fn path => Toplevel.keep (fn st =>
   116       (Parse.position Parse.path >> (fn path => Toplevel.keep (fn st =>
   124         check_path (Toplevel.context_of st) path)));
   117         let
       
   118           val ctxt = Toplevel.context_of st;
       
   119           val thy = Toplevel.theory_of st;
       
   120           val _ = Resources.check_path ctxt (Resources.master_directory thy) path;
       
   121         in () end)));
   125 
   122 
   126   val _ =
   123   val _ =
   127     Outer_Syntax.command \<^command_keyword>\<open>bibtex_file\<close> "check bibtex database file in Prover IDE"
   124     Outer_Syntax.command \<^command_keyword>\<open>bibtex_file\<close> "check bibtex database file in Prover IDE"
   128       (Scan.ahead Parse.not_eof -- Parse.position Parse.path >> (fn (tok, path) =>
   125       (Scan.ahead Parse.not_eof -- Parse.position Parse.path >> (fn (tok, path) =>
   129         Toplevel.keep (fn st =>
   126         Toplevel.keep (fn st =>
   130           let
   127           let
   131             val ctxt = Toplevel.context_of st;
   128             val ctxt = Toplevel.context_of st;
   132             val _ = check_path ctxt path;
   129             val thy = Toplevel.theory_of st;
       
   130             val _ = Resources.check_path ctxt (Resources.master_directory thy) path;
   133             val _ =
   131             val _ =
   134               (case Token.get_files tok of
   132               (case Token.get_files tok of
   135                 [Exn.Res {lines, pos, ...}] => Bibtex.check_database_output pos (cat_lines lines)
   133                 [Exn.Res {lines, pos, ...}] => Bibtex.check_database_output pos (cat_lines lines)
   136               | _ => ());
   134               | _ => ());
   137           in () end)));
   135           in () end)));