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

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


    }
    return result;
  }

  public MixinReference handleMixinReference(HiddenTokenAwareTree token) {
    MixinReference result = new MixinReference(token);
    List<HiddenTokenAwareTree> children = token.getChildren();
    for (HiddenTokenAwareTree kid : children) {
      if (kid.getType() == LessLexer.REUSABLE_STRUCTURE_NAME) {
        result.setFinalName(handleReusableStructureName(kid));
      } else if (kid.getType() == LessLexer.IMPORTANT_SYM) {
        result.setImportant(true);
      } else if (kid.getType() == LessLexer.SEMI_SPLIT_MIXIN_REFERENCE_ARGUMENTS) {
        mixinsParametersBuilder.handleMixinReferenceArguments(kid, result);
      }
    }
View Full Code Here


    return result;
  }

  public MixinReference handleNamespaceReference(HiddenTokenAwareTree token) {
    MixinReference reference = null;
    List<ReusableStructureName> nameChain = new ArrayList<ReusableStructureName>();

    List<HiddenTokenAwareTree> children = token.getChildren();
    for (HiddenTokenAwareTree kid : children) {
      ASTCssNode buildKid = switchOn(kid);
      if (buildKid.getType() == ASTCssNodeType.MIXIN_REFERENCE) {
        reference = (MixinReference) switchOn(kid);
      } else if (buildKid.getType() == ASTCssNodeType.REUSABLE_STRUCTURE_NAME) {
        nameChain.add(handleReusableStructureName(kid));
      } else {
        throw new BugHappened(GRAMMAR_MISMATCH, token);
      }
    }

    reference.setUnderlyingStructure(token);
    reference.addNames(nameChain);
    return reference;
 
View Full Code Here

  private Map<ASTCssNode, GeneralBody> solveCalls(List<ASTCssNode> childs, IScope referenceScope) {
    Map<ASTCssNode, GeneralBody> solvedMixinReferences = new HashMap<ASTCssNode, GeneralBody>();
    for (ASTCssNode kid : childs) {
      if (isMixinReference(kid)) {
        MixinReference reference = (MixinReference) kid;

        List<FullMixinDefinition> foundMixins = findReferencedMixins(reference, referenceScope);
        GeneralBody replacement = mixinsSolver.buildMixinReferenceReplacement(reference, referenceScope, foundMixins);

        AstLogic.validateLessBodyCompatibility(reference, replacement.getMembers(), problemsHandler);
View Full Code Here

  public String toMixinReferencesString(List<MixinReference> cycle) {
    String result = "";
    Iterator<MixinReference> iReference = cycle.iterator();
    while (iReference.hasNext()) {
      MixinReference reference = iReference.next();
      result += reference.getFinalName() + " ("+ reference.getSourceLine()+":"+reference.getSourceColumn()+") ";
      if (iReference.hasNext())
        result +="-> ";
    }
   
    return result;
View Full Code Here

TOP

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

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.