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

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


        }
        result.setPseudopage(new Name(kid, ":" + kid.getChild(pseudoPageIndex).getText()));
      } else if (kid.getType() == LessLexer.BODY) {
        result.setBody(createGeneralBody(kid));
      } else {
        throw new BugHappened(GRAMMAR_MISMATCH, kid);
      }
    }
    return result;
  }
View Full Code Here


      if (kid.getType() == LessLexer.AT_NAME) {
        result.setName(new Name(kid, kid.getText()));
      } else if (kid.getType() == LessLexer.BODY) {
        result.setBody(createGeneralBody(kid));
      } else {
        throw new BugHappened(GRAMMAR_MISMATCH, kid);
      }
    }
    return result;
  }
View Full Code Here

    case LessLexer.IMPORT_MULTIPLE_SYM:
      result.setMultiplicity(Import.ImportMultiplicity.IMPORT_MULTIPLE);
      problemsHandler.deprecatedImportMultiple(result);
      break;
    default:
      throw new BugHappened(GRAMMAR_MISMATCH, token);
    }
    Iterator<HiddenTokenAwareTree> children = token.getChildren().iterator();
    HiddenTokenAwareTree nextChild = children.next();
    if (nextChild.getType() == LessLexer.IMPORT_OPTIONS) {
      configureImportOptions(result, nextChild.getChildren());
      nextChild = children.next();
    }

    result.setUrlExpression(handleTerm(nextChild));
    while (children.hasNext()) {
      HiddenTokenAwareTree kid = children.next();
      if (kid.getType() == LessLexer.COMMA) {
        kid.pushHiddenToSiblings();
      } else if (kid.getType() == LessLexer.MEDIA_QUERY) {
        result.add(handleMediaQuery(kid));
      } else {
        throw new BugHappened(GRAMMAR_MISMATCH, token);
      }
    }

    return result;
  }
View Full Code Here

  public Extend handleExtendInDeclaration(HiddenTokenAwareTree token) {
    HiddenTokenAwareTree child = token.getChild(0);
    Pseudo extendAsPseudo = handlePseudo(child);

    if (!(extendAsPseudo instanceof PseudoClass))
      throw new BugHappened(GRAMMAR_MISMATCH, extendAsPseudo);

    PseudoClass asPseudoclass = (PseudoClass) extendAsPseudo;
    if (!(asPseudoclass.getParameter() instanceof Extend))
      throw new BugHappened(GRAMMAR_MISMATCH, extendAsPseudo);

    return (Extend) asPseudoclass.getParameter();
  }
View Full Code Here

      case LessLexer.SEMI:
        result.setSemicolon(toSyntaxOnlyElement(next));
        break;

      default:
        throw new BugHappened(GRAMMAR_MISMATCH, next);
      }
     
    }
    problemsHandler.warnUnknowAtRule(result);
    return result;
View Full Code Here

  }
 
  private Extend convertToExtend(PseudoClass extend) {
    ASTCssNode parameter = extend.getParameter();
    if (parameter.getType()!=ASTCssNodeType.EXTEND) {
      throw new BugHappened(ASTBuilderSwitch.GRAMMAR_MISMATCH, parameter.getUnderlyingStructure());
    }
   
    return (Extend) parameter;
  }
View Full Code Here

  }

  private PlaceholderScope createPlaceholderScope(ASTCssNode owner) {
    if (currentScope == null) {
      throw new BugHappened("No parent scope available.", owner);
    }

    return ScopeFactory.createPlaceholderScope(owner, currentScope);
  }
View Full Code Here

  }

  @Override
  public void setParent(ASTCssNode parent) {
    if (parent!=null && !(parent instanceof Selector))
      throw new BugHappened("Nested selector appender must belong to selector.", this);
    super.setParent(parent);
  }
View Full Code Here

    return !getSubsequent().isEmpty();
  }


  public void addSubsequent(List<ElementSubsequent> subsequent) {
    throw new BugHappened("Attempt to add subsequent element to unexpected selector part.", this);
  }
View Full Code Here

  public void addSubsequent(List<ElementSubsequent> subsequent) {
    throw new BugHappened("Attempt to add subsequent element to unexpected selector part.", this);
  }

  public void removeSubsequent(ElementSubsequent subsequent) {
    throw new BugHappened("Attempt to remove subsequent element from unexpected selector part.", this);
  }
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.