summaryrefslogtreecommitdiffstats
path: root/theme-compiler/src
diff options
context:
space:
mode:
authorJonatan Kronqvist <jonatan@vaadin.com>2014-02-06 16:42:09 +0200
committerJonatan Kronqvist <jonatan@vaadin.com>2014-02-06 16:46:06 +0200
commit3597d27d9a6441632656ff597d14953f377c2990 (patch)
tree75b2f1023fa0234976c23fc59d3ad5ce58963681 /theme-compiler/src
parentb0146f3a91a4d993eed662b1b4c02de9d34f6bd2 (diff)
parentf4fa4e8ec53b0943635edf3f147680c9b9214db8 (diff)
downloadvaadin-framework-3597d27d9a6441632656ff597d14953f377c2990.tar.gz
vaadin-framework-3597d27d9a6441632656ff597d14953f377c2990.zip
Merge changes from origin/7.1
f4fa4e8 Normalize line endings Change-Id: I48ccf40262eb600b4cbc45e49abb5d5a6258b2db
Diffstat (limited to 'theme-compiler/src')
-rw-r--r--theme-compiler/src/com/vaadin/sass/internal/parser/Parser.jj106
1 files changed, 76 insertions, 30 deletions
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 f4752a502a..17373532a7 100644
--- a/theme-compiler/src/com/vaadin/sass/internal/parser/Parser.jj
+++ b/theme-compiler/src/com/vaadin/sass/internal/parser/Parser.jj
@@ -1671,13 +1671,20 @@ ArrayList<VariableNode> arglist() :
}
JAVACODE
-boolean checkMixinForNonOptionalArguments(VariableNode arg, boolean hasNonOptionalArguments) {
+boolean checkMixinForNonOptionalArguments(VariableNode arg, boolean hasNonOptionalArguments)
+{
boolean currentArgHasArguments = arg.getExpr() != null && arg.getExpr().getLexicalUnitType() == LexicalUnitImpl.SCSS_VARIABLE && arg.getExpr().getNextLexicalUnit() != null;
- if(currentArgHasArguments) {
- if(hasNonOptionalArguments) { throw new ParseException("Sass Error: Required argument $"+ arg.getName() +" must come before any optional arguments.");
+
+ if(currentArgHasArguments)
+ {
+ if(hasNonOptionalArguments)
+ {
+ throw new ParseException("Sass Error: Required argument $"+ arg.getName() +" must come before any optional arguments.");
}
return hasNonOptionalArguments;
- }else { return true;
+ }else
+ {
+ return true;
}
}
@@ -1692,9 +1699,13 @@ VariableNode mixinArg() :
{
name=variableName() (< COLON > (< S >)*
- ( first = nonVariableTerm(null) {
- prev = first; }
- (LOOKAHEAD(3)(< COMMA >(< S >)*)? prev = nonVariableTerm(prev))* )
+ (
+ first = nonVariableTerm(null)
+ {
+ prev = first;
+ }
+ (LOOKAHEAD(3)(< COMMA >(< S >)*)? prev = nonVariableTerm(prev))*
+ )
| (variable = < VARIABLE >{ first = LexicalUnitImpl.createVariable(token.beginLine, token.beginColumn,
prev, variable.image);}
@@ -1881,39 +1892,66 @@ String listModifyDirectiveArgs(int nest)
{
t = getToken(1);
String s = t.image;
- if(t.kind == VARIABLE||t.kind == IDENT) {
+ if(t.kind == VARIABLE||t.kind == IDENT)
+ {
list += s;
- }else if(s.toLowerCase().equals("auto")||s.toLowerCase().equals("space")||s.toLowerCase().equals("comma")) {
+ }else if(s.toLowerCase().equals("auto")||s.toLowerCase().equals("space")||s.toLowerCase().equals("comma"))
+ {
int i = 2;
Token temp = getToken(i);
boolean isLast = true;
while(temp.kind != SEMICOLON)
- { if(temp.kind != RPARAN || temp.kind != S)
- { isLast = false; }
+ {
+ if(temp.kind != RPARAN || temp.kind != S)
+ {
+ isLast = false;
+ }
i++;
temp = getToken(i);
}
- if(isLast) { return list;
+ if(isLast)
+ {
+ return list;
}
- } else if(t.kind == STRING) { list += s.substring(1,s.length()).substring(0,s.length()-2);
+ }
+ else if(t.kind == STRING)
+ {
+ list += s.substring(1,s.length()).substring(0,s.length()-2);
- }else if(t.kind == LPARAN) { nesting++;
- if(nesting > nest+1) { throw new CSSParseException("Only one ( ) pair per parameter allowed", getLocator());
+ }else if(t.kind == LPARAN)
+ {
+ nesting++;
+ if(nesting > nest+1)
+ {
+ throw new CSSParseException("Only one ( ) pair per parameter allowed", getLocator());
}
- }else if(t.kind == RPARAN) { nesting--;
- if(nesting == 0) {
+ }else if(t.kind == RPARAN)
+ {
+ nesting--;
+ if(nesting == 0)
+ {
return list;
}
- } else if(t.kind == COMMA) {
- if(nesting == nest) {
- return list; }else {
- list += ","; }
+ } else if(t.kind == COMMA)
+ {
+ if(nesting == nest)
+ {
+ return list;
+ }else
+ {
+ list += ",";
+ }
- }else if(t.kind == S) {
- list += " "; } else if(t.kind == LBRACE) {
- throw new CSSParseException("Invalid token,'{' found", getLocator()); }
- getNextToken();
+ }else if(t.kind == S)
+ {
+ list += " ";
+ } else if(t.kind == LBRACE)
+ {
+ throw new CSSParseException("Invalid token,'{' found", getLocator());
+ }
+
+ getNextToken();
}
}
@@ -2305,14 +2343,20 @@ LexicalUnitImpl term(LexicalUnitImpl prev) :
}
}
-LexicalUnitImpl variableTerm(LexicalUnitImpl prev) : {
+LexicalUnitImpl variableTerm(LexicalUnitImpl prev) :
+{
LexicalUnitImpl result = null;
- String varName = ""; } {
+ String varName = "";
+}
+{
varName = variableName()
{result = LexicalUnitImpl.createVariable(token.beginLine, token.beginColumn,
- prev, varName); return result;} }
+ prev, varName); return result;}
+}
-LexicalUnitImpl nonVariableTerm(LexicalUnitImpl prev) : { LexicalUnitImpl result = null;
+LexicalUnitImpl nonVariableTerm(LexicalUnitImpl prev) :
+{
+LexicalUnitImpl result = null;
Token n = null;
char op = ' ';
String varName;
@@ -2435,7 +2479,9 @@ LexicalUnitImpl nonVariableTerm(LexicalUnitImpl prev) : { LexicalUnitImpl result
| result=unicode(prev)
) ) ( <S> )*
{
- return result; } }
+ return result;
+ }
+}
/**
* Handle all CSS2 functions.