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

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


  public void extendName(String secondName) {
    extendName(secondName, getUnderlyingStructure());
  }

  public void extendName(String extension, HiddenTokenAwareTree underlyingStructureOfExtension) {
    throw new BugHappened("Attempt to extend a name of unexpected selector part.", this);
  }
View Full Code Here


      return subtract(first, second, originalExpression);
    case PLUS:
      return add(first, second, originalExpression);

    default:
      throw new BugHappened("Unknown operator.", operator);
    }

  }
View Full Code Here

   * Behavior of this method is undefined if it is not mixin.
   * @return
   */
  public ReusableStructure convertToReusableStructure() {
    if (!isUsableAsReusableStructure())
      throw new BugHappened("Caller is supposed to check for this.", this);
   
    List<ReusableStructureName> reusableNames = new ArrayList<ReusableStructureName>();
    for (Selector selector : selectors) if (selector.isReusableSelector()) {
      ReusableStructureName reusableStructureName = selector.toReusableStructureName();
      reusableNames.add(reusableStructureName);
View Full Code Here

        result.add(reusableStructureName.asString());
      }
    }

    if (result.isEmpty()) {
        throw new BugHappened("Not convertible to resusable structure - caller was supposed to check for this.", this);
    }
   
    return result;
  }
View Full Code Here

    case UNICODE_RANGE_EXPRESSION:
    case EMPTY_EXPRESSION:
      return input.clone();

    default:
      throw new BugHappened("Unknown expression type " + input.getType(), input);
    }
  }
View Full Code Here

    case LOWER:
      return left.compareTo(right) < 0;

    default:
      throw new BugHappened("Unexpected comparison operator", operator);
    }
  }
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 subtract(first, red1, green1, blue1, alpha1, red2, green2, blue2, alpha2, originalExpression.getUnderlyingStructure());
    case PLUS:
      return add(red1, green1, blue1, alpha1, red2, green2, blue2, alpha2, originalExpression.getUnderlyingStructure());

    default:
      throw new BugHappened("Unknown operator.", operator);
    }

  }
View Full Code Here

  private String toSourceContent(HiddenTokenAwareTree underlyingStructure, String sourceName, LessSource source) {
    if (configuration.isIncludeSourcesContent() || sourceName==null) {
      try {
        return source.getContent();
      } catch (FileNotFound e) {
        throw new BugHappened("How did we compiled something we did not read?", underlyingStructure);
      } catch (CannotReadFile e) {
        throw new BugHappened("How did we compiled something we did not read?", underlyingStructure);
      }
    } else {
      return null;
    }
  }
View Full Code Here

      previousMatch = currentMatch;
      List<SelectorPart> replaceBy = ArraysUtils.deeplyClonedList(originalReplaceBy);

      if (firstMatch == lastMatch) {
        if (lookForParts.size() != 1)
          throw new BugHappened("Impossible state happened.", lookForParts.isEmpty() ? null : lookForParts.get(0));

        List<SelectorPart> replaceInside = replaceInsidePart(lookForParts.get(0), lastMatch, replaceBy);
        ArraysUtils.replace(lastMatch, inSelectorParts, replaceInside);
      } else {
        if (prefixNeeded)
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.