aboutsummaryrefslogtreecommitdiffstats
path: root/theme-compiler/src/com/vaadin/sass/internal/parser
diff options
context:
space:
mode:
authorLeif Åstrand <leif@vaadin.com>2013-10-22 09:12:59 +0300
committerLeif Åstrand <leif@vaadin.com>2013-10-22 09:12:59 +0300
commitd70961ff2539aabe99eea22683a8ae77efdc81e5 (patch)
treec3876e2266ace7e90d8dc82e35f22631e2ce29e5 /theme-compiler/src/com/vaadin/sass/internal/parser
parenta48370a761a6d0b6c54196da0defdb30b47a5bb1 (diff)
parentee809e5985d7a438e031c40bed160ac78ae8d0bc (diff)
downloadvaadin-framework-d70961ff2539aabe99eea22683a8ae77efdc81e5.tar.gz
vaadin-framework-d70961ff2539aabe99eea22683a8ae77efdc81e5.zip
Merge changes from origin/7.1
c7ae45c Validate that the connector is enabled before triggering actions for it (#12743) ce89a75 Created constants for tested browser versions (#12786) f9ea9b3 Allow running tests locally by overriding runLocally() (#12786) e70ba25 Added liferay module for building liferay.zip #12748 7c12694 Add sub directory support to sass test scanner (#12790) 39fdf66 Handle numbers in the same way if they do not have a unit (#12732) 6155d61 Disable fallback in a way compatible with Atmosphere JS 2.0.3 (#12241) f401595 Test for pushing large chunks of data (#12567) d41967d Skip compilation of TB2 tests if tests.tb2.skip is set 6c1ba81 Reverted button click() logic check (#12743) 779c8a0 Disable automated testing on Opera until issues are resolved (#12487, #12367, #12800) 962c1c3 Fix compilation error 7ee11a7 Remove unused test super class (#12786) a4211dc Resolve concurrency issue in running TB3 tests 20c28aa Fixed javadoc 0d36896 Add more hax to make test work with new Atmosphere JS (#12241) ed50200 Fix serialization issue (#12703) dd51b7f Added more exception handling to PushHandler (#12578, #11882) 6f76840 Sass variables can now start with underscore (#12716) ab5b20c Ticket #12727 - Panels get unnecessary scroll bars in WebKit when content is 100% wide. 361ad17 Fixed focus issue in TableMoveFocusWithSelectionTest (#12540) ee809e5 Revert broken fix and test (#12446) Change-Id: I71b6e3c2dc6b02845794df0934ba807d7ccac784
Diffstat (limited to 'theme-compiler/src/com/vaadin/sass/internal/parser')
-rw-r--r--theme-compiler/src/com/vaadin/sass/internal/parser/LexicalUnitImpl.java26
-rw-r--r--theme-compiler/src/com/vaadin/sass/internal/parser/Parser.jj2
-rw-r--r--theme-compiler/src/com/vaadin/sass/internal/parser/ParserTokenManager.java40
3 files changed, 29 insertions, 39 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 498e1a941b..af94de0f46 100644
--- a/theme-compiler/src/com/vaadin/sass/internal/parser/LexicalUnitImpl.java
+++ b/theme-compiler/src/com/vaadin/sass/internal/parser/LexicalUnitImpl.java
@@ -148,6 +148,22 @@ public class LexicalUnitImpl implements LexicalUnit, SCSSLexicalUnit,
return f;
}
+ /**
+ * Returns the float value as a string unless the value is an integer. In
+ * that case returns the integer value as a string.
+ *
+ * @return a string representing the value, either with or without decimals
+ */
+ public String getFloatOrInteger() {
+ float f = getFloatValue();
+ int i = (int) f;
+ if ((i) == f) {
+ return i + "";
+ } else {
+ return f + "";
+ }
+ }
+
public void setFloatValue(float f) {
this.f = f;
i = (int) f;
@@ -274,7 +290,7 @@ public class LexicalUnitImpl implements LexicalUnit, SCSSLexicalUnit,
text = Integer.toString(getIntegerValue(), 10);
break;
case LexicalUnit.SAC_REAL:
- text = getFloatValue() + "";
+ text = getFloatOrInteger();
break;
case LexicalUnit.SAC_EM:
case SCSSLexicalUnit.SAC_LEM:
@@ -295,13 +311,7 @@ public class LexicalUnitImpl implements LexicalUnit, SCSSLexicalUnit,
case LexicalUnit.SAC_HERTZ:
case LexicalUnit.SAC_KILOHERTZ:
case LexicalUnit.SAC_DIMENSION:
- float f = getFloatValue();
- int i = (int) f;
- if ((i) == f) {
- text = i + getDimensionUnitText();
- } else {
- text = f + getDimensionUnitText();
- }
+ text = getFloatOrInteger() + getDimensionUnitText();
break;
case LexicalUnit.SAC_URI:
text = "url(" + getStringValue() + ")";
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 d563b739b0..871be2c4d0 100644
--- a/theme-compiler/src/com/vaadin/sass/internal/parser/Parser.jj
+++ b/theme-compiler/src/com/vaadin/sass/internal/parser/Parser.jj
@@ -559,7 +559,7 @@ TOKEN : /* basic tokens */
( <H> )? ( <H> )?
( [ " ", "\t" , "\n" , "\r", "\f" ] )? >
| < #ESCAPE : <UNICODE> | ( "\\" [ " "-"~","\200"-"\377" ] ) >
- | < #NMSTART : ("-")?[ "a"-"z"] | <NONASCII> | <ESCAPE> >
+ | < #NMSTART : ("-")?[ "a"-"z","_"] | <NONASCII> | <ESCAPE> >
| < #NMCHAR : ["a"-"z", "0"-"9", "-", "_"] | <NONASCII> | <ESCAPE> >
| < #STRINGCHAR : [ "\t"," ","!","#","$","%","&","("-"~" ]
| "\\\n" | "\\\r\n" | "\\\r" | "\\\f"
diff --git a/theme-compiler/src/com/vaadin/sass/internal/parser/ParserTokenManager.java b/theme-compiler/src/com/vaadin/sass/internal/parser/ParserTokenManager.java
index bf4ebf5c06..224a8dbfc1 100644
--- a/theme-compiler/src/com/vaadin/sass/internal/parser/ParserTokenManager.java
+++ b/theme-compiler/src/com/vaadin/sass/internal/parser/ParserTokenManager.java
@@ -3259,7 +3259,7 @@ public class ParserTokenManager implements ParserConstants {
}
break;
case 162:
- if ((0x7fffffe07fffffeL & l) != 0L) {
+ if ((0x7fffffe87fffffeL & l) != 0L) {
if (kind > 103) {
kind = 103;
}
@@ -3310,10 +3310,10 @@ public class ParserTokenManager implements ParserConstants {
}
break;
case 38:
- if ((0x7fffffe07fffffeL & l) != 0L) {
+ if ((0x7fffffe87fffffeL & l) != 0L) {
jjCheckNAddStates(0, 3);
}
- if ((0x7fffffe07fffffeL & l) != 0L) {
+ if ((0x7fffffe87fffffeL & l) != 0L) {
if (kind > 72) {
kind = 72;
}
@@ -3339,7 +3339,7 @@ public class ParserTokenManager implements ParserConstants {
}
break;
case 24:
- if ((0x7fffffe07fffffeL & l) != 0L) {
+ if ((0x7fffffe87fffffeL & l) != 0L) {
if (kind > 72) {
kind = 72;
}
@@ -3390,7 +3390,7 @@ public class ParserTokenManager implements ParserConstants {
}
break;
case 174:
- if ((0x7fffffe07fffffeL & l) != 0L) {
+ if ((0x7fffffe87fffffeL & l) != 0L) {
if (kind > 103) {
kind = 103;
}
@@ -3408,7 +3408,7 @@ public class ParserTokenManager implements ParserConstants {
}
break;
case 75:
- if ((0x7fffffe07fffffeL & l) != 0L) {
+ if ((0x7fffffe87fffffeL & l) != 0L) {
if (kind > 76) {
kind = 76;
}
@@ -3438,10 +3438,6 @@ public class ParserTokenManager implements ParserConstants {
}
break;
case 4:
- if ((0x7fffffe07fffffeL & l) != 0L) {
- jjCheckNAddStates(138, 140);
- }
- break;
case 5:
if ((0x7fffffe87fffffeL & l) != 0L) {
jjCheckNAddStates(138, 140);
@@ -3671,14 +3667,6 @@ public class ParserTokenManager implements ParserConstants {
}
break;
case 76:
- if ((0x7fffffe07fffffeL & l) == 0L) {
- break;
- }
- if (kind > 76) {
- kind = 76;
- }
- jjCheckNAddTwoStates(77, 78);
- break;
case 77:
if ((0x7fffffe87fffffeL & l) == 0L) {
break;
@@ -3898,7 +3886,7 @@ public class ParserTokenManager implements ParserConstants {
}
break;
case 108:
- if ((0x7fffffe07fffffeL & l) == 0L) {
+ if ((0x7fffffe87fffffeL & l) == 0L) {
break;
}
if (kind > 103) {
@@ -4586,7 +4574,7 @@ public class ParserTokenManager implements ParserConstants {
}
break;
case 267:
- if ((0x7fffffe07fffffeL & l) == 0L) {
+ if ((0x7fffffe87fffffeL & l) == 0L) {
break;
}
if (kind > 72) {
@@ -4595,12 +4583,12 @@ public class ParserTokenManager implements ParserConstants {
jjCheckNAddTwoStates(225, 226);
break;
case 268:
- if ((0x7fffffe07fffffeL & l) != 0L) {
+ if ((0x7fffffe87fffffeL & l) != 0L) {
jjCheckNAddStates(0, 3);
}
break;
case 269:
- if ((0x7fffffe07fffffeL & l) == 0L) {
+ if ((0x7fffffe87fffffeL & l) == 0L) {
break;
}
if (kind > 72) {
@@ -4809,14 +4797,6 @@ public class ParserTokenManager implements ParserConstants {
}
break;
case 333:
- if ((0x7fffffe07fffffeL & l) == 0L) {
- break;
- }
- if (kind > 95) {
- kind = 95;
- }
- jjCheckNAddTwoStates(334, 335);
- break;
case 334:
if ((0x7fffffe87fffffeL & l) == 0L) {
break;