Skip to content

Commit

Permalink
Working detached rulesets draft with enabled unit tests. Most cases w…
Browse files Browse the repository at this point in the history
…ork,

but the whole thing needs some more testing and clean up. #186
  • Loading branch information
jurcovicovam committed Jun 24, 2014
1 parent 9c75589 commit ddfb7d6
Show file tree
Hide file tree
Showing 40 changed files with 475 additions and 368 deletions.
4 changes: 2 additions & 2 deletions src/main/antlr3/com/github/sommeri/less4j/core/parser/Less.g
Original file line number Diff line number Diff line change
Expand Up @@ -806,8 +806,8 @@ finally { leaveRule(); }

detachedRulesetReference
@init {enterRule(retval, RULE_DETACHED_RULESET_REFERENCE);}
: a=AT_NAME (LPAREN RPAREN)? SEMI
-> ^(DETACHED_RULESET_REFERENCE $a)
: a+=AT_NAME (a+=LPAREN? a+=RPAREN?) SEMI
-> ^(DETACHED_RULESET_REFERENCE $a*)
;
finally { leaveRule(); }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,8 @@ public MixinReference clone() {
result.configureParentToAllChilds();
return result;
}


@NotAstProperty
public List<Expression> getAllPositionalArgumentsFrom(int startIndx) {
if (hasPositionalParameter(startIndx))
return positionalParameters.subList(startIndx, positionalParameters.size());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import com.github.sommeri.less4j.core.ast.FixedMediaExpression;
import com.github.sommeri.less4j.core.ast.MediaExpressionFeature;
import com.github.sommeri.less4j.core.ast.StyleSheet;
import com.github.sommeri.less4j.core.compiler.expressions.ExpressionEvaluator;
import com.github.sommeri.less4j.core.compiler.expressions.IScopeAwareExpressionsEvaluator;
import com.github.sommeri.less4j.core.compiler.scopes.IScope;
import com.github.sommeri.less4j.core.compiler.selectors.ExtendsSolver;
import com.github.sommeri.less4j.core.compiler.selectors.UselessLessElementsRemover;
Expand Down Expand Up @@ -152,7 +152,7 @@ private int code(ASTCssNode node) {
private void evaluateExpressions(ASTCssNode node) {
ASTManipulator manipulator = new ASTManipulator();
//variables are not supposed to be there now
ExpressionEvaluator expressionEvaluator = new ExpressionEvaluator(problemsHandler, configuration);
IScopeAwareExpressionsEvaluator expressionEvaluator = new IScopeAwareExpressionsEvaluator(problemsHandler, configuration);

if (node instanceof Expression) {
Expression value = expressionEvaluator.evaluate((Expression) node);
Expand Down
Loading

0 comments on commit ddfb7d6

Please sign in to comment.