if ("rgb(".equals(f)) {
// this is a RGB declaration (e.g. rgb(255, 50%, 0) )
int i = 0;
+ boolean hasVariables = false;
while (loop && l != null && i < 5) {
switch (i) {
case 0:
case 2:
case 4:
- if ((l.getLexicalUnitType() != LexicalUnit.SAC_INTEGER)
+ if (l.getLexicalUnitType() == SCSSLexicalUnit.SCSS_VARIABLE) {
+ hasVariables = true;
+ } else if ((l.getLexicalUnitType() != LexicalUnit.SAC_INTEGER)
&& (l.getLexicalUnitType() != LexicalUnit.SAC_PERCENTAGE)) {
loop = false;
}
}
}
if ((i == 5) && loop && (l == null)) {
- {if (true) return LexicalUnitImpl.createRGBColor(n.beginLine,
- n.beginColumn,
- prev, params);}
+ if (hasVariables) {
+ {if (true) return LexicalUnitImpl.createFunction(n.beginLine,
+ n.beginColumn, prev,
+ f.substring(0, f.length() - 1), params);}
+ } else {
+ {if (true) return LexicalUnitImpl.createRGBColor(n.beginLine,
+ n.beginColumn,
+ prev, params);}
+ }
} else {
if (errorHandler != null) {
String errorText;
return false;
}
+ private boolean jj_3R_256() {
+ if (jj_scan_token(HASH)) return true;
+ return false;
+ }
+
private boolean jj_3R_216() {
if (jj_scan_token(NUMBER)) return true;
return false;
return false;
}
- private boolean jj_3R_256() {
- if (jj_scan_token(HASH)) return true;
+ private boolean jj_3R_257() {
+ if (jj_scan_token(URL)) return true;
return false;
}
return false;
}
- private boolean jj_3R_257() {
- if (jj_scan_token(URL)) return true;
- return false;
- }
-
private boolean jj_3_2() {
if (jj_3R_177()) return true;
if (jj_3R_178()) return true;
return false;
}
+ private boolean jj_3R_258() {
+ if (jj_scan_token(UNICODERANGE)) return true;
+ return false;
+ }
+
private boolean jj_3R_197() {
Token xsp;
xsp = jj_scanpos;
return false;
}
- private boolean jj_3R_258() {
- if (jj_scan_token(UNICODERANGE)) return true;
- return false;
- }
-
private boolean jj_3_8() {
Token xsp;
xsp = jj_scanpos;
if ("rgb(".equals(f)) {
// this is a RGB declaration (e.g. rgb(255, 50%, 0) )
int i = 0;
+ boolean hasVariables = false;
while (loop && l != null && i < 5) {
switch (i) {
case 0:
case 2:
case 4:
- if ((l.getLexicalUnitType() != LexicalUnit.SAC_INTEGER)
+ if (l.getLexicalUnitType() == SCSSLexicalUnit.SCSS_VARIABLE) {
+ hasVariables = true;
+ } else if ((l.getLexicalUnitType() != LexicalUnit.SAC_INTEGER)
&& (l.getLexicalUnitType() != LexicalUnit.SAC_PERCENTAGE)) {
loop = false;
}
}
}
if ((i == 5) && loop && (l == null)) {
- return LexicalUnitImpl.createRGBColor(n.beginLine,
- n.beginColumn,
- prev, params);
+ if (hasVariables) {
+ return LexicalUnitImpl.createFunction(n.beginLine,
+ n.beginColumn, prev,
+ f.substring(0, f.length() - 1), params);
+ } else {
+ return LexicalUnitImpl.createRGBColor(n.beginLine,
+ n.beginColumn,
+ prev, params);
+ }
} else {
if (errorHandler != null) {
String errorText;
$base-color : hsl(33, 7%, 89%);
$app-bg-color : lighten($base-color, 6%);
+$red:1;
+$green:2;
+$blue:3;
.main {
margin: abs(-2px);
border: ceil(10.4px);
color: lighten(#800, 20%);
color : $base-color;
color : $app-bg-color;
+ color: rgb($red, $green, $blue);
}
\ No newline at end of file
parser.setDocumentHandler(handler);
parser.parseStyleSheet(getClass().getResource(scss).getPath());
ScssStylesheet root = handler.getStyleSheet();
- Assert.assertEquals(3, root.getChildren().size());
- BlockNode blockNode = (BlockNode) root.getChildren().get(2);
- Assert.assertEquals(14, blockNode.getChildren().size());
+ Assert.assertEquals(6, root.getChildren().size());
+ BlockNode blockNode = (BlockNode) root.getChildren().get(5);
+ Assert.assertEquals(15, blockNode.getChildren().size());
}
@Test