Package com.github.sommeri.less4j.core.problems

Examples of com.github.sommeri.less4j.core.problems.BugHappened


    case STANDARD:
      return equals(nth1.getRepeater(), nth2.getRepeater()) && equals(nth1.getMod(), nth2.getMod());
     
    }

    throw new BugHappened("Should not happen. " + nth1 + " vs " + nth2, nth1);
  }
View Full Code Here


        return attributesEqual(attribute1, attribute2);
      }

      default:
        throw new BugHappened("Unexpected subsequent type: " + first.getType(), first);
      }
  }
View Full Code Here

    case NTH:
      return nthComparator.equals((Nth) node1, (Nth) node2);
     
    default:
      throw new BugHappened("Need to compare unexpected node types. " + node1 + " with " + node2, node1);
    }
  }
View Full Code Here

    }

    // appender somewhere in the middle
    NestedSelectorAppender appender = selector.findFirstAppender();
    if (appender == null)
      throw new BugHappened("This is very weird error and should not happen.", selector);

    Selector afterAppender = splitOn(selector, appender);
    List<Selector> partialResults = joinAll(selector, previousSelectors, appender.getLeadingCombinator(), appender.isDirectlyAfter());
    return joinAll(partialResults, afterAppender, null, appender.isDirectlyBefore());
  }
View Full Code Here

    return simpleSelectorComparator.prefix((SimpleSelector) lookFor, (SimpleSelector) inside);
  }

  private void validateSimpleSelector(SelectorPart selector) {
    if (selector.getType() != ASTCssNodeType.SIMPLE_SELECTOR) {
      throw new BugHappened("Unexpected selector part type " + selector.getType() + ". Anything but simple selector should have been removed from tree. ", selector);
    }
  }
View Full Code Here

    IScope child = null;
    do {
      if (childsIterator.hasNext())
        child = childsIterator.next();
      else
        throw new BugHappened("Child scope was expected but missing", getScope().getOwner());
    } while (!child.isPresentInAst());
   
    return new IteratedScope(child);
  }
View Full Code Here

        if (!line.startsWith("#"))
          loadLine(line);
      }
      reader.close();
    } catch (IOException e) {
      throw new BugHappened(e, null);
    }

  }
View Full Code Here

  }
 
  public static void validateLessBodyCompatibility(ASTCssNode reference, List<ASTCssNode> members, ProblemsHandler problemsHandler) {
    ASTCssNode parent = reference.getParent();
    if (!isBody(parent)) {
      throw new BugHappened("Parent is not a body instance. " + parent, parent);
    }
   
    SupportedLessBodyMembers allowedBodyMembers = new SupportedLessBodyMembers();
    Set<ASTCssNodeType> supportedMembers = allowedBodyMembers.getSupportedMembers((Body) parent);
   
View Full Code Here

  }

  public void removeFromBody(ASTCssNode node) {
    ASTCssNode parent = node.getParent();
    if (!(parent instanceof Body)) {
      throw new BugHappened("Parent is not a body instance. " + parent, parent);
    }

    Body pBody = (Body) parent;
    pBody.removeMember(node);
    node.setParent(null);
View Full Code Here

  }

  public void replaceInBody(ASTCssNode oldNode, ASTCssNode newNode) {
    ASTCssNode parent = oldNode.getParent();
    if (!(parent instanceof Body)) {
      throw new BugHappened("Parent is not a body instance. " + parent, parent);
    }

    Body pBody = (Body) parent;
    pBody.replaceMember(oldNode, newNode);
  }
View Full Code Here

TOP

Related Classes of com.github.sommeri.less4j.core.problems.BugHappened

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.