1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-12-24 17:10:29 +00:00

Removed unused vars + some whitespace (#2106)

This commit is contained in:
Tobias Beer 2016-10-08 14:32:14 +02:00 committed by Jeremy Ruston
parent f575389d89
commit bf253a603b

View File

@ -20,7 +20,7 @@ Parses an operation (i.e. a run) within a filter string
Returns the new start position, after the parsed operation Returns the new start position, after the parsed operation
*/ */
function parseFilterOperation(operators,filterString,p) { function parseFilterOperation(operators,filterString,p) {
var operator, operand, bracketPos, curlyBracketPos; var nextBracketPos, operator;
// Skip the starting square bracket // Skip the starting square bracket
if(filterString.charAt(p++) !== "[") { if(filterString.charAt(p++) !== "[") {
throw "Missing [ in filter expression"; throw "Missing [ in filter expression";
@ -33,14 +33,14 @@ function parseFilterOperation(operators,filterString,p) {
operator.prefix = filterString.charAt(p++); operator.prefix = filterString.charAt(p++);
} }
// Get the operator name // Get the operator name
var nextBracketPos = filterString.substring(p).search(/[\[\{<\/]/); nextBracketPos = filterString.substring(p).search(/[\[\{<\/]/);
if(nextBracketPos === -1) { if(nextBracketPos === -1) {
throw "Missing [ in filter expression"; throw "Missing [ in filter expression";
} }
nextBracketPos += p; nextBracketPos += p;
var bracket = filterString.charAt(nextBracketPos); var bracket = filterString.charAt(nextBracketPos);
operator.operator = filterString.substring(p,nextBracketPos); operator.operator = filterString.substring(p,nextBracketPos);
// Any suffix? // Any suffix?
var colon = operator.operator.indexOf(':'); var colon = operator.operator.indexOf(':');
if(colon > -1) { if(colon > -1) {
@ -79,7 +79,7 @@ console.log("WARNING: Filter",operator.operator,"has a deprecated regexp operand
} }
break; break;
} }
if(nextBracketPos === -1) { if(nextBracketPos === -1) {
throw "Missing closing bracket in filter expression"; throw "Missing closing bracket in filter expression";
} }
@ -87,7 +87,7 @@ console.log("WARNING: Filter",operator.operator,"has a deprecated regexp operand
operator.operand = filterString.substring(p,nextBracketPos); operator.operand = filterString.substring(p,nextBracketPos);
} }
p = nextBracketPos + 1; p = nextBracketPos + 1;
// Push this operator // Push this operator
operators.push(operator); operators.push(operator);
} while(filterString.charAt(p) !== "]"); } while(filterString.charAt(p) !== "]");