Changed readFile to java-based read function to handle \r\n, fixes docs and test, lite still broken
This commit is contained in:
parent
c26ae24a1b
commit
0121530083
3 changed files with 14 additions and 2 deletions
|
@ -2,7 +2,7 @@ load("build/js/json.js", "build/js/xml.js", "build/js/writeFile.js", "build/js/p
|
||||||
|
|
||||||
var dir = arguments[1];
|
var dir = arguments[1];
|
||||||
|
|
||||||
var c = parse( readFile(arguments[0]) );
|
var c = parse( read(arguments[0]) );
|
||||||
output( c, "docs" );
|
output( c, "docs" );
|
||||||
|
|
||||||
c = categorize( c );
|
c = categorize( c );
|
||||||
|
|
|
@ -5,3 +5,15 @@ function writeFile( file, stream ) {
|
||||||
buffer.print( stream );
|
buffer.print( stream );
|
||||||
buffer.close();
|
buffer.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function read( file ) {
|
||||||
|
var jq = new File(file);
|
||||||
|
var reader = new BufferedReader(new FileReader(jq));
|
||||||
|
var line = null;
|
||||||
|
var buffer = new java.lang.StringBuffer(jq.length());
|
||||||
|
while( (line = reader.readLine()) != null) {
|
||||||
|
buffer.append(line);
|
||||||
|
buffer.append("\n");
|
||||||
|
}
|
||||||
|
return buffer.toString();
|
||||||
|
}
|
|
@ -16,7 +16,7 @@ function addTestWrapper(name, test) {
|
||||||
}
|
}
|
||||||
|
|
||||||
var dir = arguments[1];
|
var dir = arguments[1];
|
||||||
var jq = parse( readFile( arguments[0] ) );
|
var jq = parse( read(arguments[0]) );
|
||||||
|
|
||||||
var testFile = [];
|
var testFile = [];
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue