import org.w3c.css.sac.LexicalUnit;
import com.vaadin.sass.internal.util.ColorUtil;
+import com.vaadin.sass.internal.util.DeepCopy;
/**
* @version $Revision: 1.3 $
}
public void replaceValue(LexicalUnitImpl another) {
- type = another.getLexicalUnitType();
- i = another.getIntegerValue();
- f = another.getFloatValue();
- s = another.getStringValue();
- fname = another.getFunctionName();
- prev = another.getPreviousLexicalUnit();
- dimension = another.getDimension();
- sdimension = another.getSdimension();
- params = another.getParameters();
-
- LexicalUnitImpl finalNextInAnother = another;
+ // shouldn't modify 'another' directly, should only modify its copy.
+ LexicalUnitImpl deepCopyAnother = (LexicalUnitImpl) DeepCopy
+ .copy(another);
+ type = deepCopyAnother.getLexicalUnitType();
+ i = deepCopyAnother.getIntegerValue();
+ f = deepCopyAnother.getFloatValue();
+ s = deepCopyAnother.getStringValue();
+ fname = deepCopyAnother.getFunctionName();
+ prev = deepCopyAnother.getPreviousLexicalUnit();
+ dimension = deepCopyAnother.getDimension();
+ sdimension = deepCopyAnother.getSdimension();
+ params = deepCopyAnother.getParameters();
+
+ LexicalUnitImpl finalNextInAnother = deepCopyAnother;
while (finalNextInAnother.getNextLexicalUnit() != null) {
finalNextInAnother = finalNextInAnother.getNextLexicalUnit();
}
finalNextInAnother.setNextLexicalUnit(next);
- next = another.next;
+ next = deepCopyAnother.next;
}
public void setParameters(LexicalUnitImpl params) {
@Override
public LexicalUnitImpl clone() {
- LexicalUnitImpl cloned = new LexicalUnitImpl(type, line, column,
- (LexicalUnitImpl) prev);
+ LexicalUnitImpl cloned = new LexicalUnitImpl(type, line, column, prev);
cloned.replaceValue(this);
return cloned;
}
return i;
} else if (f != -1) {
return f;
- } else
+ } else {
return null;
+ }
}
public void setFunctionName(String functionName) {
--- /dev/null
+@mixin test2 ($p1, $p2) {
+ -webkit-test: $p1 $p2;
+ -moz-test: $p1 $p2;
+}
+@mixin test3 ($p1, $p2, $p3) {
+ -webkit-test: $p1 $p2 $p3;
+ -moz-test: $p1 $p2 $p3;
+}
+@include test2(foo, bar);
+@include test3(foo, bar, zoo);
\ No newline at end of file