src/Pure/Tools/update_semicolons.scala
author wenzelm
Mon, 03 Nov 2014 14:50:27 +0100
changeset 58893 9e0ecb66d6a7
parent 58861 5ff61774df11
child 59083 88b0b1f28adc
permissions -rw-r--r--
eliminated unused int_only flag (see also c12484a27367); just proper commands;

/*  Title:      Pure/Tools/update_semicolons.scala
    Author:     Makarius

Remove obsolete semicolons from theory sources.
*/

package isabelle


object Update_Semicolons
{
  def update_semicolons(path: Path)
  {
    val text0 = File.read(path)
    val text1 =
      (for (tok <- Outer_Syntax.empty.scan(text0).iterator if tok.source != ";")
        yield tok.source).mkString

    if (text0 != text1) {
      Output.writeln("changing " + path)
      File.write_backup2(path, text1)
    }
  }


  /* command line entry point */

  def main(args: Array[String])
  {
    Command_Line.tool0 {
      args.foreach(arg => update_semicolons(Path.explode(arg)))
    }
  }
}