Skip to content

Commit

Permalink
Fix unescapedIndexOf function in order to support escaped closed pare…
Browse files Browse the repository at this point in the history
…ntheses preceded by an escaped backslash in the state.
  • Loading branch information
VittGam committed Apr 26, 2014
1 parent dd00d62 commit e701980
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/TuringMachine.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ var TuringMachine = function(obj){
var output = (typeof startidx == 'undefined' ? 0 : startidx) - 1;
do {
output = input.indexOf(srch, output + 1);
} while (input.charAt(output - 1) === '\\' && input.charAt(output - 2) !== '\\');
} while (input.charAt(output - 1) === '\\' && ((input.charAt(output - 2) !== '\\') || (input.charAt(output - 3) === '\\')));
return output;
};
var getpart = function(grplength, currtype){
Expand Down

0 comments on commit e701980

Please sign in to comment.