diff options
author | Henri Sara <hesara@vaadin.com> | 2012-08-10 09:10:40 +0300 |
---|---|---|
committer | Henri Sara <hesara@vaadin.com> | 2012-08-10 09:10:40 +0300 |
commit | 239ce71f498fcdf2809c5561bf5028bf216265ca (patch) | |
tree | 01b7abefa7a870902c80848577d554595ea5da82 /sass | |
parent | 0a4a462fd1e4edc71682d4b350cd03bb27700b72 (diff) | |
download | vaadin-framework-239ce71f498fcdf2809c5561bf5028bf216265ca.tar.gz vaadin-framework-239ce71f498fcdf2809c5561bf5028bf216265ca.zip |
Merge SASS fixes keeping comments, remove hack for reindeer (#9223)
Diffstat (limited to 'sass')
-rw-r--r-- | sass/src/com/vaadin/sass/parser/Parser.java | 108 | ||||
-rw-r--r-- | sass/src/com/vaadin/sass/parser/Parser.jj | 27 |
2 files changed, 73 insertions, 62 deletions
diff --git a/sass/src/com/vaadin/sass/parser/Parser.java b/sass/src/com/vaadin/sass/parser/Parser.java index 710c7d5be7..152ae1ddb2 100644 --- a/sass/src/com/vaadin/sass/parser/Parser.java +++ b/sass/src/com/vaadin/sass/parser/Parser.java @@ -25,6 +25,7 @@ import org.w3c.flute.parser.selectors.SelectorFactoryImpl; import org.w3c.flute.parser.selectors.ConditionFactoryImpl; import org.w3c.flute.util.Encoding; + import com.vaadin.sass.handler.*; import com.vaadin.sass.tree.*; @@ -449,6 +450,7 @@ public class Parser implements org.w3c.css.sac.Parser, ParserConstants { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: jj_consume_token(S); + comments(); break; case CDO: case CDC: @@ -555,14 +557,6 @@ public class Parser implements org.w3c.css.sac.Parser, ParserConstants { label_7: while (true) { ; - if (token.specialToken != null){ - Token tmp_t = token.specialToken; - while (tmp_t.specialToken != null) tmp_t = tmp_t.specialToken; - while (tmp_t != null) { - documentHandler.comment(tmp_t.image); - tmp_t = tmp_t.next; - } - } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case VARIABLE: variable(); @@ -2790,6 +2784,7 @@ LexicalUnit exp; String name; LexicalUnit exp; Token save; + String comment = null; try { name = property(); save = token; @@ -3935,6 +3930,17 @@ LexicalUnit exp; return convertStringIndex(s, 0, s.length()); } + void comments() throws ParseException { + if (token.specialToken != null){ + Token tmp_t = token.specialToken; + while (tmp_t.specialToken != null) tmp_t = tmp_t.specialToken; + while (tmp_t != null) { + documentHandler.comment(tmp_t.image); + tmp_t = tmp_t.next; + } + } + } + void rejectToken(Token t) throws ParseException { Token fakeToken = new Token(); t.next = token; @@ -4149,6 +4155,26 @@ LexicalUnit exp; finally { jj_save(3, xla); } } + private boolean jj_3R_129() { + 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_119() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_129()) { + jj_scanpos = xsp; + if (jj_3R_130()) return true; + } + return false; + } + private boolean jj_3R_168() { if (jj_scan_token(UNICODERANGE)) return true; return false; @@ -4442,24 +4468,6 @@ LexicalUnit exp; return false; } - private boolean jj_3R_124() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_136()) { - jj_scanpos = xsp; - if (jj_3R_137()) { - jj_scanpos = xsp; - if (jj_3R_138()) return true; - } - } - return false; - } - - private boolean jj_3R_136() { - if (jj_scan_token(IDENT)) return true; - return false; - } - private boolean jj_3R_131() { Token xsp; xsp = jj_scanpos; @@ -4523,6 +4531,24 @@ LexicalUnit exp; return false; } + private boolean jj_3R_124() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_136()) { + jj_scanpos = xsp; + if (jj_3R_137()) { + jj_scanpos = xsp; + if (jj_3R_138()) return true; + } + } + return false; + } + + private boolean jj_3R_136() { + if (jj_scan_token(IDENT)) return true; + return false; + } + private boolean jj_3R_108() { if (jj_scan_token(IDENT)) return true; Token xsp; @@ -4533,11 +4559,6 @@ LexicalUnit exp; return false; } - private boolean jj_3R_135() { - if (jj_scan_token(PRECEDES)) return true; - return false; - } - private boolean jj_3R_120() { Token xsp; xsp = jj_scanpos; @@ -4552,6 +4573,11 @@ LexicalUnit exp; return false; } + private boolean jj_3R_135() { + if (jj_scan_token(PRECEDES)) return true; + return false; + } + private boolean jj_3R_107() { Token xsp; xsp = jj_scanpos; @@ -4681,26 +4707,6 @@ LexicalUnit exp; return false; } - private boolean jj_3R_129() { - 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_119() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_129()) { - jj_scanpos = xsp; - if (jj_3R_130()) return true; - } - return false; - } - /** Generated Token Manager. */ public ParserTokenManager token_source; /** Current token. */ diff --git a/sass/src/com/vaadin/sass/parser/Parser.jj b/sass/src/com/vaadin/sass/parser/Parser.jj index 62892c8159..c34dedc596 100644 --- a/sass/src/com/vaadin/sass/parser/Parser.jj +++ b/sass/src/com/vaadin/sass/parser/Parser.jj @@ -43,6 +43,7 @@ import org.w3c.flute.parser.selectors.SelectorFactoryImpl; import org.w3c.flute.parser.selectors.ConditionFactoryImpl; import org.w3c.flute.util.Encoding; + import com.vaadin.sass.handler.*; import com.vaadin.sass.tree.*; @@ -700,7 +701,8 @@ void parserUnit() : try { { documentHandler.startDocument(source); } ( charset() )? - ( <S> | ignoreStatement() )* + ( <S> comments() + | ignoreStatement() )* ( importDeclaration() ( ignoreStatement() ( <S> )* )* )* afterImportDeclaration() <EOF> @@ -731,16 +733,6 @@ void afterImportDeclaration() : } { ( - { - if (token.specialToken != null){ - Token tmp_t = token.specialToken; - while (tmp_t.specialToken != null) tmp_t = tmp_t.specialToken; - while (tmp_t != null) { - documentHandler.comment(tmp_t.image); - tmp_t = tmp_t.next; - } - } - } ( variable() | mixinDirective() | includeDirective() | styleRule() | media()| page() | fontFace() | { l = getLocator(); } ret=skipStatement() { @@ -1583,6 +1575,7 @@ void declarationOrNestedProperties() : String name; LexicalUnit exp; Token save; + String comment = null; } { try { @@ -2355,6 +2348,18 @@ String convertString(String s) { return convertStringIndex(s, 0, s.length()); } +JAVACODE +void comments(){ + if (token.specialToken != null){ + Token tmp_t = token.specialToken; + while (tmp_t.specialToken != null) tmp_t = tmp_t.specialToken; + while (tmp_t != null) { + documentHandler.comment(tmp_t.image); + tmp_t = tmp_t.next; + } + } +} + /* * @@HACK * I can't insert a token into the tokens flow. |