if (value.getLexicalUnitType() == LexicalUnitImpl.SAC_FUNCTION) {
if (value.getParameters() != null) {
if (StringUtil.containsVariable(value.getParameters()
.toString(), node.getName())) {
LexicalUnitImpl param = value.getParameters();
while (param != null) {
if (param.getLexicalUnitType() == LexicalUnitImpl.SCSS_VARIABLE
&& param.getValue().toString()
.equals(node.getName())) {
param.replaceValue(node.getExpr());
}
param = param.getNextLexicalUnit();
}
}
}
} else if (value.getStringValue() != null
&& value.getStringValue().contains(interpolation)) {
LexicalUnitImpl current = value;
while (current != null) {
if (current.getValue().toString().contains(interpolation)) {
current.setStringValue(current
.getValue()
.toString()
.replaceAll(Pattern.quote(interpolation),
node.getExpr().toString()));
}
current = current.getNextLexicalUnit();
}
} else {
LexicalUnitImpl current = value;
while (current != null) {
if (current.getLexicalUnitType() == LexicalUnitImpl.SCSS_VARIABLE
&& current.getValue().toString()
.equals(node.getName())) {
current.replaceValue(node.getExpr());
}
current = current.getNextLexicalUnit();
}
}
}
}