parser_check_invalid_logical_op (parser_context_t *context_p, /**< context */
                                 uint8_t invalid_token1, /**< token id of first invalid token */
                                 uint8_t invalid_token2) /**< token id of second invalid token */
{
  parser_stack_iterator_t iterator;
  parser_stack_iterator_init (context_p, &iterator);

  while (true)
  {
    uint8_t token = parser_stack_iterator_read_uint8 (&iterator);

    if (!LEXER_IS_BINARY_NON_LVALUE_OP_TOKEN (token))
    {
      return;
    }

    if (token == invalid_token1 || token == invalid_token2)
    {
      parser_raise_error (context_p, PARSER_ERR_INVALID_NULLISH_COALESCING);
    }

    /* If a logical operator is found, and there is no SyntaxError, the scan can be terminated
     * since there was no SyntaxError when the logical operator was pushed onto the stack. */
    if (token == LEXER_LOGICAL_OR || token == LEXER_LOGICAL_AND || token == LEXER_NULLISH_COALESCING)
    {
      return;
    }

    parser_stack_iterator_skip (&iterator, sizeof (uint8_t));
  }
} /* parser_check_invalid_logical_op */
parser_check_invalid_logical_op (parser_context_t *context_p,  
                                 uint8_t invalid_token1,  
                                 uint8_t invalid_token2)  
{
  parser_stack_iterator_t iterator;
  parser_stack_iterator_init (context_p, &iterator);

  while (true)
  {
    uint8_t token = parser_stack_iterator_read_uint8 (&iterator);

    if (!LEXER_IS_BINARY_NON_LVALUE_OP_TOKEN (token))
    {
      return;
    }

    if (token == invalid_token1 || token == invalid_token2)
    {
      parser_raise_error (context_p, PARSER_ERR_INVALID_NULLISH_COALESCING);
    }

     
    if (token == LEXER_LOGICAL_OR || token == LEXER_LOGICAL_AND || token == LEXER_NULLISH_COALESCING)
    {
      return;
    }

    parser_stack_iterator_skip (&iterator, sizeof (uint8_t));
  }
}  