} else if (kid.getType() == ASTCssNodeType.VARIABLE_DECLARATION) {
currentScope.registerVariable((VariableDeclaration) kid);
manipulator.removeFromBody(kid);
} else if (kid.getType() == ASTCssNodeType.REUSABLE_STRUCTURE) {
ReusableStructure mixin = (ReusableStructure) kid;
IScope bodyScope = currentScope.childByOwners(mixin, mixin.getBody());
currentScope.registerMixin(mixin, bodyScope);
bodyScope.removedFromAst();
if (bodyScope.hasParent())
bodyScope.getParent().removedFromAst(); // remove also arguments scope from tree
manipulator.removeFromBody(kid);
} else if (kid.getType() == ASTCssNodeType.DETACHED_RULESET) {
DetachedRuleset detached = (DetachedRuleset) kid;
IScope bodyScope = currentScope.childByOwners(detached, detached.getBody());
if (bodyScope.hasParent())
bodyScope.getParent().removedFromAst(); // remove also arguments scope from tree
bodyScope.removedFromAst();
detached.setScope(bodyScope);
} else if (kid.getType() == ASTCssNodeType.RULE_SET) {
RuleSet ruleSet = (RuleSet) kid;
if (ruleSet.isUsableAsReusableStructure()) {
IScope bodyScope = currentScope.childByOwners(ruleSet, ruleSet.getBody());
currentScope.registerMixin(ruleSet.convertToReusableStructure(), bodyScope);
}
} else if (kid.getType() == ASTCssNodeType.MIXIN_REFERENCE) {
currentScope.createDataPlaceholder();
} else if (kid.getType() == ASTCssNodeType.DETACHED_RULESET_REFERENCE) {
currentScope.createDataPlaceholder();
} else if (AstLogic.isExpression(kid)) {
Expression value = (Expression) kid;
value.setScope(currentScope);
}
}
IScope result = currentScope;
if (hasOwnScope)
decreaseScope();
return result;
}