if (str.length) {
File.append(this.target, str + "\n");
}
+ if (this.cleanup) {
+ File.remove(transmd5);
+ }
}
if (File.exists(transfile)) {
var str = File.read(transfile);
if (str.length) {
File.append(this.translateJson, str);
}
+ if (this.cleanup) {
+ File.remove(transfile);
+ }
}
for(var i=0; i < files.length; i++) {
var minfile = bpath + '/' + this.files.replace(/\//g, '.');
+
+
if (!File.exists(minfile)) {
continue;
}
if (str.length) {
File.append(this.target, str + "\n");
}
- }
-
-
- //File.append(dout, "\n");// end the function
- if (this.cleanup) {
-
-
+ if (this.cleanup) {
+ File.remove(minfile);
+ }
}
+
+
},
pack : function (str,fn,minfile)
{
- var tr = new TokenReader();
+ var tr = new TokenReader( { keepDocs :true, keepWhite : true, keepComments : true, sepIdents : true });
this.timerPrint("START" + fn);
// we can load translation map here...
- var toks = tr.tokenize(str,false); // dont merge xxx + . + yyyy etc.
+ var toks = tr.tokenize(new TextStream(str)); // dont merge xxx + . + yyyy etc.
// at this point we can write a language file...
- if (this.translate) {
+ if (this.translateJson) {
this.writeTranslateFile(fn, minfile, tr.translateMap);
}
// and replace if we are generating a different language..
-
-
-
this.timerPrint("Tokenized");
//return;//
- var sp = new ScopeParser(new TokenStream(toks, str.length));
+ var sp = new ScopeParser(new TokenStream(toks));
this.timerPrint("Converted to Parser");
sp.packer = this;
sp.buildSymbolTree();
this.timerPrint("Compressed");
return out;
+
+
},
timerPrint: function (str) {
// print("TURNED OFF");
return tok.outData;
}
- if (tok.qc != '"') {
+ if (tok.name == SINGLE_QUOTE) {
return tok.outData;
}
var sval = tok.data.substring(1,tok.data.length-1);