From 77806a86c5f506cec9546c28dcea6e758e2395ce Mon Sep 17 00:00:00 2001
From: austincheney
Date: Fri, 9 Mar 2012 22:55:18 -0700
Subject: [PATCH] fixed up the charcomp subcomponent to be more stable along
side other latest revisions
---
diffview.js | 91 ++++++++++++++++++++++++---------------------------
prettydiff.js | 2 +-
2 files changed, 43 insertions(+), 50 deletions(-)
diff --git a/diffview.js b/diffview.js
index f2e067a1..97daca95 100644
--- a/diffview.js
+++ b/diffview.js
@@ -555,7 +555,8 @@ var diffview = function (args) {
i = 0,
j = 0,
o = 0,
- p = [];
+ p = [],
+ q = false;
//build out static indexes for undefined areas
//and find where the differences start
@@ -564,51 +565,40 @@ var diffview = function (args) {
r = i;
} else {
if (!n && ax[i] !== bx[i] && !em.test(ax[i]) && !em.test(bx[i]) && !em.test(ax[i - 1]) && !em.test(bx[i - 1])) {
- if (typeof ax[i - 2] === "string" && /(<\/em>)$/.test(ax[i - 2]) && ax[i - 1] === " ") {
- ax[i - 2] = ax[i - 2].replace(/(<\/em>)$/, "");
- bx[i - 2] = bx[i - 2].replace(/(<\/em>)$/, "");
- } else {
- if (ax[i] !== undefined && bx[i] !== undefined) {
- ax[i] = "" + ax[i];
- bx[i] = "" + bx[i];
- errorout += 1;
- } else if (ax[i] === undefined && bx[i] !== undefined) {
- ax[i] = "";
- bx[i] = "" + bx[i];
- errorout += 1;
- } else if (ax[i] !== undefined && bx[i] === undefined) {
- ax[i] = "" + ax[i];
- bx[i] = "";
- errorout += 1;
- }
+
+ if (typeof ax[i - 1] === "string" && typeof bx[i - 1] === "string") {
+ ax[i - 1] = ax[i - 1] + "";
+ bx[i - 1] = bx[i - 1] + "";
+ errorout += 1;
+ n = true;
+ break;
+ } else if (typeof ax[i - 1] !== "string" && typeof bx[i - 1] === "string") {
+ ax[i - 1] = "";
+ bx[i - 1] = bx[i] + "";
+ errorout += 1;
+ n = true;
+ break;
+ } else if (typeof ax[i - 1] === "string" && typeof bx[i - 1] !== "string") {
+ ax[i - 1] = ax[i] + "";
+ bx[i - 1] = "";
+ errorout += 1;
+ n = true;
+ break;
}
- n = true;
} else if (ax[i] === undefined && (bx[i] === "" || bx[i] === " ")) {
ax[i] = "";
} else if (bx[i] === undefined && (ax[i] === "" || ax[i] === " ")) {
bx[i] = "";
}
- break;
}
}
//this is voodoo magic.
for (j = i + 1; j < zx; j += 1) {
- if (typeof ax[j] !== "undefined" && typeof bx[j] === "undefined") {
+ if (typeof ax[j] === "string" && typeof bx[j] !== "string") {
bx[j] = "";
- } else if (typeof ax[j] === "undefined" && typeof bx[j] !== "undefined") {
+ } else if (typeof ax[j] !== "string" && typeof bx[j] === "string") {
ax[j] = "";
- } else if (n && (ax[j] === bx[j] || ax[j + 1] === bx[j + 1])) {
- if (ax[j] === bx[j]) {
- ax[j - 1] = ax[j - 1] + "";
- bx[j - 1] = bx[j - 1] + "";
- } else {
- ax[j] = ax[j] + "";
- bx[j] = bx[j] + "";
- }
- n = false;
- k = j + 1;
- break;
} else if (n) {
for (o = j; o < zx; o += 1) {
if (ax[j - 1] === "" + bx[o] && em.test(bx[j - 1]) && (j - 2 < 0 || ax[j - 2] !== bx[o + 1])) {
@@ -639,7 +629,7 @@ var diffview = function (args) {
}
n = false;
break;
- } else if (bx[j] === ax[o]) {
+ } else if (bx[j] === ax[o] && ((ax[o - 1] !== ")" && ax[o - 1] !== "}" && ax[o - 1] !== "]" && ax[o - 1] !== ">" && bx[j - 1] !== ")" && bx[j - 1] !== "}" && bx[j - 1] !== "]" && bx[j - 1] !== ">") || (o === zx - 1 || bx[j + 1] === ax[o + 1]))) {
if (bx[j - 1] === "" + ax[o - 1]) {
bx[j - 1] = bx[j - 1].replace(//, "");
ax[o - 1] = ax[o - 1] + "";
@@ -651,9 +641,12 @@ var diffview = function (args) {
ax[o - 2] = ax[o - 2] + "";
bx[j - 2] = bx[j - 2] + "";
bx[j - 1] = bx[j - 1].replace(//, "");
- } else {
+ } else if (ax[o - 1] !== bx[j - 1] && !em.test(ax[o - 1])) {
ax[o - 1] = ax[o - 1] + "";
bx[j - 1] = bx[j - 1] + "";
+ } else {
+ ax[o - 1] = "" + ax[o - 1];
+ bx[j - 1] = "" + bx[j - 1];
}
k = o;
if (o - j > 0) {
@@ -665,7 +658,7 @@ var diffview = function (args) {
}
n = false;
break;
- } else if (ax[j] === bx[o]) {
+ } else if (ax[j] === bx[o] && ((bx[o - 1] !== ")" && bx[o - 1] !== "}" && bx[o - 1] !== "]" && bx[o - 1] !== ">" && ax[j - 1] !== ")" && ax[j - 1] !== "}" && ax[j - 1] !== "]" && ax[j - 1] !== ">") || (o === zx - 1 || ax[j + 1] === bx[o + 1]))) {
if (ax[j - 1] === "" + bx[o - 1]) {
ax[j - 1] = ax[j - 1].replace(//, "");
bx[o - 1] = bx[o - 1] + "";
@@ -677,9 +670,12 @@ var diffview = function (args) {
bx[o - 2] = bx[o - 2] + "";
ax[j - 2] = ax[j - 2] + "";
ax[j - 1] = ax[j - 1].replace(//, "");
- } else {
+ } else if (bx[o - 1] !== ax[j - 1] && !em.test(bx[o - 1])) {
bx[o - 1] = bx[o - 1] + "";
ax[j - 1] = ax[j - 1] + "";
+ } else {
+ bx[o - 1] = "" + bx[o - 1];
+ ax[j - 1] = "" + ax[j - 1];
}
k = o;
if (o - j > 0) {
@@ -700,26 +696,23 @@ var diffview = function (args) {
//need this.
if (n) {
for (o = j + 1; o < zx - 1; o += 1) {
- if (typeof ax[o - 1] !== "string" && ax[j + 1] === bx[o]) {
- ax[j] += "";
- bx[o - 1] += "";
- k = o + 1;
- n = false;
- break;
- } else if (typeof bx[o - 1] !== "string" && bx[j + 1] === ax[o]) {
- bx[j] += "";
- ax[o - 1] += "";
- k = o + 1;
- n = false;
- break;
+ if (typeof ax[o] !== "string") {
+ ax.push("");
+ } else if (typeof bx[o] !== "string") {
+ bx.push("");
} else if (ax[o] === bx[o] && typeof ax[o - 1] === "string" && typeof bx[o - 1] === "string") {
ax[o - 1] = ax[o - 1] + "";
bx[o - 1] = bx[o - 1] + "";
k = o;
n = false;
+ q = true;
break;
}
}
+ if (q) {
+ q = false;
+ break;
+ }
}
}
zx = Math.max(ax.length, bx.length);
diff --git a/prettydiff.js b/prettydiff.js
index ef244e35..160c029e 100644
--- a/prettydiff.js
+++ b/prettydiff.js
@@ -142,4 +142,4 @@ if (typeof exports !== "string") {
};
}
***/
-var prettydiff=function(api){"use strict";var startTime=(function(){var d=new Date(),t=d.getTime();return t;}()),summary,charDecoder=function(input){var b=0,d=0,a=0,f=0,g=0,c=input,e=[],x=[],y=[],uni=(/u\+[0-9a-f]{4,5}\+/),unit=(/u\![0-9a-f]{4,5}\+/),htmln=(/\&\#[0-9]{1,6}\;/),htmlt=(/\&\![0-9]{1,6}\;/);if((!o.rh&&!o.rh.innerHTML)||(c.search(unit)===-1&&c.search(uni)===-1&&c.search(htmlt)===-1&&c.search(htmln)===-1)){return input;}f=input.length;for(b=0;bsource.length){return source;}else if(source===error){if(a!==source.length-1){return source+a+", '"+err+"'.";}else{return source+a+".";}}source=source.replace(/\n/g,"\n\n{-}\n\n");if(source.charAt(source.length-ch.length)===ch){source=source.slice(0,source.length+1-ch.length)+"{|}";}do{source=source.replace(ch,"\n");}while(source.indexOf(ch)!==-1);b=c.length;for(a=0;a2){e=c.length-1;for(d=1;d3){level=2;}if(type==="javascript"){input=input.replace(/\/\/(\s)*-->/g,"//-->");}else if(type!=="css"){input="Error: The type argument is not provided a value of either 'css' or 'javascript'.";}}}()),ret,atchar=input.match(/\@charset\s+("|')[\w\-]+("|');?/gi),error="",a="",b="",geti,getl,EOF=-1,LETTERS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",DIGITS="0123456789",OTHERS,ALNUM,fcom=[],alterj=false,asiflag=true,theLookahead=EOF,isAlphanum=function(c){return c!==EOF&&(ALNUM.indexOf(c)>-1||c.charCodeAt(0)>126);},jsasiq=function(x){if(x.indexOf("\n")===-1){return x;}else{x=x.split("");x[0]=x[0]+";";return x.join("");}},asiFix=function(y){var a=0,x=y.split(""),b=x.length,c=0,d=0,e="",f="",g="",h="";for(a=0;a-1;c-=1){if((c>1&&x[c-1]==="\\"&&x[c-2]!=="\\")||(c===1&&x[c-1]==="\\")){c-=1;}else{if(x[c].charAt(0)===g&&e===""){d-=1;}else if(x[c]===h&&e===""){d+=1;}else if(x[c]==="\""&&e===""){e="\"";}else if(x[c]==="'"&&e===""){e="'";}else if(x[c]==="pd"&&e===""){e="/";}else if(x[c]==="\""&&e==="\""){e="";}else if(x[c]==="'"&&e==="'"){e="";}else if(x[c]==="pd"&&e==="/"){e="";}}if(d===0&&(c!==a-1||(c===a-1&&typeof x[c-1]==="string"&&x[c-1]!==x[a]))){if(x[c-1]===")"&&g==="}"){c-=2;d=-1;e="";for(c;c>-1;c-=1){if((c>1&&x[c-1]==="\\"&&x[c-2]!=="\\")||(c===1&&x[c-1]==="\\")){c-=1;}else{if(x[c]===")"&&e===""){d-=1;}else if(x[c]==="("&&e===""){d+=1;}else if(x[c]==="\""&&e===""){e="\"";}else if(x[c]==="'"&&e===""){e="'";}else if(x[c]==="pd"&&e===""){e="/";}else if(x[c]==="\""&&e==="\""){e="";}else if(x[c]==="'"&&e==="'"){e="";}else if(x[c]==="pd"&&e==="/"){e="";}}if(d===0){c-=1;if(typeof x[c-9]==="string"&&x[c-8]==="="&&x[c-7]==="f"&&x[c-6]==="u"&&x[c-5]==="n"&&x[c-4]==="c"&&x[c-3]==="t"&&x[c-2]==="i"&&x[c-1]==="o"&&x[c]==="n"&&(isAlphanum(x[c-9])||x[c-9]==="]"||x[c-9]===")")){x[a]+=";";}break;}}break;}else if(typeof x[c-2]==="string"&&x[c-1]==="="&&(x[a-1].length===1||x[a-1]==="pd")&&(isAlphanum(x[c-2]||x[c-2]==="]"||x[c-2]===")"))){if(typeof x[a+1]!=="string"||x[a+1]!=="/"){x[a]+=";";}break;}else{break;}}}}}}for(a=0;a-1){h=d[a].split("");f=h.length;for(e=3;e=" "||c==="\n"){return c;}if(c==="\r"){return"\n";}return" ";},peek=function(){theLookahead=get();return theLookahead;},next=function(){var c=get();if(c==="/"&&(type==="javascript"||(type==="css"&&peek()!=="/"))){switch(peek()){case"/":for(;;){c=get();if(c<="\n"){return c;}}break;case"*":get();for(;;){switch(get()){case"'":c=get().replace(/'/,"");break;case"\"":c=get().replace(/"/,"");break;case"*":if(peek()==="/"){get();return" ";}break;case EOF:error="Error: Unterminated block comment.";return error;}}break;default:return c;}}return c;},action=function(d){var r=[];if(d===1){r.push(a);}if(d<3){a=b;if(a==="'"||a==="\""){if(d===1&&(r[0]===")"||r[0]==="]")&&alterj){a=";";return r[0];}for(;;){r.push(a);a=get();if(a===b){break;}if(a<="\n"){if(type==="css"){error="Error: This does not appear to be CSS.";}else{error="Error: This does not appear to be JavaScript.";}return error;}if(a==="\\"){r.push(a);a=get();}}}}b=next();if(b==="/"&&"(,=:[!&|".indexOf(a)>-1){r.push(a);r.push(b);for(;;){a=get();if(a==="/"){break;}else if(a==="\\"){r.push(a);a=get();}else if(a<="\n"){error="Error: unterminated JavaScript Regular Expression literal";return error;}r.push(a);}b=next();}return r.join("");},m=function(){var firstComment=(function(){var a=0,b=input.length,c="";if(fcomment!==true||(/^\s*\/\*/.test(input)!==true&&/^\s*\/\//.test(input)!==true)){return;}for(a=0;a/g,"//-->");ret=asiFix(ret);}else{ret=ret.replace(/^\s+/,"").replace(/x{2}-->/g,"//-->");}if(error!==""){return error;}else{return fcom.join("")+ret;}},cleanCSS=function(x,size,character,comment,alter){var q=x.length,a=0,b=0,c=[],atchar=x.match(/\@charset\s+("|')[\w\-]+("|');?/gi),tab="",nsize=Number(size),fixURI=function(y){var a=0,b=[],c="",x=y.replace(/\\\)/g,"~PDpar~").split("url("),d=x.length,e="\"";for(a=1;a3&&y[i-3]==="u"&&y[i-2]==="r"&&y[i-1]==="l"&&y[i]==="("){for(j=i;j=b){out=[out.join("").replace(/^(\s*)/,"").replace(/(\s*)$/,"")];x=out.join("");tabs=[];}},reduction=function(x){var a=0,e=0,f=0,g=-1,m=0,p=0,q="",b=x.length,c=[],d=[],h=[],i=[],test=false,colorLow=function(y){y=y.toLowerCase();if(y.length===7&&y.charAt(1)===y.charAt(2)&&y.charAt(3)===y.charAt(4)&&y.charAt(5)===y.charAt(6)){y="#"+y.charAt(1)+y.charAt(3)+y.charAt(5);}return y;},ccex=(/[\w\s:#\-\=\!\(\)"'\[\]\.%-\_\?\/\\]\/\*/),cceg=function(a){return a.replace(/\s*\/\*/,";/*");};for(a=0;a0;b-=1){if(x.charAt(b)==="/"&&x.charAt(b-1)&&x.charAt(b-1)==="*"){for(e=b-1;e>0;e-=1){if(x.charAt(e)==="/"&&x.charAt(e+1)==="*"){b=e;break;}}}else if(!/[\}\s]/.test(x.charAt(b))){break;}}for(a=d.length-1;a>0;a-=1){if(d[a]==="}"){b+=1;}else{break;}}if(b===x.length||x.substring(b+1,x.length-1)===d[d.length-1]){d.push("}");}else{d.push(x.substring(b+1,x.length));}b=d.length;for(a=0;a/g," > ");}else{if(d[a].indexOf("url(")>-1){h=d[a].split("");f=h.length;for(e=3;e])\s?/g,"$1").replace(/\{(\.*):(\.*)\}/g,"{$1: $2}").replace(/\b\*/g," *").replace(/\*\/\s?/g,"*/\n").replace(/\d%\d/g,fixpercent);if(alter===true){x=reduction(x);}cleanAsync();if(alter===true){c=x.split("*/");b=c.length;for(a=0;a"+e[a]+"";}b[a]=""+e[a]+" - "+b[a]+"";}}if(d!==0){i="List of HTTP requests:
";}j=f.length;for(a=2;aTotal input size: "+k+" characters
Total output size: "+l+" characters
Number of HTTP requests: "+h+"
"+i;}());return x;},js_beautify=function(args){(function(){if(!args.source||typeof args.source!=="string"){args.source="";}else{args.source=args.source.replace(/var /g,"var prettydiffvar,");}if(args.insize===undefined||isNaN(args.insize)){args.insize=4;}if(!args.inchar||args.inchar.length<1||typeof args.inchar!=="string"){args.inchar=" ";}if(!args.inlevel||isNaN(args.inlevel)){args.inlevel=0;}if(typeof args.preserve!=="boolean"){args.preserve=true;}if(!args.preserve_max||isNaN(args.preserve_max)){args.preserve_max=0;}if(!args.space||args.space!==true){args.space=false;}if(!args.braces||typeof args.braces!=="boolean"){if(args.braces==="allman"){args.braces=true;}else{args.braces=false;}}if(!args.inarray||args.inarray!==true){args.inarray=false;}if(!args.content||args.content!==true){args.content=false;}if(!args.comments||typeof args.comments!=="boolean"){if(args.comments==="noindent"){args.comments=true;}else{args.comments=false;}}}());var j=[0,0],k=[0,0],l=[0,0,0],m=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],n=[0,0,0,0,0],o=[0,0],w=[0,0,0,0],i=0,insize=args.insize,input=args.source,input_length=args.source.length+1,t=[],output=[],token_text="",last_type="TK_START_EXPR",var_last_type="",var_last_last_type="",var_end_count=-1,last_text="",last_last_text="",last_word="",last_last_word="",flags={previous_mode:(flags)?flags.mode:"BLOCK",mode:"BLOCK",var_line:false,var_line_reindented:false,in_html_comment:false,if_line:false,in_case:false,eat_next_space:false,indentation_baseline:-1,indentation_level:((flags)?flags.indentation_level+((flags.var_line&&flags.var_line_reindented)?1:0):args.inlevel)},functestval=0,var_var_test=false,commafix=false,comma_test=false,forblock=false,forcount=0,flag_store=[flags],indent_string="",wordchar=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","0","1","2","3","4","5","6","7","8","9","_","$"],punct=["+","-","*","/","%","&","++","--","=","+=","-=","*=","/=","%=","==","===","!=","!==",">","<",">=","<=",">>","<<",">>>",">>>=",">>=","<<=","&&","&=","|","||","!","!!",",",":","?","^","^=","|=","::"],parser_pos=0,prefix="",token_type="",do_block_just_closed=false,wanted_newline=false,just_added_newline=false,rvalue="",space_before=true,space_after=true,pseudo_block=false,block_comment=function(x){var lines=x.split(/\x0a|\x0d\x0a/),j=lines.length,i=0;print_newline();output.push(lines[0]);for(i=1;i0){flags=flag_store.pop();}},in_array=function(what,arr){var i=0;for(i=0;i=0;i-=1){if(output[i]===":"&&level===0){colon_count+=1;}else if(output[i]==="?"&&level===0){if(colon_count===0){return true;}else{colon_count-=1;}}else if(output[i]==="{"||output[i]==="("||output[i]==="["){if(output[i]==="{"&&level===0){return false;}level-=1;}else if(output[i]===")"||output[i]==="}"||output[i]==="]"){level+=1;}}},fix_object_own_line=function(){var b=0;for(b=output.length-2;b>0;b-=1){if(/^(\s+)$/.test(output[b])){output[b]="";}else if(in_array(output[b],punct)){output[b+1]=" ";break;}}},funcfix=function(y){var a=(y.indexOf("}")-1),b="",c="";if(y.charAt(0)==="\n"){b="\n";c=y.substr(1,a);}else{c=y.substr(0,a);}return b+c+"}\n"+c+"(function";},get_next_token=function(){var c="",i=0,comment="",inline_comment=false,keep_whitespace=false,sep="",esc=false,resulting_string="",in_char_class=false,whitespace_count=0;if(parser_pos>=input_length){return["","TK_EOF"];}wanted_newline=false;c=input.charAt(parser_pos);parser_pos+=1;keep_whitespace=args.inarray&&is_array(flags.mode);if(keep_whitespace){whitespace_count=0;while(c==="\n"||c==="\r"||c==="\t"||c===" "){if(c==="\n"){trim_output();output.push("\n");just_added_newline=true;whitespace_count=0;}else{if(c==="\t"){whitespace_count+=4;}else if(c!=="\r"){whitespace_count+=1;}}if(parser_pos>=input_length){return["","TK_EOF"];}c=input.charAt(parser_pos);parser_pos+=1;}if(flags.indentation_baseline===-1){flags.indentation_baseline=whitespace_count;}if(just_added_newline){for(i=0;i=input_length){return["","TK_EOF"];}c=input.charAt(parser_pos);parser_pos+=1;}if(args.preserve){if(n_newlines>1){for(i=0;i0;}());if(parser_pos>=input_length){return["","TK_EOF"];}}if(in_array(c,wordchar)){if(parser_pos=input_length){break;}}}parser_pos+=2;if(inline_comment){return["/*"+comment+"*/","TK_INLINE_COMMENT"];}else{return["/*"+comment+"*/","TK_BLOCK_COMMENT"];}}if(input.charAt(parser_pos)==="/"){comment=c;while(input.charAt(parser_pos)!=="\r"&&input.charAt(parser_pos)!=="\n"){comment+=input.charAt(parser_pos);parser_pos+=1;if(parser_pos>=input_length){break;}}parser_pos+=1;if(wanted_newline){print_newline();}return[comment,"TK_COMMENT"];}}if(c==="'"||c==="\""||(c==="/"&&((last_type==="TK_WORD"&&(last_text==="return"||last_text==="do"))||(last_type==="TK_COMMENT"||last_type==="TK_START_EXPR"||last_type==="TK_START_BLOCK"||last_type==="TK_END_BLOCK"||last_type==="TK_OPERATOR"||last_type==="TK_EQUALS"||last_type==="TK_EOF"||last_type==="TK_SEMICOLON")))){sep=c;esc=false;resulting_string=c;if(parser_pos=input_length){return[resulting_string,"TK_STRING"];}}}else{while(esc||input.charAt(parser_pos)!==sep){resulting_string+=input.charAt(parser_pos);if(!esc){esc=input.charAt(parser_pos)==="\\";}else{esc=false;}parser_pos+=1;if(parser_pos>=input_length){return[resulting_string,"TK_STRING"];}}}}parser_pos+=1;resulting_string+=sep;if(sep==="/"){while(parser_pos"){flags.in_html_comment=false;parser_pos+=2;if(wanted_newline){print_newline();}return["-->","TK_COMMENT"];}if(in_array(c,punct)){while(parser_pos=input_length){break;}}if(c==="="){return[c,"TK_EQUALS"];}else{return[c,"TK_OPERATOR"];}}return[c,"TK_UNKNOWN"];};if(args.source===""){return"Error: no source code supplied to js_beautify.js";}while(insize>0){indent_string+=args.inchar;insize-=1;}parser_pos=0;while(true){t=get_next_token(parser_pos);token_text=t[0];token_type=t[1];if(token_type==="TK_EOF"){break;}else if(token_type==="TK_START_EXPR"){n[4]+=1;pseudo_block=false;if(token_text==="["){if(last_type==="TK_WORD"||last_text===")"){if(last_text==="continue"||last_text==="try"||last_text==="throw"||last_text==="return"||last_text==="var"||last_text==="if"||last_text==="switch"||last_text==="case"||last_text==="default"||last_text==="for"||last_text==="while"||last_text==="break"||last_text==="function"){print_single_space();}set_mode("(EXPRESSION)");print_token();}else if(flags.mode==="[EXPRESSION]"||flags.mode==="[INDENTED-EXPRESSION]"){if(last_last_text==="]"&&last_text===","){if(flags.mode==="[EXPRESSION]"){flags.mode="[INDENTED-EXPRESSION]";if(!args.inarray){flags.indentation_level+=1;}}set_mode("[EXPRESSION]");if(!args.inarray){print_newline();}}else if(last_text==="["){if(flags.mode==="[EXPRESSION]"){flags.mode="[INDENTED-EXPRESSION]";if(!args.inarray){flags.indentation_level+=1;}}set_mode("[EXPRESSION]");if(!args.inarray){print_newline();}}else{set_mode("[EXPRESSION]");}}else{set_mode("[EXPRESSION]");}}else{set_mode("(EXPRESSION)");}if(token_text!=="["||(token_text==="["&&(last_type!=="TK_WORD"&&last_text!==")"))){if(last_text===";"||last_type==="TK_START_BLOCK"){print_newline();}else if(last_type!=="TK_END_EXPR"&&last_type!=="TK_START_EXPR"&&last_type!=="TK_END_BLOCK"&&last_text!=="."){if((last_type!=="TK_WORD"&&last_type!=="TK_OPERATOR")||(last_word==="function"&&args.space)){print_single_space();}else if(last_text==="continue"||last_text==="try"||last_text==="throw"||last_text==="return"||last_text==="var"||last_text==="if"||last_text==="switch"||last_text==="case"||last_text==="default"||last_text==="for"||last_text==="while"||last_text==="break"||last_text==="function"||last_text==="catch"){print_single_space();}}print_token();}if(forblock&&token_text==="("){forcount+=1;}}else if(token_type==="TK_END_EXPR"){n[4]+=1;if(last_last_text==="}"){pseudo_block=true;}if(token_text==="]"&&args.inarray&&last_text==="}"){if(output.length&&output[output.length-1]===indent_string){output.pop();}print_token();restore_mode();}else if(token_text==="]"&&flags.mode==="[INDENTED-EXPRESSION]"&&last_text==="]"){restore_mode();print_newline();print_token();}else{restore_mode();print_token();}if(forblock&&token_text===")"){forcount-=1;if(forcount===0){forblock=false;}}}else if(token_type==="TK_START_BLOCK"){n[4]+=1;pseudo_block=false;if(last_word==="do"){set_mode("DO_BLOCK");}else{set_mode("BLOCK");}if(var_last_last_type==="TK_START_BLOCK"&&!isNaN(var_end_count)){var_end_count+=1;}if(args.braces){if(last_type!=="TK_OPERATOR"){if(last_text==="return"){print_single_space();}else{print_newline();}}}else{if(functestval>1){flags.indentation_level+=1;var_var_test=true;comma_test=true;}if(last_type!=="TK_OPERATOR"&&last_type!=="TK_START_EXPR"){if(last_type==="TK_START_BLOCK"){print_newline();}else{print_single_space();}}else{if(is_array(flags.previous_mode)&&last_text===","){print_newline();}}}flags.indentation_level+=1;print_token();forblock=false;forcount=0;}else if(token_type==="TK_END_BLOCK"){n[4]+=1;restore_mode();functestval=0;if(var_var_test){pseudo_block=true;}else{pseudo_block=false;}if(var_end_count===0){var_end_count="x";}else if(var_end_count===-1&&var_var_test&&comma_test){flags.var_line_reindented=true;}else if(var_last_last_type==="TK_START_BLOCK"&&!isNaN(var_end_count)){var_end_count-=1;}else if(var_end_count==="a"){if(flags.var_line&&!flags.var_line_reindented){flags.var_line_reindented=true;var_end_count=-1;}}if(args.braces){if(last_text==="{"&&in_array(last_last_text,punct)){fix_object_own_line();}else{if(var_end_count==="y"){var_last_last_type="";var_end_count="a";}print_newline();if(var_end_count==="x"){if(flags.var_line&&!comma_test&&!var_var_test){flags.var_line_reindented=true;}var_end_count="y";}}print_token();}else{if(last_type==="TK_START_BLOCK"){if(just_added_newline){if(output.length&&output[output.length-1]===indent_string){output.pop();}}else{trim_output();}}else if(is_array(flags.mode)&&args.inarray){args.inarray=false;print_newline();args.inarray=true;}else{if(var_end_count==="y"){var_last_last_type="";var_end_count="a";}print_newline();if(var_end_count==="x"){if(flags.var_line&&!comma_test&&!var_var_test){flags.var_line_reindented=true;}var_end_count="y";}}if(!comma_test&&var_var_test&&!flags.var_line_reindented){if((flags.mode==="(EXPRESSION)"&&!flags.var_line)||(flags.mode==="BLOCK"&&flags.var_line)){if(last_text!=="}"&&var_end_count===-1&&flags.mode==="(EXPRESSION)"){output.push(indent_string);}var_var_test=false;}}print_token();}}else if(token_type==="TK_WORD"){if(token_text==="alert"){m[0]+=1;}else if(token_text==="break"){m[2]+=1;}else if(token_text==="case"){m[4]+=1;}else if(token_text==="catch"){m[48]+=1;}else if(token_text==="continue"){m[6]+=1;}else if(token_text==="default"){m[8]+=1;}else if(token_text==="delete"){m[10]+=1;}else if(token_text==="do"){m[12]+=1;}else if(token_text==="document"){m[44]+=1;}else if(token_text==="else"){m[14]+=1;}else if(token_text==="eval"){m[16]+=1;}else if(token_text==="for"){m[18]+=1;}else if(token_text==="function"){m[20]+=1;}else if(token_text==="if"){m[22]+=1;}else if(token_text==="in"){m[24]+=1;}else if(token_text==="label"){m[26]+=1;}else if(token_text==="new"){m[28]+=1;}else if(token_text==="return"){m[30]+=1;}else if(token_text==="switch"){m[32]+=1;}else if(token_text==="this"){m[34]+=1;}else if(token_text==="throw"){m[50]+=1;}else if(token_text==="try"){m[52]+=1;}else if(token_text==="typeof"){m[36]+=1;}else if(token_text==="var"){m[38]+=1;}else if(token_text==="while"){m[40]+=1;}else if(token_text==="with"){m[42]+=1;}else if(token_text==="window"){m[46]+=1;}else{o[0]+=1;o[1]+=token_text.length;}if(token_text!=="var"&&last_text===";"){comma_test=false;}if(last_text===";"&&last_last_text==="}"&&var_end_count==="y"){flags.indentation_level-=1;}if(last_text==="{"&&((last_last_text===":"&&comma_test)||(last_last_text===")"&&var_last_type==="TK_START_BLOCK"&&!comma_test))){output.push(indent_string);flags.indentation_level+=1;if(token_text!=="var"&&!isNaN(var_end_count)){var_end_count+=1;}}if(do_block_just_closed){print_single_space();print_token();print_single_space();do_block_just_closed=false;}else{if(token_text==="do"){print_newline();print_token();}else if(token_text==="case"||token_text==="default"){if(last_text===":"){if(output.length&&output[output.length-1]===indent_string){output.pop();}}else{flags.indentation_level-=1;print_newline();flags.indentation_level+=1;}print_token();flags.in_case=true;}else{if(token_text==="function"){if(comma_test&&(flags.var_line||(!flags.var_line&&last_last_word==="var"))){functestval+=1;}else if(!comma_test){functestval-=1;}if(comma_test&&flags.var_line&&last_last_word==="var"&&!var_var_test&&functestval===0){flags.var_line_reindented=true;}}prefix="NONE";if(last_type==="TK_END_BLOCK"){if(args.braces||(token_text!=="else"&&token_text!=="catch"&&token_text!=="finally")){prefix="NEWLINE";}else{prefix="SPACE";print_single_space();}}else if(last_type==="TK_STRING"||last_type==="TK_START_BLOCK"||(last_type==="TK_SEMICOLON"&&(flags.mode==="BLOCK"||flags.mode==="DO_BLOCK"))){prefix="NEWLINE";}else if(last_type==="TK_WORD"||(last_type==="TK_SEMICOLON"&&is_expression(flags.mode))){prefix="SPACE";}else if(last_type==="TK_END_EXPR"){print_single_space();prefix="NEWLINE";}if(flags.if_line&&last_type==="TK_END_EXPR"){flags.if_line=false;}if(token_text==="else"||token_text==="catch"||token_text==="finally"){if(last_type!=="TK_END_BLOCK"||args.braces){print_newline();}else{trim_output(true);print_single_space();}}else if(last_type!=="TK_START_EXPR"&&last_text!=="="&&last_text!==","&&(token_text==="continue"||token_text==="try"||token_text==="throw"||token_text==="return"||token_text==="var"||token_text==="if"||token_text==="switch"||token_text==="case"||token_text==="default"||token_text==="for"||token_text==="while"||token_text==="break"||token_text==="function"||prefix==="NEWLINE")){if(last_text==="return"||last_text==="throw"||(last_type!=="TK_END_EXPR"&&last_text!==":"&&(last_type!=="TK_START_EXPR"||token_text!=="var"))){if((token_text==="if"&&last_word==="else"&&last_text!=="{")||(token_text==="function"&&last_type==="TK_OPERATOR")){print_single_space();}else{print_newline();}}else if(last_text!==")"&&last_text!==":"&&(token_text==="continue"||token_text==="try"||token_text==="throw"||token_text==="return"||token_text==="var"||token_text==="if"||token_text==="switch"||token_text==="case"||token_text==="default"||token_text==="for"||token_text==="while"||token_text==="break"||token_text==="function")){print_newline();}}else if(prefix==="SPACE"||(forblock&&last_text===";")){print_single_space();}else if(last_text===";"||(is_array(flags.mode)&&last_text===","&&last_last_text==="}")){print_newline();}if(token_text==="var"){if(!var_var_test&&last_type==="TK_START_BLOCK"&&comma_test){if(functestval>=0){var_var_test=true;}}else if(last_type==="TK_START_BLOCK"){if(var_last_type==="TK_START_BLOCK"){if(last_type==="TK_START_BLOCK"){var_last_type="";var_last_last_type="TK_START_BLOCK";var_end_count=0;}}else{var_last_type="TK_START_BLOCK";}}else if(last_type==="TK_START_BLOCK"&&var_last_type===""){var_last_type="TK_START_BLOCK";}flags.var_line=true;flags.var_line_reindented=false;comma_test=true;}print_token();if(token_text==="typeof"){print_single_space();}if(token_text==="if"){flags.if_line=true;}if(token_text==="else"){flags.if_line=false;}if(token_text==="for"){forblock=true;}}last_last_word=last_word;last_word=token_text;}}else if(token_type==="TK_SEMICOLON"){n[3]+=1;if(last_text==="}"){comma_test=true;}print_token();flags.var_line=false;flags.var_line_reindented=false;if(functestval<2){var_var_test=false;}var_last_type="";}else if(token_type==="TK_STRING"){l[0]+=1;if((token_text.charAt(0)==="\""&&token_text.charAt(token_text.length-1)==="\"")||(token_text.charAt(0)==="'"&&token_text.charAt(token_text.length-1)==="'")){l[1]+=token_text.length-2;l[2]+=2;}else{l[1]+=token_text.length;}white_count(token_text);if(last_type==="TK_START_BLOCK"||last_type==="TK_END_BLOCK"||last_type==="TK_SEMICOLON"){print_newline();}else if(last_type==="TK_WORD"){print_single_space();}if(args.content){output.push(token_text.charAt(0)+"text"+token_text.charAt(0));}else{print_token();}}else if(token_type==="TK_EQUALS"){n[0]+=1;n[1]+=1;print_single_space();print_token();print_single_space();}else if(token_type==="TK_OPERATOR"){if(token_text!==","){n[0]+=1;n[1]+=token_text.length;}var_last_type="";if(token_text===","){if(var_end_count==="y"&&last_type!=="TK_END_BLOCK"){flags.indentation_level-=1;}if(commafix){commafix=false;if(last_text==="}"){flags.var_line_reindented=true;}}if(last_text==="}"&&last_last_text==="{"&&last_last_word==="var"&&flags.var_line){commafix=true;flags.var_line_reindented=true;}n[2]+=1;if(flags.mode!=="(EXPRESSION)"&&last_last_text!==":"){comma_test=false;}if(flags.var_line&&flags.mode!=="(EXPRESSION)"){flags.var_line_reindented=true;print_token();if(last_word!=="prettydiffvar"){print_newline();}}else if(last_type==="TK_END_BLOCK"&&flags.mode!=="(EXPRESSION)"){print_token();if(last_text==="}"){print_newline();}else{print_single_space();}}else if(flags.mode!=="(EXPRESSION)"&&(flags.mode==="BLOCK"||flags.mode==="OBJECT"||is_ternary_op())){print_token();print_newline();}else{print_token();print_single_space();}}else if(last_text==="return"||last_text==="throw"){print_single_space();print_token();}else if(token_text==="::"){print_token();}else if(token_text==="--"||token_text==="++"||token_text==="!"||((token_text==="-"||token_text==="+")&&(last_type==="TK_START_BLOCK"||last_type==="TK_START_EXPR"||last_type==="TK_EQUALS"||last_type==="TK_OPERATOR"||last_text==="continue"||last_text==="try"||last_text==="throw"||last_text==="return"||last_text==="var"||last_text==="if"||last_text==="switch"||last_text==="case"||last_text==="default"||last_text==="for"||last_text==="while"||last_text==="break"||last_text==="function"))){space_before=false;space_after=false;if(last_text===";"&&is_expression(flags.mode)){space_before=true;}if(last_type==="TK_WORD"&&(last_text==="continue"||last_text==="try"||last_text==="throw"||last_text==="return"||last_text==="var"||last_text==="if"||last_text==="switch"||last_text==="case"||last_text==="default"||last_text==="for"||last_text==="while"||last_text==="break"||last_text==="function")){space_before=true;}if(flags.mode==="BLOCK"&&(last_text==="{"||last_text===";")){print_newline();}}else if(token_text==="."){space_before=false;}if(token_text!==","&&token_text!==":"&&(token_text!=="-"||(token_text==="-"&&last_text!=="continue"&&last_text!=="try"&&last_text!=="throw"&&last_text!=="return"&&last_text!=="var"&&last_text!=="if"&&last_text!=="switch"&&last_text!=="case"&&last_text!=="default"&&last_text!=="for"&&last_text!=="while"&&last_text!=="break"&&last_text!=="function"))){if(space_before){print_single_space();}print_token();if(space_after){print_single_space();}}else if(token_text===":"){if(flags.in_case){print_token();print_newline();flags.in_case=false;}else if(is_ternary_op()){print_single_space();print_token();print_single_space();flags.mode="OBJECT";}else if(flags.in_case){print_single_space();print_token();print_single_space();}else if(last_last_text!=="case"&&last_last_text!=="default"&&last_text!=="case"&&last_text!=="default"){print_token();print_single_space();}}space_before=true;space_after=true;}else if(token_type==="TK_BLOCK_COMMENT"){j[0]+=1;j[1]+=token_text.length;white_count(token_text);if(args.comments){for(i=output.length-1;i>0;i-=1){if(output[i]===indent_string||output[i]===" "){output[i]="";}else{break;}}output.push("\n");print_token();output.push("\n");}else{block_comment(token_text);}}else if(token_type==="TK_INLINE_COMMENT"){j[0]+=1;j[1]+=token_text.length;white_count(token_text);print_token();if(is_expression(flags.mode)){print_single_space();}else if(args.comments){output.push("\n");}else{print_newline();}}else if(token_type==="TK_COMMENT"){k[0]+=1;k[1]+=token_text.length;white_count(token_text);if(args.comments){for(i=output.length-1;i>0;i-=1){if(output[i]===indent_string){output[i]="";}else{break;}}}else if(wanted_newline){print_newline();}else{print_single_space();}print_token();print_newline();}else if(token_type==="TK_UNKNOWN"){n[0]+=1;n[1]+=token_text.length;white_count(token_text);if(last_text==="return"||last_text==="throw"){print_single_space();}print_token();}last_last_text=last_text;last_type=token_type;last_text=token_text;}rvalue=output.join("").replace(/var prettydiffvar\,\s*/g,"var ").replace(/^(\s+)/,"").replace(/(\s+)$/,"").replace(/\s*\}\(function/g,funcfix).replace(/\n( |\t)+\n/g,"\n\n").replace(/ \n/g,"\n");(function(){var a=0,b=0,e=1,f=1,g=0,h=0,i=0,p=0,q=[],z=[],output,zero=function(x,y){if(y===0){return"0.00%";}else{return((x/y)*100).toFixed(2)+"%";}},drawRow=function(w,x,y,z,Z){var a=["Keyword '"];a.push(w);a.push("' | ");a.push(y);a.push(" | ");a.push(zero(y,m[54]));a.push(" | ");a.push(zero(y,Z[0]));a.push(" | ");a.push(z);a.push(" | ");a.push(zero(z,m[55]));a.push(" | ");a.push(zero(z,Z[1]));a.push(" |
");return a.join("");};if(rvalue.length<=input_length){b=input_length;}else{b=rvalue.length;}for(a=0;a0){q[0]=" class='bad'";}else{q[0]="";}if(m[6]>0){q[1]=" class='bad'";}else{q[1]="";}if(m[16]>0){q[2]=" class='bad'";}else{q[2]="";}if(m[42]>0){q[3]=" class='bad'";}else{q[3]="";}g=g-w[1];h=h-w[2];p=p-w[3];i=((e-1-w[0])+g+h+p);n.push(l[2]+n[0]+n[2]+n[3]+n[4]);n.push(l[2]+n[1]+n[2]+n[3]+n[4]);j.push(j[0]+k[0]);j.push(j[1]+k[1]);m[1]=m[0]*5;m[3]=m[2]*5;m[5]=m[4]*4;m[7]=m[6]*8;m[9]=m[8]*7;m[11]=m[10]*6;m[13]=m[12]*2;m[15]=m[14]*4;m[17]=m[16]*4;m[19]=m[18]*3;m[21]=m[20]*8;m[23]=m[22]*2;m[25]=m[24]*2;m[27]=m[26]*5;m[29]=m[28]*3;m[31]=m[30]*6;m[33]=m[32]*6;m[35]=m[34]*4;m[37]=m[36]*6;m[39]=m[38]*3;m[41]=m[40]*5;m[43]=m[42]*4;m[45]=m[44]*8;m[47]=m[46]*6;m[49]=m[48]*5;m[51]=m[50]*5;m[53]=m[52]*3;m[54]=m[0]+m[2]+m[4]+m[6]+m[8]+m[10]+m[12]+m[14]+m[16]+m[18]+m[20]+m[22]+m[24]+m[26]+m[28]+m[30]+m[32]+m[34]+m[36]+m[38]+m[40]+m[42]+m[44]+m[46]+m[48]+m[50]+m[52];m[55]=m[1]+m[3]+m[5]+m[7]+m[9]+m[11]+m[13]+m[15]+m[17]+m[19]+m[21]+m[23]+m[25]+m[27]+m[29]+m[31]+m[33]+m[35]+m[37]+m[39]+m[41]+m[43]+m[45]+m[47]+m[49]+m[51]+m[53];z.push(j[2]+l[0]+n[5]+m[54]+o[0]+i);z.push(j[3]+l[1]+n[6]+m[55]+o[1]+i);output=[""];output.push("
JavaScript data reportData Label | Input | Output | Literal Increase | Percentage Increase |
");output.push("Total Character Size | ");output.push(input_length);output.push(" | ");output.push(rvalue.length);output.push(" | ");output.push(rvalue.length-input_length);output.push(" | ");output.push((((rvalue.length-input_length)/rvalue.length)*100).toFixed(2));output.push("% |
---|
Total Lines of Code | ");output.push(e);output.push(" | ");output.push(f);output.push(" | ");output.push(f-e);output.push(" | ");output.push((((f-e)/e)*100).toFixed(2));output.push("% |
---|
");output.push("
JavaScript component analysisJavaScript Component | Component Quantity | Percentage Quantity from Section | ");output.push("Percentage Qauntity from Total | Character Length | Percentage Length from Section | Percentage Length from Total |
");output.push("Total Accounted | ");output.push(z[0]);output.push(" | 100.00% | 100.00% | ");output.push(z[1]);output.push(" | 100.00% | 100.00% |
---|
Comments |
---|
Block Comments | ");output.push(j[0]);output.push(" | ");output.push(zero(j[0],j[2]));output.push(" | ");output.push(zero(j[0],z[0]));output.push(" | ");output.push(j[1]);output.push(" | ");output.push(zero(j[1],j[3]));output.push(" | ");output.push(zero(j[1],z[1]));output.push(" |
---|
Inline Comments | ");output.push(k[0]);output.push(" | ");output.push(zero(k[0],j[2]));output.push(" | ");output.push(zero(k[0],z[0]));output.push(" | ");output.push(k[1]);output.push(" | ");output.push(zero(k[1],j[3]));output.push(" | ");output.push(zero(k[1],z[1]));output.push(" |
---|
Comment Total | ");output.push(j[2]);output.push(" | 100.00% | ");output.push(zero(j[2],z[0]));output.push(" | ");output.push(j[3]);output.push(" | 100.00% | ");output.push(zero(j[3],z[1]));output.push(" |
---|
Whitespace Outside of Strings and Comments |
---|
New Lines | ");output.push(e-1-w[0]);output.push(" | ");output.push(zero(e-1-w[0],i));output.push(" | ");output.push(zero(e-1-w[0],z[0]));output.push(" | ");output.push(e-1-w[0]);output.push(" | ");output.push(zero(e-1-w[0],i));output.push(" | ");output.push(zero(e-1-w[0],z[1]));output.push(" |
---|
Spaces | ");output.push(g);output.push(" | ");output.push(zero(g,i));output.push(" | ");output.push(zero(g,z[0]));output.push(" | ");output.push(g);output.push(" | ");output.push(zero(g,i));output.push(" | ");output.push(zero(g,z[1]));output.push(" |
---|
Tabs | ");output.push(h);output.push(" | ");output.push(zero(h,i));output.push(" | ");output.push(zero(h,z[0]));output.push(" | ");output.push(h);output.push(" | ");output.push(zero(h,i));output.push(" | ");output.push(zero(h,z[1]));output.push(" |
---|
Other Whitespace | ");output.push(p);output.push(" | ");output.push(zero(p,i));output.push(" | ");output.push(zero(p,z[0]));output.push(" | ");output.push(p);output.push(" | ");output.push(zero(p,i));output.push(" | ");output.push(zero(p,z[1]));output.push(" |
---|
Total Whitespace | ");output.push(i);output.push(" | 100.00% | ");output.push(zero(i,z[0]));output.push(" | ");output.push(i);output.push(" | 100.00% | ");output.push(zero(i,z[1]));output.push(" |
---|
Strings |
---|
Strings | ");output.push(l[0]);output.push(" | 100.00% | ");output.push(zero(l[0],z[0]));output.push(" | ");output.push(l[1]);output.push(" | 100.00% | ");output.push(zero(l[1],z[1]));output.push(" |
---|
Syntax Characters |
---|
Quote Characters | ");output.push(l[2]);output.push(" | ");output.push(zero(l[2],n[5]));output.push(" | ");output.push(zero(l[2],z[0]));output.push(" | ");output.push(l[2]);output.push(" | ");output.push(zero(l[2],n[6]));output.push(" | ");output.push(zero(l[2],z[1]));output.push(" |
---|
Commas | ");output.push(n[2]);output.push(" | ");output.push(zero(n[2],n[5]));output.push(" | ");output.push(zero(n[2],z[0]));output.push(" | ");output.push(n[2]);output.push(" | ");output.push(zero(n[2],n[6]));output.push(" | ");output.push(zero(n[2],z[1]));output.push(" |
---|
Containment Characters | ");output.push(n[4]);output.push(" | ");output.push(zero(n[4],n[5]));output.push(" | ");output.push(zero(n[4],z[0]));output.push(" | ");output.push(n[4]);output.push(" | ");output.push(zero(n[4],n[6]));output.push(" | ");output.push(zero(n[4],z[1]));output.push(" |
---|
Semicolons | ");output.push(n[3]);output.push(" | ");output.push(zero(n[3],n[5]));output.push(" | ");output.push(zero(n[3],z[0]));output.push(" | ");output.push(n[3]);output.push(" | ");output.push(zero(n[3],n[6]));output.push(" | ");output.push(zero(n[3],z[1]));output.push(" |
---|
Operators | ");output.push(n[0]);output.push(" | ");output.push(zero(n[0],n[5]));output.push(" | ");output.push(zero(n[0],z[0]));output.push(" | ");output.push(n[1]);output.push(" | ");output.push(zero(n[1],n[6]));output.push(" | ");output.push(zero(n[1],z[1]));output.push(" |
---|
Total Syntax Characters | ");output.push(n[5]);output.push(" | 100.00% | ");output.push(zero(n[5],z[0]));output.push(" | ");output.push(n[6]);output.push(" | 100.00% | ");output.push(zero(n[6],z[1]));output.push(" |
");output.push("Keywords |
");output.push(drawRow("alert",q[0],m[0],m[1],z));output.push(drawRow("break","",m[2],m[3],z));output.push(drawRow("case","",m[4],m[5],z));output.push(drawRow("catch","",m[48],m[49],z));output.push(drawRow("continue",q[1],m[6],m[7],z));output.push(drawRow("default","",m[8],m[9],z));output.push(drawRow("delete","",m[10],m[11],z));output.push(drawRow("do","",m[12],m[13],z));output.push(drawRow("document","",m[44],m[45],z));output.push(drawRow("else","",m[14],m[15],z));output.push(drawRow("eval",q[2],m[16],m[17],z));output.push(drawRow("for","",m[18],m[19],z));output.push(drawRow("function","",m[20],m[21],z));output.push(drawRow("if","",m[22],m[23],z));output.push(drawRow("in","",m[24],m[25],z));output.push(drawRow("label","",m[26],m[27],z));output.push(drawRow("new","",m[28],m[29],z));output.push(drawRow("return","",m[30],m[31],z));output.push(drawRow("switch","",m[32],m[33],z));output.push(drawRow("this","",m[34],m[35],z));output.push(drawRow("throw","",m[50],m[51],z));output.push(drawRow("typeof","",m[36],m[37],z));output.push(drawRow("var","",m[38],m[39],z));output.push(drawRow("while","",m[40],m[41],z));output.push(drawRow("with",q[3],m[42],m[43],z));output.push(drawRow("window","",m[46],m[47],z));output.push(drawRow("try","",m[52],m[53],z));output.push("Total Keywords | ");output.push(m[54]);output.push(" | 100.00% | ");output.push(zero(m[55],z[0]));output.push(" | ");output.push(m[55]);output.push(" | 100.00% | ");output.push(zero(m[55],z[1]));output.push(" |
");output.push("Variables and Other Keywords |
---|
Variable Instances | ");output.push(o[0]);output.push(" | 100.00% | ");output.push(zero(o[0],z[0]));output.push(" | ");output.push(o[1]);output.push(" | 100.00% | ");output.push(zero(o[1],z[1]));output.push(" |
---|
");summary=output.join("");}());return rvalue;},markupmin=function(y,comments,presume_html,top_comments){var i=0,x=y.split(""),markupspace=function(){var a=0,c=[],Y=x.length;for(a=i;a"){break;}else{c.push(x[a]);x[a]="";}}i=a;x[i]=c.join("").replace(/\s+/g," ").replace(/\s*,\s+/g,", ").replace(/\s*\/\s*/g,"/").replace(/\s*=\s*/g,"=").replace(/\s*:\s*/g,":").replace(/ \="/g,"=\"").replace(/ \='/g,"='")+">";},markupcomment=function(){var Y=x.length,b=0,c=[];for(b=i;b"){x[b]="";x[b+1]="";x[b+2]="";i=b+2;break;}else{if(comments==="beautify"||comments==="comments"){c.push(x[b]);}x[b]="";}}if(comments==="comments"||comments==="beautify"){x[i]=" "+c.join("")+"-->";}},markupscript=function(z){var c=0,e=[],f=0,g="",h="",j=""+z,m="",Y=x.length,cdataStart=(/^(\s*\/+\s*)$/),scriptStart=(/^(\s*<\!\-\-)/),scriptEnd=(/(\/+\-\->\s*)$/),cs="",ce="";if(typeof jsmin==="undefined"){return;}for(c=i;c"){e.push(x[c]);x[c]="";}else{break;}}m=e[0];e.splice(0,1);if((/\s/).test(e[0])){e.splice(0,1);}for(f;f"){h=h+x[f];x[f]="";}else{break;}}h=h+">";i=f;if(e.join("")===""){x[i]=m+h;return;}g=e.join("");if(comments!=="beautify"){if(cdataStart.test(g)){cs=g.match(cdataStart)[0];g=g.replace(cdataStart,"");}else if(scriptStart.test(g)){cs=g.match(scriptStart)[0];g=g.replace(scriptStart,"");}if(cdataEnd.test(g)){ce=g.match(cdataEnd)[0];g=g.replace(cdataEnd,"");}else if(scriptEnd.test(g)){ce=g.match(scriptEnd)[0];g=g.replace(scriptEnd,"");}if(z==="style"){g=cs+jsmin(g,3,"css",true,top_comments)+ce;}else{g=cs+jsmin(g,3,"javascript",false,top_comments)+ce;}}Y=g.length;for(c=0;c"){break;}a.push(y.charAt(b));}d=a.join("").toLowerCase().replace(/'/g,"\"");if(comments!=="beautify"&&comments!=="diff"){markupspace();}if(d.indexOf("type=\"")===-1||d.indexOf("type=\"text/javascript\"")!==-1||d.indexOf("type=\"application/javascript\"")!==-1||d.indexOf("type=\"application/x-javascript\"")!==-1||d.indexOf("type=\"text/ecmascript\"")!==-1||d.indexOf("type=\"application/ecmascript\"")!==-1){markupscript("script");}}else if((y.slice(i,i+6)).toLowerCase()===""){if(/>"){a=b;h+=1;break;}}}else if(x.charAt(a)==="<"&&x.charAt(a+1)==="%"){for(b=a+2;b"){a=b;h+=1;break;}}}else if(x.charAt(a)==="<"&&x.charAt(a+1)==="!"&&/[A-Z]|\[/.test(x.charAt(a+2))){for(b=a+3;b"&&q[q.length-1]===">"&&q.length===1){h+=1;if(r){d.push([a,b,h,a]);}r=false;a=b;q=[">"];break;}else if(x.charAt(b)==="<"){q.push(">");r=true;}else if(x.charAt(b)===">"&&q.length>1){q.pop();r=true;}else if(x.charAt(b)==="["){q.push("]");}else if(x.charAt(b)==="]"){q.pop();}else if(x.charAt(b)==="\""){if(q[q.length-1]==="\""){q.pop();}else{q.push("\"");}}else if(x.charAt(b)==="'"){if(q[q.length-1]==="'"){q.pop();}else{q.push("'");}}}}else if(x.charAt(a)===x.charAt(a+1)&&(x.charAt(a)==="\""||x.charAt(a)==="'")){a+=1;}else if(x.charAt(a-1)==="="&&(x.charAt(a)==="\""||x.charAt(a)==="'")){o=false;for(m=a-1;m>0;m-=1){if((x.charAt(m)==="\""&&x.charAt(a)==="\"")||(x.charAt(m)==="'"&&x.charAt(a)==="'")||x.charAt(m)==="<"){break;}else if(x.charAt(m)===">"){o=true;break;}}if(!o){n=false;for(b=a+1;b"){b=p+8;break;}}}else if(x.substr(b,6).toLowerCase()===""){if(/>"){a=b;h+=1;break;}}}else if(x.charAt(a)==="<"&&x.charAt(a+1)==="%"){for(b=a+2;b"){a=b;h+=1;break;}}}else if(x.charAt(a)==="<"&&x.charAt(a+1)==="!"&&/[A-Z]|\[/.test(x.charAt(a+2))){for(b=a+3;b"&&q[q.length-1]===">"&&q.length===1){h+=1;if(r){d.push([a,b,h,a]);}r=false;a=b;q=[">"];break;}else if(x.charAt(b)==="<"){q.push(">");r=true;}else if(x.charAt(b)===">"&&q.length>1){q.pop();r=true;}else if(x.charAt(b)==="["){q.push("]");}else if(x.charAt(b)==="]"){q.pop();}else if(x.charAt(b)==="\""){if(q[q.length-1]==="\""){q.pop();}else{q.push("\"");}}else if(x.charAt(b)==="'"){if(q[q.length-1]==="'"){q.pop();}else{q.push("'");}}}}else if(x.charAt(a)===x.charAt(a+1)&&(x.charAt(a)==="\""||x.charAt(a)==="'")){a+=1;}else if(x.charAt(a-1)==="="&&(x.charAt(a)==="\""||x.charAt(a)==="'")){o=false;for(m=a-1;m>0;m-=1){if((x.charAt(m)==="\""&&x.charAt(a)==="\"")||(x.charAt(m)==="'"&&x.charAt(a)==="'")||x.charAt(m)==="<"){break;}else if(x.charAt(m)===">"){o=true;break;}}if(!o){n=false;for(b=a+1;b"){b=p+8;break;}}}else if(x.substr(b,6).toLowerCase()==="