src/Pure/Tools/build.ML
changeset 67219 81e9804b2014
parent 66873 9953ae603a23
child 67297 86a099f896fc
equal deleted inserted replaced
67218:e62d72699666 67219:81e9804b2014
   146   parent_name: string,
   146   parent_name: string,
   147   chapter: string,
   147   chapter: string,
   148   name: string,
   148   name: string,
   149   master_dir: Path.T,
   149   master_dir: Path.T,
   150   theories: (Options.T * (string * Position.T) list) list,
   150   theories: (Options.T * (string * Position.T) list) list,
       
   151   sessions: string list,
   151   global_theories: (string * string) list,
   152   global_theories: (string * string) list,
   152   loaded_theories: string list,
   153   loaded_theories: string list,
   153   known_theories: (string * string) list};
   154   known_theories: (string * string) list};
   154 
   155 
   155 fun decode_args yxml =
   156 fun decode_args yxml =
   156   let
   157   let
   157     open XML.Decode;
   158     open XML.Decode;
   158     val position = Position.of_properties o properties;
   159     val position = Position.of_properties o properties;
   159     val (symbol_codes, (command_timings, (do_output, (verbose, (browser_info,
   160     val (symbol_codes, (command_timings, (do_output, (verbose, (browser_info,
   160       (document_files, (graph_file, (parent_name, (chapter, (name, (master_dir,
   161       (document_files, (graph_file, (parent_name, (chapter, (name, (master_dir,
   161       (theories, (global_theories, (loaded_theories, known_theories)))))))))))))) =
   162       (theories, (sessions, (global_theories, (loaded_theories, known_theories))))))))))))))) =
   162       pair (list (pair string int)) (pair (list properties) (pair bool (pair bool (pair string
   163       pair (list (pair string int)) (pair (list properties) (pair bool (pair bool (pair string
   163         (pair (list (pair string string)) (pair string (pair string (pair string (pair string
   164         (pair (list (pair string string)) (pair string (pair string (pair string (pair string
   164           (pair string
   165           (pair string
   165             (pair (((list (pair Options.decode (list (pair string position))))))
   166             (pair (((list (pair Options.decode (list (pair string position))))))
   166               (pair (list (pair string string))
   167               (pair (list string) (pair (list (pair string string))
   167                 (pair (list string) (list (pair string string)))))))))))))))
   168                 (pair (list string) (list (pair string string))))))))))))))))
   168       (YXML.parse_body yxml);
   169       (YXML.parse_body yxml);
   169   in
   170   in
   170     Args {symbol_codes = symbol_codes, command_timings = command_timings, do_output = do_output,
   171     Args {symbol_codes = symbol_codes, command_timings = command_timings, do_output = do_output,
   171       verbose = verbose, browser_info = Path.explode browser_info,
   172       verbose = verbose, browser_info = Path.explode browser_info,
   172       document_files = map (apply2 Path.explode) document_files,
   173       document_files = map (apply2 Path.explode) document_files,
   173       graph_file = Path.explode graph_file, parent_name = parent_name, chapter = chapter,
   174       graph_file = Path.explode graph_file, parent_name = parent_name, chapter = chapter,
   174       name = name, master_dir = Path.explode master_dir, theories = theories,
   175       name = name, master_dir = Path.explode master_dir, theories = theories, sessions = sessions,
   175       global_theories = global_theories, loaded_theories = loaded_theories,
   176       global_theories = global_theories, loaded_theories = loaded_theories,
   176       known_theories = known_theories}
   177       known_theories = known_theories}
   177   end;
   178   end;
   178 
   179 
   179 fun build_session (Args {symbol_codes, command_timings, do_output, verbose, browser_info,
   180 fun build_session (Args {symbol_codes, command_timings, do_output, verbose, browser_info,
   180     document_files, graph_file, parent_name, chapter, name, master_dir, theories,
   181     document_files, graph_file, parent_name, chapter, name, master_dir, theories, sessions,
   181     global_theories, loaded_theories, known_theories}) =
   182     global_theories, loaded_theories, known_theories}) =
   182   let
   183   let
   183     val symbols = HTML.make_symbols symbol_codes;
   184     val symbols = HTML.make_symbols symbol_codes;
   184 
   185 
   185     val _ =
   186     val _ =
   186       Resources.init_session_base
   187       Resources.init_session_base
   187         {global_theories = global_theories,
   188         {sessions = sessions,
       
   189          global_theories = global_theories,
   188          loaded_theories = loaded_theories,
   190          loaded_theories = loaded_theories,
   189          known_theories = known_theories};
   191          known_theories = known_theories};
   190 
   192 
   191     val _ =
   193     val _ =
   192       Session.init
   194       Session.init