src/Pure/Tools/update.scala
changeset 70864 e94fec16bf50
parent 70863 d1299774543d
child 70868 bbb7d69f7a4d
equal deleted inserted replaced
70863:d1299774543d 70864:e94fec16bf50
    18   {
    18   {
    19     val context =
    19     val context =
    20       Dump.Context(options, progress = progress, dirs = dirs, select_dirs = select_dirs,
    20       Dump.Context(options, progress = progress, dirs = dirs, select_dirs = select_dirs,
    21         selection = selection)
    21         selection = selection)
    22 
    22 
       
    23     context.build_logic(logic)
       
    24 
    23     val path_cartouches = context.session_options.bool("update_path_cartouches")
    25     val path_cartouches = context.session_options.bool("update_path_cartouches")
    24 
    26 
    25     def update_xml(xml: XML.Body): XML.Body =
    27     def update_xml(xml: XML.Body): XML.Body =
    26       xml flatMap {
    28       xml flatMap {
    27         case XML.Wrapped_Elem(markup, body1, body2) =>
    29         case XML.Wrapped_Elem(markup, body1, body2) =>
    34           }
    36           }
    35         case XML.Elem(_, body) => update_xml(body)
    37         case XML.Elem(_, body) => update_xml(body)
    36         case t => List(t)
    38         case t => List(t)
    37       }
    39       }
    38 
    40 
    39     context.session(logic, log = log).process((args: Dump.Args) =>
    41     context.sessions(logic, log = log).foreach(_.process((args: Dump.Args) =>
    40       {
    42       {
    41         progress.echo("Processing theory " + args.print_node + " ...")
    43         progress.echo("Processing theory " + args.print_node + " ...")
    42 
    44 
    43         val snapshot = args.snapshot
    45         val snapshot = args.snapshot
    44         for ((node_name, node) <- snapshot.nodes) {
    46         for ((node_name, node) <- snapshot.nodes) {
    50           if (source1 != Symbol.encode(node.source)) {
    52           if (source1 != Symbol.encode(node.source)) {
    51             progress.echo("Updating " + node_name.path)
    53             progress.echo("Updating " + node_name.path)
    52             File.write(node_name.path, source1)
    54             File.write(node_name.path, source1)
    53           }
    55           }
    54         }
    56         }
    55       })
    57       }))
    56   }
    58   }
    57 
    59 
    58 
    60 
    59   /* Isabelle tool wrapper */
    61   /* Isabelle tool wrapper */
    60 
    62