[Nice-commit] Nice/src/bossa/modules Package.java,1.92,1.93 DirectorySourceContent.java,1.1,1.2 Dire
Brought to you by:
bonniot
Update of /cvsroot/nice/Nice/src/bossa/modules In directory sc8-pr-cvs1:/tmp/cvs-serv20812/src/bossa/modules Modified Files: Package.java DirectorySourceContent.java DirectoryCompiledContent.java Content.java Compilation.nice Log Message: Refactored bossa.util.Location, to provide a higher-level view on locations, using several subclasses for the different cases. Index: Package.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/modules/Package.java,v retrieving revision 1.92 retrieving revision 1.93 diff -C2 -d -r1.92 -r1.93 *** Package.java 22 Jun 2003 09:51:56 -0000 1.92 --- Package.java 24 Jun 2003 15:28:19 -0000 1.93 *************** *** 41,45 **** boolean isRoot) { ! return make(new LocatedString(name, bossa.util.Location.nowhereAtAll()), compilation, isRoot); } --- 41,45 ---- boolean isRoot) { ! return make(new LocatedString(name, Location.option), compilation, isRoot); } Index: DirectorySourceContent.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/modules/DirectorySourceContent.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** DirectorySourceContent.java 30 Oct 2001 15:38:24 -0000 1.1 --- DirectorySourceContent.java 24 Jun 2003 15:28:19 -0000 1.2 *************** *** 67,71 **** Content.Unit[] res = new Content.Unit[sources.length]; for(int i = 0; i<res.length; i++) ! res[i] = new Content.Unit(read(sources[i]), sources[i].toString()); return res; --- 67,71 ---- Content.Unit[] res = new Content.Unit[sources.length]; for(int i = 0; i<res.length; i++) ! res[i] = new Content.Unit(read(sources[i]), sources[i]); return res; Index: DirectoryCompiledContent.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/modules/DirectoryCompiledContent.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** DirectoryCompiledContent.java 31 May 2003 17:31:49 -0000 1.7 --- DirectoryCompiledContent.java 24 Jun 2003 15:28:19 -0000 1.8 *************** *** 57,61 **** Content.Unit[] getDefinitions() { ! return new Content.Unit[]{ new Content.Unit(read(itf), itf.toString()) }; } --- 57,61 ---- Content.Unit[] getDefinitions() { ! return new Content.Unit[]{ new Content.Unit(read(itf), itf) }; } Index: Content.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/modules/Content.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Content.java 25 Nov 2002 18:58:31 -0000 1.9 --- Content.java 24 Jun 2003 15:28:19 -0000 1.10 *************** *** 102,106 **** private void read(Content.Unit unit, List imports, Set opens) { ! bossa.util.Location.setCurrentFile(unit.name); bossa.syntax.LocatedString pkgName = --- 102,106 ---- private void read(Content.Unit unit, List imports, Set opens) { ! bossa.util.Location.setCurrentFile(unit.file); bossa.syntax.LocatedString pkgName = *************** *** 114,118 **** private void read(Content.Unit unit, List definitions) { ! bossa.util.Location.setCurrentFile(unit.name); bossa.parser.Loader.open(unit.reader, definitions); } --- 114,118 ---- private void read(Content.Unit unit, List definitions) { ! bossa.util.Location.setCurrentFile(unit.file); bossa.parser.Loader.open(unit.reader, definitions); } *************** *** 249,252 **** --- 249,257 ---- static protected class Unit { + protected Unit(BufferedReader reader, File file) + { + this.reader = reader; + this.file = file; + } protected Unit(BufferedReader reader, String name) { *************** *** 256,259 **** --- 261,265 ---- BufferedReader reader; String name; + File file; } Index: Compilation.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/modules/Compilation.nice,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** Compilation.nice 15 Jun 2003 11:07:45 -0000 1.24 --- Compilation.nice 24 Jun 2003 15:28:19 -0000 1.25 *************** *** 83,87 **** Package.make("nice.lang", this, false); ! this.root = Package.make(new bossa.syntax.LocatedString(packageName, new bossa.util.Location("Command line")), this, true); } --- 83,90 ---- Package.make("nice.lang", this, false); ! this.root = Package.make ! (new bossa.syntax.LocatedString(packageName, ! bossa.util.Location.option), ! this, true); } |