command.index = lastIndex; 
command.index = docResult.index; 
function parse(testCase, source) {	var commandRegexp = new RegExp(options.commandLoadPattern, 'i');	var commentRegexp = new RegExp(options.commentLoadPattern, 'i');	var commandOrCommentRegexp = new RegExp("((" + options.commandLoadPattern + ")|(" + options.commentLoadPattern + "))", 'ig');	var doc = source;	var commands = [];	var commandFound = false;	var lastIndex;	while (true) {		//log.debug("doc=" + doc + ", commandRegexp=" + commandRegexp);		lastIndex = commandOrCommentRegexp.lastIndex;		var docResult = commandOrCommentRegexp.exec(doc);		if (docResult) {			if (docResult[2]) { // command				var command = new Command();				command.skip = docResult.index - lastIndex;				command.index = lastIndex;				var result = commandRegexp.exec(doc.substring(lastIndex));				eval(options.commandLoadScript);				convertText(command, decodeText);				commands.push(command);				if (!commandFound) {					// remove comments before the first command or comment					for (var i = commands.length - 1; i >= 0; i--) {						if (commands[i].skip > 0) {							commands.splice(0, i);							break;						}					}					testCase.header = doc.substr(0, commands[0].index);					commandFound = true;				}			} else { // comment				var comment = new Comment();				comment.skip = docResult.index - lastIndex;				comment.index = docResult.index;				var result = commentRegexp.exec(doc.substring(lastIndex));				eval(options.commentLoadScript);				commands.push(comment);			}		} else {			break;		}	}	if (commands.length > 0) {		testCase.footer = doc.substring(lastIndex);		log.debug("header=" + testCase.header);		log.debug("footer=" + testCase.footer);		//log.debug("commands.length=" + commands.length);		testCase.commands = commands;	} else {		throw "no command found";	}}
4983	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/4983/8e4cbd59f033253dde6657bd51046e3d0efd7547/html.js/clean/src/content/formats/html.js