Package com.github.sommeri.less4j.core.compiler.scopes

Examples of com.github.sommeri.less4j.core.compiler.scopes.IScope


    return values;
  }

  public IScope evaluateValues(IScope scope) {
    IScope result = ScopeFactory.createDummyScope();
    result.addFilteredVariables(toEvaluationFilter(), scope);
    return result;
  }
View Full Code Here


  }

  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

    return result;

  }

  protected ScopeView createPublicParent() {
    IScope realParent = originalStructure.getParent();
    if (realParent != null)
      return ScopeFactory.createParentScopeView(realParent, scope, joinToParentTree);

    if (joinToParentTree == null)
      return null;
View Full Code Here

    nestingBubbling.unnestRulesetAndMedia(less);
  }

  private Set<LessSource> resolveImportsAndReferences(StyleSheet less, LessSource source) {
    ImportsAndScopeSolver solver = new ImportsAndScopeSolver(problemsHandler, configuration);
    IScope scope = solver.buildImportsAndScope(less, source);
    Set<LessSource> importedSources = solver.getImportedSources();

    ReferencesSolver referencesSolver = new ReferencesSolver(problemsHandler, configuration);
    referencesSolver.solveReferences(less, scope);
    // Warning at this point: ast changed, but the scope did not changed its structure. The scope stopped to be useful.
View Full Code Here

  }

  private void check(IScope scope) {
    for (FullMixinDefinition mixinDefinition : scope.getAllMixins()) {
      IScope mixinScope = mixinDefinition.getScope();
      if (mixinScope == null)
        throw new IllegalStateException("double WTF: mixin definition without scope");
     
      if (mixinScope.getParent()!=scope && grandParent(mixinScope)!=scope)
        throw new IllegalStateException("WTF");
    }
  }
View Full Code Here

  public IScope buildImportsAndScope(StyleSheet less, LessSource source) {
    importsSolver = new SingleImportSolver(problemsHandler, configuration);

    InitialScopeExtractor scopeBuilder = new InitialScopeExtractor();
    IScope scope = scopeBuilder.extractScope(less);
    List<PlaceholderScope> importsPlaceholders = scopeBuilder.getImportsPlaceholders();

    solveNestedImports(importsPlaceholders);

    return scope;
View Full Code Here

    referencesSolver.solveReferences(encounteredImport, placeholder.getParent());

    ASTCssNode importedAst = importsSolver.importEncountered(encounteredImport, placeholder.getOwner().getSource());
    if (importedAst != null) {
      InitialScopeExtractor importedAstScopeBuilder = new InitialScopeExtractor();
      IScope addThisIntoScopeTree = importedAstScopeBuilder.extractScope(importedAst);
     
      placeholder.replaceSelf(addThisIntoScopeTree);
      return importedAstScopeBuilder.getImportsPlaceholders();
    } else {
      placeholder.removeSelf();
View Full Code Here

    if (isLocallyDefined) {
      return bodyScope;
    }

    //join scopes
    IScope result = ScopeFactory.createJoinedScopesView(callerScope, bodyScope);
    return result;
  }
View Full Code Here

TOP

Related Classes of com.github.sommeri.less4j.core.compiler.scopes.IScope

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.