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

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


      return handleImport(token);

    if (type == LessLexer.UNKNOWN_AT_RULE)
      return handleUnknownAtRule(token);

    throw new BugHappened("Unexpected token type: " + type +"("+PrintUtils.toName(type)+ ") for " + token.getText(), token);
  }
View Full Code Here


    case LessLexer.EMBEDDED_SCRIPT:
      return buildFromEmbeddedScript(token, offsetChild);

    default:
      throw new BugHappened("type number: " + PrintUtils.toName(offsetChild.getType()) + "(" + offsetChild.getType() + ") for " + offsetChild.getText(), offsetChild);

    }
  }
View Full Code Here

      return Dimension.TIME;
    case LessLexer.FREQ:
      return Dimension.FREQ;

    default:
      throw new BugHappened("Unknown dimension type: " + actual.getType() + " " + actual.getText(), actual);

    }
  }
View Full Code Here

  }

  public Expression handleExpression(HiddenTokenAwareTree token) {
    LinkedList<HiddenTokenAwareTree> children = new LinkedList<HiddenTokenAwareTree>(token.getChildren());
    if (children.size() == 0)
      throw new BugHappened(GRAMMAR_MISMATCH, token);

    if (children.size() == 1) {
      Expression head = (Expression) switchOn(children.get(0));
      // we have to switch to parent token, because we would loose it otherwise.
      // for example, comments before simple expressions would not be accessible
View Full Code Here

    default:
      break;
    }

    throw new BugHappened(GRAMMAR_MISMATCH, token);
  }
View Full Code Here

    HiddenTokenAwareTree importantToken = iterator.next();
    if (importantToken.getType() == LessLexer.IMPORTANT_SYM)
      return new Declaration(token, name, expression, true, mergeOperator);

    throw new BugHappened(GRAMMAR_MISMATCH, token);
  }
View Full Code Here

  }

  public CharsetDeclaration handleCharsetDeclaration(HiddenTokenAwareTree token) {
    List<HiddenTokenAwareTree> children = token.getChildren();
    if (children.isEmpty())
      throw new BugHappened(GRAMMAR_MISMATCH, token);

    HiddenTokenAwareTree charset = children.get(1);
    return new CharsetDeclaration(token, termBuilder.createCssString(charset, charset.getText()));
  }
View Full Code Here

      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);
View Full Code Here

    default:
      break;
    }

    throw new BugHappened(GRAMMAR_MISMATCH, token);
  }
View Full Code Here

  }

  public void validateGuardNegation(HiddenTokenAwareTree token) {
    String operator = token.getText().trim();
    if (!"not".equals(operator))
      throw new BugHappened(GRAMMAR_MISMATCH, token);
  }
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.