* pack a javascript file, and return a shorter version!
*
* a bit picky at present with ; and crlf reading...
- *
+ * @arg ts {TokenStream}
+ @arg packer {Packer}
*/
-JSDOC.CompressWhite = function (ts, packer)
+
+CompressWhite = function (ts, packer)
{
ts.rewind();
if (!tok) {
break;
}
- if (tok._isWS) {
+ if (tok.type == "WHIT") {
continue;
//if (tok._isDoc) {
// continue;
}
// add semi-colon's where linebreaks are used... - not foolproof yet.!
- if (tok.isTypeN(Script.TOKidentifier)) {
+ if (tok.type == "NAME")) {
//var tokident = ts.look(-1).data + tok.data + ts.look(1).data + ts.look(2).data;
// a = new function() {}
- if (ts.look(1).isTypeN(Script.TOKassign) && ts.look(2).isTypeN(Script.TOKnew) &&
- ts.look(3).isTypeN(Script.TOKfunction)) {
+ if (ts.lookTok(1).data == '=' && ts.lookTok(2).name == 'NEW' &&
+ ts.look(3).name == 'FUNCTION') {
// freeze time..
var cu = ts.cursor;