From 9c9dfb24a48f11e175d8f82417e7b9c7ab78f7c7 Mon Sep 17 00:00:00 2001 From: paltherr Date: Mon, 16 Jun 2003 12:37:20 +0000 Subject: - Made SourceFile and Position scala-independan... - Made SourceFile and Position scala-independant (moved them to ch.epfl.lamp.util) - Added position arguments to methods of class Reporter - Changed printing of positions to display the whole path not only the file name. --- sources/scalac/Global.java | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'sources/scalac/Global.java') diff --git a/sources/scalac/Global.java b/sources/scalac/Global.java index 0f0a144632..51ecb2a7a6 100644 --- a/sources/scalac/Global.java +++ b/sources/scalac/Global.java @@ -8,6 +8,8 @@ package scalac; +import ch.epfl.lamp.util.SourceFile; + import java.io.*; import java.util.*; import scalac.util.*; @@ -231,7 +233,7 @@ public class Global { for (int i = 0; i < files.length; i++) { String file = files[i]; try { - units.add(new Unit(this, new Sourcefile(file), console)); + units.add(new Unit(this, new SourceFile(file), console)); } catch (FileNotFoundException e) { error("file " + file + " not found"); } catch (IOException e) { @@ -244,9 +246,9 @@ public class Global { /** the top-level compilation process */ - public void compile(String input, boolean console) { + public void compile(String filename, String input, boolean console) { reporter.resetCounters(); - Sourcefile source = new Sourcefile(input.getBytes()); + SourceFile source = new SourceFile(filename, input.getBytes()); units = new Unit[]{new Unit(this, source, console)}; compile(); } @@ -283,8 +285,8 @@ public class Global { imports.clear(); for (Iterator it = compiledNow.keySet().iterator(); it.hasNext();) { Symbol sym = (Symbol) it.next(); - Sourcefile f = (Sourcefile) compiledNow.get(sym); - sym.reset(new SourceCompleter(this, f.filename)); + SourceFile f = (SourceFile) compiledNow.get(sym); + sym.reset(new SourceCompleter(this, f.name())); } } compiledNow.clear(); @@ -472,13 +474,13 @@ public class Global { /** issue a global error */ public void error(String message) { - reporter.error("error: " + message); + reporter.error(null, message); } /** issue a global warning */ public void warning(String message) { - reporter.warning("warning: " + message); + reporter.warning(null, message); } /** issue an operation note -- cgit v1.2.3