Changeset 1761
- Timestamp:
- 05/02/10 15:37:24 (3 years ago)
- Location:
- src/jomdoc/trunk/src
- Files:
-
- 13 added
- 7 modified
-
jomdoc/org/omdoc/jomdoc/lang/OMDocContainer.java (modified) (1 diff)
-
jomdoc/org/omdoc/jomdoc/lang/OMDocDocument.java (modified) (2 diffs)
-
jomdoc/org/omdoc/jomdoc/lang/attributes/OMName.java (modified) (1 diff)
-
jomdoc/org/omdoc/jomdoc/lang/math/om/OMS.java (modified) (1 diff)
-
jomdoc/org/omdoc/jomdoc/lang/theories/Theory.java (modified) (1 diff)
-
jomdoc/org/omdoc/jomdoc/transform/CircularImportsResolver.java (added)
-
jomdoc/org/omdoc/jomdoc/util/etc/IOUtil.java (modified) (2 diffs)
-
test/org/omdoc/jomdoc/coll/ntn/ImportsAwareTest.java (modified) (1 diff)
-
test/org/omdoc/jomdoc/transform/CircularImportsResolverTest.java (added)
-
testdata/flattening/circular (added)
-
testdata/flattening/circular/3 (added)
-
testdata/flattening/circular/3/a.omdoc (added)
-
testdata/flattening/circular/3/b.omdoc (added)
-
testdata/flattening/circular/3/c.omdoc (added)
-
testdata/flattening/circular/3/resolved (added)
-
testdata/flattening/circular/3/resolved/a.omdoc (added)
-
testdata/flattening/circular/3/resolved/b-c.omdoc (added)
-
testdata/flattening/circular/3/resolved/b.omdoc (added)
-
testdata/flattening/circular/3/resolved/c.omdoc (added)
-
testdata/notations/imports/imports-aware/vd.exp (added)
Legend:
- Unmodified
- Added
- Removed
-
src/jomdoc/trunk/src/jomdoc/org/omdoc/jomdoc/lang/OMDocContainer.java
r1746 r1761 129 129 } 130 130 131 public static Stack<String> getStack() { 132 return stack.get(); 133 } 134 131 135 /** 132 136 * Print the contents of the stack -
src/jomdoc/trunk/src/jomdoc/org/omdoc/jomdoc/lang/OMDocDocument.java
r1760 r1761 18 18 19 19 import java.net.URI; 20 import java.net.URISyntaxException; 20 21 import java.util.ArrayList; 21 22 import java.util.List; 23 import java.util.logging.Level; 24 import java.util.logging.Logger; 22 25 import nu.xom.Attribute; 23 26 import nu.xom.Document; … … 160 163 161 164 public void setCDBase(URI cdBase) { 165 if (!cdBase.isAbsolute()) { 166 try { 167 cdBase = new URI("file:" + cdBase.toString()); 168 } catch (URISyntaxException ex) { 169 } 170 } 162 171 this.cdBase = cdBase; 163 172 modify(); -
src/jomdoc/trunk/src/jomdoc/org/omdoc/jomdoc/lang/attributes/OMName.java
r1700 r1761 97 97 } 98 98 99 public void setCd(String cd) { 100 this.cd = cd; 101 } 102 103 public void setCdbase(URI cdbase) { 104 this.cdbase = cdbase; 105 } 106 107 public void setName(String name) { 108 this.name = name; 109 } 110 99 111 @Override 100 112 public String toString() { -
src/jomdoc/trunk/src/jomdoc/org/omdoc/jomdoc/lang/math/om/OMS.java
r1573 r1761 100 100 } 101 101 102 public void setCDBase(URI cdbase) { 103 symbolID.setCdbase(cdbase); 104 symbol = null; 105 modify(); 106 } 107 102 108 public String getCD() { 103 109 return symbolID.getCD(); 104 110 } 105 111 106 public String getTheoryName() { 112 public void setCD(String cd) { 113 symbolID.setCd(cd); 114 symbol = null; 115 modify(); 116 } 117 118 public String getName() { 107 119 return symbolID.getName(); 120 } 121 122 public void setName(String name) { 123 symbolID.setName(name); 124 symbol = null; 125 modify(); 108 126 } 109 127 -
src/jomdoc/trunk/src/jomdoc/org/omdoc/jomdoc/lang/theories/Theory.java
r1700 r1761 176 176 } 177 177 178 public String get TheoryId() {178 public String getId() { 179 179 String ret = getName(); 180 180 if (ret == null) { 181 181 ret = getID(); 182 182 } 183 ret = "#" + ret; 184 183 return ret; 184 } 185 186 public String getTheoryId() { 187 String ret = "#" + getId(); 185 188 URI docURI = getOMDocDocument().getCDBase(); 186 189 if (docURI != null) { 187 190 ret = docURI.toString() + ret; 188 191 } 189 190 192 return ret; 191 193 } -
src/jomdoc/trunk/src/jomdoc/org/omdoc/jomdoc/util/etc/IOUtil.java
r1695 r1761 19 19 import java.io.File; 20 20 import java.io.FileInputStream; 21 import java.io.IOException; 21 22 import java.net.URISyntaxException; 22 23 import java.net.URL; 23 24 import java.net.URI; 24 25 import java.util.ArrayList; 26 import java.util.Collection; 27 import java.util.Collections; 28 import java.util.Comparator; 25 29 import java.util.List; 26 30 import java.util.jar.JarEntry; 27 31 import java.util.jar.JarInputStream; 32 import nu.xom.ParsingException; 33 import org.apache.commons.io.FileUtils; 28 34 import org.apache.commons.io.filefilter.FileFileFilter; 35 import org.omdoc.jomdoc.lang.OMDocDocument; 36 import org.omdoc.jomdoc.parser.Parser; 29 37 import org.omdoc.jomdoc.util.err.ErrorUtil; 38 import org.omdoc.jomdoc.util.xml.XMLUtil; 30 39 31 40 /** … … 221 230 } 222 231 } 232 233 public static List<OMDocDocument> getOMDocs(File dir) throws URISyntaxException, IOException, ParsingException { 234 List<OMDocDocument> ret = new ArrayList<OMDocDocument>(); 235 Collection<File> files = FileUtils.listFiles(dir, new String[]{"omdoc"}, true); 236 List<File> tmp = new ArrayList<File>(files); 237 Collections.<File>sort(tmp, new Comparator<File>() { 238 public int compare(File o1, File o2) { 239 return o1.getPath().compareTo(o2.getPath()); 240 } 241 }); 242 for (File f : tmp) { 243 ret.add(Parser.parse(XMLUtil.buildDocument(f))); 244 } 245 return ret; 246 } 223 247 } -
src/jomdoc/trunk/src/test/org/omdoc/jomdoc/coll/ntn/ImportsAwareTest.java
r1737 r1761 44 44 public static String CDBASES_PATH = IMPORTS_PATH + "cdbases/"; 45 45 46 // @Ignore 47 @Test 48 public void testVirtualDocument() { 49 String exp = IMPORTS_AWARE_PATH + "vd.exp"; 50 String inp = "/home/dimitar/projects/slides/dmath/en/generated-exam.omdoc"; 51 render("-t", inp, "-o", exp); 52 // render("-t", "-p", inp, "-o", TMP); 53 // Assert.assertTrue(pdiff(exp, TMP)); 54 } 55 46 56 @Ignore 47 57 @Test
