/*global prettydiff*/ function mode(diffmeta?:diffmeta):string { "use strict"; const pdcomment = function mode_pdcomment():void { const ops:any = prettydiff.sparser.options; let sindex:number = options.source.search(/((\/(\*|\/))| // // // - Parsing Considerations: // * there may be any amount of space at the start or end of the comment // * "prettydiff.com" must exist at the start of the comment // * comment must exist prior to non-comment tokens (near top of code) // * parameters are name value pairs separated by white space // * the delimiter separating name and value is either ":" or "=" characters if ((sindex > -1 && (sindex === 0 || "\"':".indexOf(options.source.charAt(sindex - 1)) < 0)) || (options.mode === "diff" && dindex > -1 && (dindex === 0 || "\"':".indexOf(options.diff.charAt(dindex - 1)) < 0))) { let pdcom:number = sindex, a:number = (pdcom > -1) ? pdcom : dindex, b:number = 0, quote:string = "", item:string = "", lang:string = "", lex:string = "", valkey:string[] = [], op:string[] = []; const ops:string[] = [], source:string = (pdcom > -1) ? options.source : options.diff, len:number = source.length, comment:string = (source.charAt(a) === "<") ? "") { break; } if (comment === "//" && source.charAt(a) === "\n") { break; } if (comment === "/\u002a" && source.slice(a - 1, a + 1) === "\u002a/") { break; } } else if (source.charAt(a) === quote && quote !== "${") { quote = ""; } else if (quote === "`" && source.slice(a, a + 2) === "${") { quote = "${"; } else if (quote === "${" && source.charAt(a) === "}") { quote = "`"; } } a = a + 1; } while (a < len); if (b > 0) { quote = source.slice(b, a + 1); if (comment === "