src/Pure/System/isabelle_tool.scala
changeset 62960 cfbb6a5b427c
parent 62838 c91ca9935280
child 63226 d8884c111bca
     1.1 --- a/src/Pure/System/isabelle_tool.scala	Tue Apr 12 14:50:53 2016 +0200
     1.2 +++ b/src/Pure/System/isabelle_tool.scala	Tue Apr 12 15:00:26 2016 +0200
     1.3 @@ -50,34 +50,27 @@
     1.4  
     1.5    /* internal tools */
     1.6  
     1.7 -  private var internal_tools = Map.empty[String, (String, List[String] => Nothing)]
     1.8 +  private val internal_tools: List[Isabelle_Tool] =
     1.9 +    List(
    1.10 +      Build.isabelle_tool,
    1.11 +      Build_Doc.isabelle_tool,
    1.12 +      Check_Sources.isabelle_tool,
    1.13 +      Doc.isabelle_tool,
    1.14 +      ML_Process.isabelle_tool,
    1.15 +      Options.isabelle_tool,
    1.16 +      Update_Cartouches.isabelle_tool,
    1.17 +      Update_Header.isabelle_tool,
    1.18 +      Update_Then.isabelle_tool,
    1.19 +      Update_Theorems.isabelle_tool)
    1.20  
    1.21    private def list_internal(): List[(String, String)] =
    1.22 -    synchronized {
    1.23 -      for ((name, (description, _)) <- internal_tools.toList) yield (name, description)
    1.24 -    }
    1.25 +    for (tool <- internal_tools.toList) yield (tool.name, tool.description)
    1.26  
    1.27    private def find_internal(name: String): Option[List[String] => Unit] =
    1.28 -    synchronized { internal_tools.get(name).map(_._2) }
    1.29 -
    1.30 -  private def register(isabelle_tool: Isabelle_Tool): Unit =
    1.31 -    synchronized {
    1.32 -      internal_tools +=
    1.33 -        (isabelle_tool.name ->
    1.34 -          (isabelle_tool.description,
    1.35 -            args => Command_Line.tool0 { isabelle_tool.body(args) }))
    1.36 -    }
    1.37 -
    1.38 -  register(Build.isabelle_tool)
    1.39 -  register(Build_Doc.isabelle_tool)
    1.40 -  register(Check_Sources.isabelle_tool)
    1.41 -  register(Doc.isabelle_tool)
    1.42 -  register(ML_Process.isabelle_tool)
    1.43 -  register(Options.isabelle_tool)
    1.44 -  register(Update_Cartouches.isabelle_tool)
    1.45 -  register(Update_Header.isabelle_tool)
    1.46 -  register(Update_Then.isabelle_tool)
    1.47 -  register(Update_Theorems.isabelle_tool)
    1.48 +    internal_tools.collectFirst({
    1.49 +      case tool if tool.name == name =>
    1.50 +        args => Command_Line.tool0 { tool.body(args) }
    1.51 +      })
    1.52  
    1.53  
    1.54    /* command line entry point */