summaryrefslogtreecommitdiff
path: root/sources/scalac/Global.java
diff options
context:
space:
mode:
authorpaltherr <paltherr@epfl.ch>2003-06-16 12:37:20 +0000
committerpaltherr <paltherr@epfl.ch>2003-06-16 12:37:20 +0000
commit9c9dfb24a48f11e175d8f82417e7b9c7ab78f7c7 (patch)
treeeada2530c9586b6c61afaedffa30c023a4d12c49 /sources/scalac/Global.java
parent97e75ddc91094834f60b868e16e14d3417359791 (diff)
downloadscala-9c9dfb24a48f11e175d8f82417e7b9c7ab78f7c7.tar.gz
scala-9c9dfb24a48f11e175d8f82417e7b9c7ab78f7c7.tar.bz2
scala-9c9dfb24a48f11e175d8f82417e7b9c7ab78f7c7.zip
- 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.
Diffstat (limited to 'sources/scalac/Global.java')
-rw-r--r--sources/scalac/Global.java16
1 files changed, 9 insertions, 7 deletions
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