diff options
author | michelou <michelou@epfl.ch> | 2006-06-13 09:25:08 +0000 |
---|---|---|
committer | michelou <michelou@epfl.ch> | 2006-06-13 09:25:08 +0000 |
commit | e5556bbbe0821456afbe9c0a55f4de53ed05d4ad (patch) | |
tree | 9d2aecda3c06ad9e915a094d215a0475c15b7e5e /src | |
parent | 66adf790088b0b1b1027393e08790c4ae84e24aa (diff) | |
download | scala-e5556bbbe0821456afbe9c0a55f4de53ed05d4ad.tar.gz scala-e5556bbbe0821456afbe9c0a55f4de53ed05d4ad.tar.bz2 scala-e5556bbbe0821456afbe9c0a55f4de53ed05d4ad.zip |
removed leading/trailing tabs/spaces
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/tools/nsc/MainTokenMetric.scala | 55 |
1 files changed, 28 insertions, 27 deletions
diff --git a/src/compiler/scala/tools/nsc/MainTokenMetric.scala b/src/compiler/scala/tools/nsc/MainTokenMetric.scala index 4e5c64688d..0fe6e0a2cc 100644 --- a/src/compiler/scala/tools/nsc/MainTokenMetric.scala +++ b/src/compiler/scala/tools/nsc/MainTokenMetric.scala @@ -1,61 +1,62 @@ -/* NSC -- new scala compiler - * Copyright 2005 LAMP/EPFL +/* NSC -- new Scala compiler + * Copyright 2005-2006 LAMP/EPFL * @author Martin Odersky */ // $Id$ -package scala.tools.nsc; -//import java.io._; -import scala.tools.nsc.reporters.{Reporter, ConsoleReporter}; +package scala.tools.nsc + +//import java.io._ +import scala.tools.nsc.reporters.{Reporter, ConsoleReporter} /** The main class for NSC, a compiler for the programming * language Scala. */ object MainTokenMetric { - private var reporter: ConsoleReporter = _; + private var reporter: ConsoleReporter = _ def tokenMetric(compiler: Global, fnames: List[String]): unit = { - import compiler.CompilationUnit; - import compiler.syntaxAnalyzer.Scanner; - import ast.parser.Tokens.EOF; - var totale = 0; + import compiler.CompilationUnit + import compiler.syntaxAnalyzer.Scanner + import ast.parser.Tokens.EOF + var totale = 0 for (val source <- fnames) { - val s = new Scanner(new CompilationUnit(compiler.getSourceFile(source))); - var i = 0; + val s = new Scanner(new CompilationUnit(compiler.getSourceFile(source))) + var i = 0 while(s.token != EOF) { - i = i + 1; + i = i + 1 s.nextToken() } var j = 0 ; while(j + Math.log(i)/ Math.log(10) < 7) { - j = j+1; - Console.print(' '); + j = j+1 + Console.print(' ') } - Console.print(i.toString()); - Console.print(" "); - Console.println(source.toString()); - totale = totale + i; + Console.print(i.toString()) + Console.print(" ") + Console.println(source.toString()) + totale = totale + i } - Console.println(totale.toString()+" total"); + Console.println(totale.toString()+" total") } def process(args: Array[String]): unit = { - val command = new CompilerCommand(List.fromArray(args), error, false); - reporter = new ConsoleReporter(); + val command = new CompilerCommand(List.fromArray(args), error, false) + reporter = new ConsoleReporter() try { - val compiler = new Global(command.settings, reporter); - tokenMetric(compiler, command.files); + val compiler = new Global(command.settings, reporter) + tokenMetric(compiler, command.files) } catch { case ex @ FatalError(msg) => if (command.settings.debug.value) ex.printStackTrace(); - reporter.error(null, "fatal error: " + msg); + reporter.error(null, "fatal error: " + msg) } } def main(args: Array[String]): unit = { - process(args); - System.exit(if (reporter.errors > 0) 1 else 0); + process(args) + System.exit(if (reporter.errors > 0) 1 else 0) } } |