aboutsummaryrefslogtreecommitdiffstats
path: root/theme-compiler/src/com/vaadin/sass/internal/parser
diff options
context:
space:
mode:
authorJonatan Kronqvist <jonatan@vaadin.com>2014-02-10 13:14:12 +0200
committerJonatan Kronqvist <jonatan@vaadin.com>2014-02-10 13:14:12 +0200
commit4f4ac0276b999d22a6e6b57d6073d6a643dd8c66 (patch)
treeafcb8307b5739fbf66c82117a7af29dc564c0481 /theme-compiler/src/com/vaadin/sass/internal/parser
parenta5b079d1defa45b790a183bbc63dd1154ec0168c (diff)
parent915c37b569600a8d37db2a0800a30474da49e255 (diff)
downloadvaadin-framework-4f4ac0276b999d22a6e6b57d6073d6a643dd8c66.tar.gz
vaadin-framework-4f4ac0276b999d22a6e6b57d6073d6a643dd8c66.zip
Merge commit '915c37b569600a8d37db2a0800a30474da49e255' into master
915c37b Sass compiler now treats null-valued variables as unassigned (#12430). Conflicts: theme-compiler/src/com/vaadin/sass/internal/parser/Parser.java Change-Id: If9789f8d0638377d27e77ec4be0fdf0f96e4b1af
Diffstat (limited to 'theme-compiler/src/com/vaadin/sass/internal/parser')
-rw-r--r--theme-compiler/src/com/vaadin/sass/internal/parser/LexicalUnitImpl.java8
-rw-r--r--theme-compiler/src/com/vaadin/sass/internal/parser/Parser.java510
-rw-r--r--theme-compiler/src/com/vaadin/sass/internal/parser/Parser.jj19
-rw-r--r--theme-compiler/src/com/vaadin/sass/internal/parser/SCSSLexicalUnit.java2
4 files changed, 293 insertions, 246 deletions
diff --git a/theme-compiler/src/com/vaadin/sass/internal/parser/LexicalUnitImpl.java b/theme-compiler/src/com/vaadin/sass/internal/parser/LexicalUnitImpl.java
index e03cea8cfe..af1165adac 100644
--- a/theme-compiler/src/com/vaadin/sass/internal/parser/LexicalUnitImpl.java
+++ b/theme-compiler/src/com/vaadin/sass/internal/parser/LexicalUnitImpl.java
@@ -247,6 +247,9 @@ public class LexicalUnitImpl implements LexicalUnit, SCSSLexicalUnit,
case SCSS_VARIABLE:
text = "$" + s;
break;
+ case SCSS_NULL:
+ text = "";
+ break;
case LexicalUnit.SAC_OPERATOR_COMMA:
text = ",";
break;
@@ -492,6 +495,11 @@ public class LexicalUnitImpl implements LexicalUnit, SCSSLexicalUnit,
return new LexicalUnitImpl(line, column, previous, SCSS_VARIABLE, name);
}
+ public static LexicalUnitImpl createNull(int line, int column,
+ LexicalUnitImpl previous) {
+ return new LexicalUnitImpl(line, column, previous, SCSS_NULL, "null");
+ }
+
public static LexicalUnitImpl createNumber(int line, int column,
LexicalUnitImpl previous, float v) {
int i = (int) v;
diff --git a/theme-compiler/src/com/vaadin/sass/internal/parser/Parser.java b/theme-compiler/src/com/vaadin/sass/internal/parser/Parser.java
index 0c10e09a6c..e68b24355b 100644
--- a/theme-compiler/src/com/vaadin/sass/internal/parser/Parser.java
+++ b/theme-compiler/src/com/vaadin/sass/internal/parser/Parser.java
@@ -2666,6 +2666,7 @@ boolean isPseudoElement = false;
break label_67;
}
}
+ exp = replaceNullValues(exp);
documentHandler.variable(name, exp, guarded);
} catch (JumpException e) {
skipAfterExpression();
@@ -2694,6 +2695,23 @@ boolean isPseudoElement = false;
}
}
+ LexicalUnitImpl replaceNullValues(LexicalUnitImpl unit) throws ParseException {
+ if(unit == null){
+ return null;
+ }
+ if (unit.getNextLexicalUnit() != null) {
+ unit.setNextLexicalUnit(replaceNullValues(unit.getNextLexicalUnit()));
+ }
+ if (unit.getLexicalUnitType() == SCSSLexicalUnit.SAC_IDENT
+ && "null".equals(unit.getStringValue())) {
+ LexicalUnitImpl next = unit.getNextLexicalUnit();
+ unit = LexicalUnitImpl.createNull(unit.getLineNumber(), unit.getColumnNumber(),
+ unit.getPreviousLexicalUnit());
+ unit.setNextLexicalUnit(next);
+ }
+ return unit;
+ }
+
final public void controlDirective() throws ParseException {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case IF_SYM:
@@ -6547,6 +6565,34 @@ LexicalUnitImpl result = null;
finally { jj_save(8, xla); }
}
+ private boolean jj_3R_194() {
+ if (jj_scan_token(VARIABLE)) return true;
+ Token xsp;
+ while (true) {
+ xsp = jj_scanpos;
+ if (jj_scan_token(1)) { jj_scanpos = xsp; break; }
+ }
+ if (jj_scan_token(COLON)) return true;
+ while (true) {
+ xsp = jj_scanpos;
+ if (jj_scan_token(1)) { jj_scanpos = xsp; break; }
+ }
+ return false;
+ }
+
+ private boolean jj_3R_179() {
+ Token xsp;
+ xsp = jj_scanpos;
+ if (jj_3R_194()) jj_scanpos = xsp;
+ if (jj_scan_token(CONTAINS)) return true;
+ while (true) {
+ xsp = jj_scanpos;
+ if (jj_scan_token(1)) { jj_scanpos = xsp; break; }
+ }
+ if (true) { jj_la = 0; jj_scanpos = jj_lastpos; return false;}
+ return false;
+ }
+
private boolean jj_3R_212() {
if (jj_3R_211()) return true;
return false;
@@ -6569,21 +6615,6 @@ LexicalUnitImpl result = null;
return false;
}
- private boolean jj_3R_194() {
- if (jj_scan_token(VARIABLE)) return true;
- Token xsp;
- while (true) {
- xsp = jj_scanpos;
- if (jj_scan_token(1)) { jj_scanpos = xsp; break; }
- }
- if (jj_scan_token(COLON)) return true;
- while (true) {
- xsp = jj_scanpos;
- if (jj_scan_token(1)) { jj_scanpos = xsp; break; }
- }
- return false;
- }
-
private boolean jj_3R_191() {
if (jj_scan_token(S)) return true;
Token xsp;
@@ -6592,19 +6623,6 @@ LexicalUnitImpl result = null;
return false;
}
- private boolean jj_3R_179() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_194()) jj_scanpos = xsp;
- if (jj_scan_token(CONTAINS)) return true;
- while (true) {
- xsp = jj_scanpos;
- if (jj_scan_token(1)) { jj_scanpos = xsp; break; }
- }
- if (true) { jj_la = 0; jj_scanpos = jj_lastpos; return false;}
- return false;
- }
-
private boolean jj_3R_176() {
if (jj_3R_186()) return true;
if (jj_scan_token(COLON)) return true;
@@ -6644,6 +6662,11 @@ LexicalUnitImpl result = null;
return false;
}
+ private boolean jj_3_7() {
+ if (jj_3R_183()) return true;
+ return false;
+ }
+
private boolean jj_3R_279() {
if (jj_scan_token(IDENT)) return true;
return false;
@@ -6660,8 +6683,8 @@ LexicalUnitImpl result = null;
return false;
}
- private boolean jj_3_7() {
- if (jj_3R_183()) return true;
+ private boolean jj_3R_201() {
+ if (jj_scan_token(LBRACE)) return true;
return false;
}
@@ -6670,8 +6693,8 @@ LexicalUnitImpl result = null;
return false;
}
- private boolean jj_3R_201() {
- if (jj_scan_token(LBRACE)) return true;
+ private boolean jj_3R_200() {
+ if (jj_3R_187()) return true;
return false;
}
@@ -6688,11 +6711,6 @@ LexicalUnitImpl result = null;
return false;
}
- private boolean jj_3R_200() {
- if (jj_3R_187()) return true;
- return false;
- }
-
private boolean jj_3_6() {
if (jj_3R_182()) return true;
if (jj_scan_token(LBRACE)) return true;
@@ -6720,11 +6738,6 @@ LexicalUnitImpl result = null;
return false;
}
- private boolean jj_3R_290() {
- if (jj_scan_token(STRING)) return true;
- return false;
- }
-
private boolean jj_3R_254() {
if (jj_scan_token(FUNCTION)) return true;
Token xsp;
@@ -6738,6 +6751,26 @@ LexicalUnitImpl result = null;
return false;
}
+ private boolean jj_3R_241() {
+ if (jj_3R_258()) return true;
+ return false;
+ }
+
+ private boolean jj_3R_240() {
+ if (jj_3R_257()) return true;
+ return false;
+ }
+
+ private boolean jj_3R_239() {
+ if (jj_3R_256()) return true;
+ return false;
+ }
+
+ private boolean jj_3R_290() {
+ if (jj_scan_token(STRING)) return true;
+ return false;
+ }
+
private boolean jj_3R_288() {
if (jj_scan_token(STARMATCH)) return true;
return false;
@@ -6813,21 +6846,6 @@ LexicalUnitImpl result = null;
return false;
}
- private boolean jj_3R_241() {
- if (jj_3R_258()) return true;
- return false;
- }
-
- private boolean jj_3R_240() {
- if (jj_3R_257()) return true;
- return false;
- }
-
- private boolean jj_3R_239() {
- if (jj_3R_256()) return true;
- return false;
- }
-
private boolean jj_3R_264() {
if (jj_scan_token(LBRACKET)) return true;
Token xsp;
@@ -6846,6 +6864,16 @@ LexicalUnitImpl result = null;
return false;
}
+ private boolean jj_3R_180() {
+ if (jj_scan_token(COMMA)) return true;
+ Token xsp;
+ while (true) {
+ xsp = jj_scanpos;
+ if (jj_scan_token(1)) { jj_scanpos = xsp; break; }
+ }
+ return false;
+ }
+
private boolean jj_3R_282() {
if (jj_scan_token(INTERPOLATION)) return true;
return false;
@@ -6861,6 +6889,37 @@ LexicalUnitImpl result = null;
return false;
}
+ private boolean jj_3R_255() {
+ if (jj_scan_token(DOT)) return true;
+ return false;
+ }
+
+ private boolean jj_3R_238() {
+ Token xsp;
+ xsp = jj_scanpos;
+ if (jj_3R_255()) jj_scanpos = xsp;
+ xsp = jj_scanpos;
+ if (jj_scan_token(72)) {
+ jj_scanpos = xsp;
+ if (jj_scan_token(49)) {
+ jj_scanpos = xsp;
+ if (jj_scan_token(50)) {
+ jj_scanpos = xsp;
+ if (jj_scan_token(52)) return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ private boolean jj_3_5() {
+ Token xsp;
+ xsp = jj_scanpos;
+ if (jj_3R_180()) jj_scanpos = xsp;
+ if (jj_3R_181()) return true;
+ return false;
+ }
+
private boolean jj_3R_261() {
Token xsp;
xsp = jj_scanpos;
@@ -6876,6 +6935,11 @@ LexicalUnitImpl result = null;
return false;
}
+ private boolean jj_3R_237() {
+ if (jj_scan_token(STRING)) return true;
+ return false;
+ }
+
private boolean jj_3R_213() {
Token xsp;
xsp = jj_scanpos;
@@ -6899,69 +6963,57 @@ LexicalUnitImpl result = null;
return false;
}
- private boolean jj_3R_180() {
- if (jj_scan_token(COMMA)) return true;
- Token xsp;
- while (true) {
- xsp = jj_scanpos;
- if (jj_scan_token(1)) { jj_scanpos = xsp; break; }
- }
+ private boolean jj_3R_236() {
+ if (jj_3R_254()) return true;
return false;
}
- private boolean jj_3R_276() {
+ private boolean jj_3R_196() {
Token xsp;
xsp = jj_scanpos;
- if (jj_3R_281()) {
+ if (jj_3R_237()) {
jj_scanpos = xsp;
- if (jj_3R_282()) return true;
+ if (jj_3R_238()) {
+ jj_scanpos = xsp;
+ if (jj_3R_239()) {
+ jj_scanpos = xsp;
+ if (jj_3R_240()) {
+ jj_scanpos = xsp;
+ if (jj_3R_241()) return true;
+ }
+ }
+ }
}
return false;
}
- private boolean jj_3R_281() {
- if (jj_scan_token(IDENT)) return true;
- return false;
- }
-
- private boolean jj_3R_255() {
- if (jj_scan_token(DOT)) return true;
+ private boolean jj_3R_235() {
+ if (jj_scan_token(DIMEN)) return true;
return false;
}
- private boolean jj_3R_238() {
+ private boolean jj_3R_276() {
Token xsp;
xsp = jj_scanpos;
- if (jj_3R_255()) jj_scanpos = xsp;
- xsp = jj_scanpos;
- if (jj_scan_token(72)) {
- jj_scanpos = xsp;
- if (jj_scan_token(49)) {
- jj_scanpos = xsp;
- if (jj_scan_token(50)) {
+ if (jj_3R_281()) {
jj_scanpos = xsp;
- if (jj_scan_token(52)) return true;
- }
- }
+ if (jj_3R_282()) return true;
}
return false;
}
- private boolean jj_3_5() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_180()) jj_scanpos = xsp;
- if (jj_3R_181()) return true;
+ private boolean jj_3R_281() {
+ if (jj_scan_token(IDENT)) return true;
return false;
}
- private boolean jj_3R_237() {
- if (jj_scan_token(STRING)) return true;
+ private boolean jj_3R_234() {
+ if (jj_scan_token(KHZ)) return true;
return false;
}
- private boolean jj_3R_236() {
- if (jj_3R_254()) return true;
+ private boolean jj_3R_233() {
+ if (jj_scan_token(HZ)) return true;
return false;
}
@@ -6976,22 +7028,18 @@ LexicalUnitImpl result = null;
return false;
}
- private boolean jj_3R_196() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_237()) {
- jj_scanpos = xsp;
- if (jj_3R_238()) {
- jj_scanpos = xsp;
- if (jj_3R_239()) {
- jj_scanpos = xsp;
- if (jj_3R_240()) {
- jj_scanpos = xsp;
- if (jj_3R_241()) return true;
- }
- }
- }
- }
+ private boolean jj_3R_232() {
+ if (jj_scan_token(MS)) return true;
+ return false;
+ }
+
+ private boolean jj_3R_231() {
+ if (jj_scan_token(SECOND)) return true;
+ return false;
+ }
+
+ private boolean jj_3R_230() {
+ if (jj_scan_token(GRAD)) return true;
return false;
}
@@ -7005,13 +7053,13 @@ LexicalUnitImpl result = null;
return false;
}
- private boolean jj_3R_235() {
- if (jj_scan_token(DIMEN)) return true;
+ private boolean jj_3R_229() {
+ if (jj_scan_token(RAD)) return true;
return false;
}
- private boolean jj_3R_234() {
- if (jj_scan_token(KHZ)) return true;
+ private boolean jj_3R_228() {
+ if (jj_scan_token(DEG)) return true;
return false;
}
@@ -7020,33 +7068,33 @@ LexicalUnitImpl result = null;
return false;
}
- private boolean jj_3R_250() {
- if (jj_3R_263()) return true;
+ private boolean jj_3R_227() {
+ if (jj_scan_token(EXS)) return true;
return false;
}
- private boolean jj_3R_233() {
- if (jj_scan_token(HZ)) return true;
+ private boolean jj_3R_250() {
+ if (jj_3R_263()) return true;
return false;
}
- private boolean jj_3R_232() {
- if (jj_scan_token(MS)) return true;
+ private boolean jj_3R_226() {
+ if (jj_scan_token(REM)) return true;
return false;
}
- private boolean jj_3R_231() {
- if (jj_scan_token(SECOND)) return true;
+ private boolean jj_3R_225() {
+ if (jj_scan_token(LEM)) return true;
return false;
}
- private boolean jj_3R_230() {
- if (jj_scan_token(GRAD)) return true;
+ private boolean jj_3R_224() {
+ if (jj_scan_token(EMS)) return true;
return false;
}
- private boolean jj_3R_229() {
- if (jj_scan_token(RAD)) return true;
+ private boolean jj_3R_223() {
+ if (jj_scan_token(PX)) return true;
return false;
}
@@ -7060,8 +7108,8 @@ LexicalUnitImpl result = null;
return false;
}
- private boolean jj_3R_228() {
- if (jj_scan_token(DEG)) return true;
+ private boolean jj_3R_222() {
+ if (jj_scan_token(IN)) return true;
return false;
}
@@ -7086,8 +7134,8 @@ LexicalUnitImpl result = null;
return false;
}
- private boolean jj_3R_227() {
- if (jj_scan_token(EXS)) return true;
+ private boolean jj_3R_221() {
+ if (jj_scan_token(PC)) return true;
return false;
}
@@ -7112,8 +7160,8 @@ LexicalUnitImpl result = null;
return false;
}
- private boolean jj_3R_226() {
- if (jj_scan_token(REM)) return true;
+ private boolean jj_3R_220() {
+ if (jj_scan_token(MM)) return true;
return false;
}
@@ -7127,8 +7175,8 @@ LexicalUnitImpl result = null;
return false;
}
- private boolean jj_3R_225() {
- if (jj_scan_token(LEM)) return true;
+ private boolean jj_3R_219() {
+ if (jj_scan_token(CM)) return true;
return false;
}
@@ -7142,8 +7190,8 @@ LexicalUnitImpl result = null;
return false;
}
- private boolean jj_3R_224() {
- if (jj_scan_token(EMS)) return true;
+ private boolean jj_3R_218() {
+ if (jj_scan_token(PT)) return true;
return false;
}
@@ -7157,8 +7205,8 @@ LexicalUnitImpl result = null;
return false;
}
- private boolean jj_3R_223() {
- if (jj_scan_token(PX)) return true;
+ private boolean jj_3R_217() {
+ if (jj_scan_token(PERCENTAGE)) return true;
return false;
}
@@ -7168,36 +7216,6 @@ LexicalUnitImpl result = null;
return false;
}
- private boolean jj_3R_222() {
- if (jj_scan_token(IN)) return true;
- return false;
- }
-
- private boolean jj_3R_221() {
- if (jj_scan_token(PC)) return true;
- return false;
- }
-
- private boolean jj_3R_220() {
- if (jj_scan_token(MM)) return true;
- return false;
- }
-
- private boolean jj_3R_219() {
- if (jj_scan_token(CM)) return true;
- return false;
- }
-
- private boolean jj_3R_218() {
- if (jj_scan_token(PT)) return true;
- return false;
- }
-
- private boolean jj_3R_217() {
- if (jj_scan_token(PERCENTAGE)) return true;
- return false;
- }
-
private boolean jj_3R_203() {
if (jj_3R_245()) return true;
return false;
@@ -7301,28 +7319,6 @@ LexicalUnitImpl result = null;
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_198() {
- if (jj_scan_token(COMMA)) return true;
- Token xsp;
- while (true) {
- xsp = jj_scanpos;
- if (jj_scan_token(1)) { jj_scanpos = xsp; break; }
- }
- if (jj_3R_197()) return true;
- return false;
- }
-
- private boolean jj_3R_242() {
- if (jj_3R_178()) return true;
- return false;
- }
-
private boolean jj_3R_245() {
if (jj_3R_186()) return true;
return false;
@@ -7333,21 +7329,9 @@ LexicalUnitImpl result = null;
return false;
}
- private boolean jj_3R_197() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_242()) {
- jj_scanpos = xsp;
- if (jj_3R_243()) return true;
- }
- while (true) {
- xsp = jj_scanpos;
- if (jj_3_2()) { jj_scanpos = xsp; break; }
- }
- while (true) {
- xsp = jj_scanpos;
- if (jj_scan_token(1)) { jj_scanpos = xsp; break; }
- }
+ private boolean jj_3_2() {
+ if (jj_3R_177()) return true;
+ if (jj_3R_178()) return true;
return false;
}
@@ -7371,12 +7355,36 @@ LexicalUnitImpl result = null;
return false;
}
- private boolean jj_3R_182() {
+ private boolean jj_3R_198() {
+ if (jj_scan_token(COMMA)) return true;
+ Token xsp;
+ while (true) {
+ xsp = jj_scanpos;
+ if (jj_scan_token(1)) { jj_scanpos = xsp; break; }
+ }
if (jj_3R_197()) return true;
+ return false;
+ }
+
+ private boolean jj_3R_242() {
+ if (jj_3R_178()) return true;
+ return false;
+ }
+
+ private boolean jj_3R_197() {
Token xsp;
+ xsp = jj_scanpos;
+ if (jj_3R_242()) {
+ jj_scanpos = xsp;
+ if (jj_3R_243()) return true;
+ }
while (true) {
xsp = jj_scanpos;
- if (jj_3R_198()) { jj_scanpos = xsp; break; }
+ if (jj_3_2()) { jj_scanpos = xsp; break; }
+ }
+ while (true) {
+ xsp = jj_scanpos;
+ if (jj_scan_token(1)) { jj_scanpos = xsp; break; }
}
return false;
}
@@ -7401,11 +7409,6 @@ LexicalUnitImpl result = null;
return false;
}
- private boolean jj_3_1() {
- if (jj_3R_176()) return true;
- return false;
- }
-
private boolean jj_3R_258() {
if (jj_scan_token(UNICODERANGE)) return true;
return false;
@@ -7434,6 +7437,21 @@ LexicalUnitImpl result = null;
return false;
}
+ private boolean jj_3R_182() {
+ if (jj_3R_197()) return true;
+ Token xsp;
+ while (true) {
+ xsp = jj_scanpos;
+ if (jj_3R_198()) { jj_scanpos = xsp; break; }
+ }
+ return false;
+ }
+
+ private boolean jj_3_1() {
+ if (jj_3R_176()) return true;
+ return false;
+ }
+
private boolean jj_3R_209() {
if (jj_scan_token(MINUS)) return true;
Token xsp;
@@ -7445,11 +7463,6 @@ LexicalUnitImpl result = null;
return false;
}
- private boolean jj_3R_260() {
- if (jj_scan_token(INTERPOLATION)) return true;
- return false;
- }
-
private boolean jj_3R_208() {
if (jj_scan_token(PLUS)) return true;
Token xsp;
@@ -7486,28 +7499,13 @@ LexicalUnitImpl result = null;
return false;
}
- private boolean jj_3R_205() {
- if (jj_scan_token(DIV)) return true;
- Token xsp;
- while (true) {
- xsp = jj_scanpos;
- if (jj_scan_token(1)) { jj_scanpos = xsp; break; }
- }
- return false;
- }
-
- private boolean jj_3R_186() {
- if (jj_scan_token(VARIABLE)) return true;
- Token xsp;
- while (true) {
- xsp = jj_scanpos;
- if (jj_scan_token(1)) { jj_scanpos = xsp; break; }
- }
+ private boolean jj_3R_260() {
+ if (jj_scan_token(INTERPOLATION)) return true;
return false;
}
- private boolean jj_3R_189() {
- if (jj_scan_token(SEMICOLON)) return true;
+ private boolean jj_3R_205() {
+ if (jj_scan_token(DIV)) return true;
Token xsp;
while (true) {
xsp = jj_scanpos;
@@ -7548,6 +7546,36 @@ LexicalUnitImpl result = null;
return false;
}
+ private boolean jj_3R_210() {
+ if (jj_scan_token(GUARDED_SYM)) return true;
+ Token xsp;
+ while (true) {
+ xsp = jj_scanpos;
+ if (jj_scan_token(1)) { jj_scanpos = xsp; break; }
+ }
+ return false;
+ }
+
+ private boolean jj_3R_186() {
+ if (jj_scan_token(VARIABLE)) return true;
+ Token xsp;
+ while (true) {
+ xsp = jj_scanpos;
+ if (jj_scan_token(1)) { jj_scanpos = xsp; break; }
+ }
+ return false;
+ }
+
+ private boolean jj_3R_189() {
+ if (jj_scan_token(SEMICOLON)) return true;
+ Token xsp;
+ while (true) {
+ xsp = jj_scanpos;
+ if (jj_scan_token(1)) { jj_scanpos = xsp; break; }
+ }
+ return false;
+ }
+
private boolean jj_3R_244() {
Token xsp;
xsp = jj_scanpos;
@@ -7577,16 +7605,6 @@ LexicalUnitImpl result = null;
return false;
}
- private boolean jj_3R_210() {
- if (jj_scan_token(GUARDED_SYM)) return true;
- Token xsp;
- while (true) {
- xsp = jj_scanpos;
- if (jj_scan_token(1)) { jj_scanpos = xsp; break; }
- }
- return false;
- }
-
private boolean jj_3R_188() {
if (jj_3R_210()) return true;
return false;
diff --git a/theme-compiler/src/com/vaadin/sass/internal/parser/Parser.jj b/theme-compiler/src/com/vaadin/sass/internal/parser/Parser.jj
index 2b6e809088..f8b6a86af7 100644
--- a/theme-compiler/src/com/vaadin/sass/internal/parser/Parser.jj
+++ b/theme-compiler/src/com/vaadin/sass/internal/parser/Parser.jj
@@ -1493,6 +1493,7 @@ void variable() :
":" ( <S> )* exp=expr() ( guarded=guarded() )?(";"(<S>)*)+
//raw=skipStatementUntilSemiColon()
{
+ exp = replaceNullValues(exp);
documentHandler.variable(name, exp, guarded);
}
}catch (JumpException e) {
@@ -1522,6 +1523,24 @@ void variable() :
}
}
+JAVACODE
+LexicalUnitImpl replaceNullValues(LexicalUnitImpl unit) {
+ if(unit == null){
+ return null;
+ }
+ if (unit.getNextLexicalUnit() != null) {
+ unit.setNextLexicalUnit(replaceNullValues(unit.getNextLexicalUnit()));
+ }
+ if (unit.getLexicalUnitType() == SCSSLexicalUnit.SAC_IDENT
+ && "null".equals(unit.getStringValue())) {
+ LexicalUnitImpl next = unit.getNextLexicalUnit();
+ unit = LexicalUnitImpl.createNull(unit.getLineNumber(), unit.getColumnNumber(),
+ unit.getPreviousLexicalUnit());
+ unit.setNextLexicalUnit(next);
+ }
+ return unit;
+}
+
void controlDirective() :
{}
{
diff --git a/theme-compiler/src/com/vaadin/sass/internal/parser/SCSSLexicalUnit.java b/theme-compiler/src/com/vaadin/sass/internal/parser/SCSSLexicalUnit.java
index 709d1d3576..84b0563493 100644
--- a/theme-compiler/src/com/vaadin/sass/internal/parser/SCSSLexicalUnit.java
+++ b/theme-compiler/src/com/vaadin/sass/internal/parser/SCSSLexicalUnit.java
@@ -22,6 +22,8 @@ public interface SCSSLexicalUnit extends LexicalUnit {
static final short SCSS_OPERATOR_LEFT_PAREN = 101;
static final short SCSS_OPERATOR_RIGHT_PAREN = 102;
+ static final short SCSS_NULL = 110;
+
static final short SAC_LEM = 200;
static final short SAC_REM = 201;