Ejemplo n.º 1
0
  @Override
  public boolean shouldBreak(Statement statement, Statement previousStatement) {
    if (statement.getPosition() == null) {
      return false;
    }

    if (!this.regexp.matcher(statement.getPosition().getFileName()).matches()) {
      return false;
    }

    boolean result = false;

    if (this.line >= 0) {
      if (this.line <= statement.getPosition().getLine()) {
        if (previousStatement == null) {
          result = true;
        } else {
          result = (this.line > (previousStatement.getPosition().getLine() - 1));
        }
      } else {
        result = false;
      }
    }

    return result;
  }
Ejemplo n.º 2
0
 public static void injectLineNumber(CodeBlock block, Statement statement) {
   Position position = statement.getPosition();
   if (position != null) {
     LabelNode lineLabel = new LabelNode();
     block.line(position.getLine(), lineLabel);
     block.label(lineLabel);
   }
 }