private static boolean consumeTokens(PsiBuilder builder, boolean smart, int pin, IElementType... tokens) {
    ErrorState state = ErrorState.get(builder);
    if (state.completionState != null && state.predicateSign) {
      addCompletionVariant(builder, state.completionState, tokens);
    }
    // suppress single token completion
    CompletionState completionState = state.completionState;
    state.completionState = null;
    boolean result = true;
    boolean pinned = false;
    for (int i = 0, tokensLength = tokens.length; i < tokensLength; i++) {
      if (pin > 0 && i == pin) pinned = result;
      if (result || pinned) {
        boolean fast = smart && i == 0;
        if (!(fast ? consumeTokenFast(builder, tokens[i]) : consumeToken(builder, tokens[i]))) {
          result = false;
          if (pin < 0 || pinned) report_error_(builder, state, false);
        }
      }
    }
    state.completionState = completionState;
    return pinned || result;
  }
private static boolean consumeTokens(PsiBuilder builder, boolean smart, int pin, IElementType... tokens)