Package com.github.sommeri.less4j.core.ast

Examples of com.github.sommeri.less4j.core.ast.DetachedRuleset


    }
    return result;
  }

  public DetachedRuleset handleDetachedRuleset(HiddenTokenAwareTree token) {
    return new DetachedRuleset(token, handleGeneralBody(token.getChild(0)));
  }
View Full Code Here


          Expression evaluatedDetachedRuleset = expressionEvaluator.evaluate(fullNodeDefinition);
          fullNodeDefinition = evaluatedDetachedRuleset;
          if (evaluatedDetachedRuleset.getType() != ASTCssNodeType.DETACHED_RULESET) {
            handleWrongDetachedRulesetReference(detachedRulesetReference, evaluatedDetachedRuleset, solvedMixinReferences);
          } else {
            DetachedRuleset detachedRuleset = (DetachedRuleset) evaluatedDetachedRuleset;
            IScope scope = detachedRuleset.getScope();
            GeneralBody replacement = mixinsSolver.buildDetachedRulesetReplacement(detachedRulesetReference, referenceScope, detachedRuleset, scope);
            AstLogic.validateLessBodyCompatibility(kid, replacement.getMembers(), problemsHandler);
            solvedMixinReferences.put(kid, replacement);
          }
        }
View Full Code Here

        bodyScope.removedFromAst();
        if (bodyScope.hasParent())
          bodyScope.getParent().removedFromAst(); // remove also arguments scope from tree
        manipulator.removeFromBody(kid);
      } else if (kid.getType() == ASTCssNodeType.DETACHED_RULESET) {
        DetachedRuleset detached = (DetachedRuleset) kid;
        IScope bodyScope = currentScope.childByOwners(detached, detached.getBody());
        if (bodyScope.hasParent())
          bodyScope.getParent().removedFromAst(); // remove also arguments scope from tree
        bodyScope.removedFromAst();
        detached.setScope(bodyScope);
      } else if (kid.getType() == ASTCssNodeType.RULE_SET) {
        RuleSet ruleSet = (RuleSet) kid;
        if (ruleSet.isUsableAsReusableStructure()) {
          IScope bodyScope = currentScope.childByOwners(ruleSet, ruleSet.getBody());
          currentScope.registerMixin(ruleSet.convertToReusableStructure(), bodyScope);
View Full Code Here

    return true;
  }

  public Expression evaluate(DetachedRuleset input) {
    DetachedRuleset clone = input.clone();

    IScope owningScope = clone.getScope();
    if (owningScope == null)
      throw new BugHappened("Detached ruleset with unknown scope.", input);

    clone.setScope(composedScope(owningScope));
    return clone;
  }
View Full Code Here

TOP

Related Classes of com.github.sommeri.less4j.core.ast.DetachedRuleset

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.