Skip to content
This repository has been archived by the owner on Oct 27, 2019. It is now read-only.

Commit

Permalink
removing unnecessary code.
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiomcosta committed Apr 30, 2010
1 parent c1d044a commit 3122513
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions Source/Slick.Parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,42 +130,40 @@ function parser(
if (reversed && currentSeparator[combinatorIndex])
currentSeparator[combinatorIndex].reverseCombinator = reverseCombinator(combinator);
currentSeparator[++combinatorIndex] = {combinator: combinator, tag: '*', parts: []};
partIndex = 0;
partIndex = -1;
}

var currentParsed = parsed.expressions[separatorIndex][combinatorIndex];

if (tagName){
currentParsed.tag = tagName.replace(reUnescape, '');
return '';

} else if (id){
currentParsed.id = id.replace(reUnescape, '');
return '';

} else if (className){
className = className.replace(reUnescape, '');

if (!currentParsed.classes) currentParsed.classes = [className];
else currentParsed.classes.push(className);

currentParsed.parts[partIndex] = {
currentParsed.parts[++partIndex] = {
type: 'class',
value: className,
regexp: new RegExp('(^|\\s)' + escapeRegExp(className) + '(\\s|$)')
};
partIndex++;

} else if (pseudoClass){
if (!currentParsed.pseudos) currentParsed.pseudos = [];

var value = pseudoClassValue || null;
if (value) value = value.replace(reUnescape, '');

currentParsed.pseudos.push(currentParsed.parts[partIndex] = {
currentParsed.pseudos.push(currentParsed.parts[++partIndex] = {
type: 'pseudo',
key: pseudoClass.replace(reUnescape, ''),
value: value
});
partIndex++;

} else if (attributeKey){
if (!currentParsed.attributes) currentParsed.attributes = [];
Expand Down Expand Up @@ -199,14 +197,13 @@ function parser(
return value && regexp.test(value);
};

currentParsed.attributes.push(currentParsed.parts[partIndex] = {
currentParsed.attributes.push(currentParsed.parts[++partIndex] = {
type: 'attribute',
key: key,
operator: operator,
value: attribute,
test: test
});
partIndex++;

}

Expand Down

0 comments on commit 3122513

Please sign in to comment.