parser_push_block_context (parser_context_t *context_p, /**< context */
                           bool is_private) /**< is private (bound to a statement) context */
{
  JERRY_ASSERT (context_p->next_scanner_info_p->type == SCANNER_TYPE_BLOCK);

  parser_block_statement_t block_statement;
  block_statement.scope_stack_top = context_p->scope_stack_top;
  block_statement.scope_stack_reg_top = context_p->scope_stack_reg_top;

  bool is_context_needed = false;

  if (scanner_is_context_needed (context_p, PARSER_CHECK_BLOCK_CONTEXT))
  {
    parser_block_context_t block_context;

#ifndef JERRY_NDEBUG
    PARSER_PLUS_EQUAL_U16 (context_p->context_stack_depth, PARSER_BLOCK_CONTEXT_STACK_ALLOCATION);
#endif /* !JERRY_NDEBUG */

    parser_emit_cbc_forward_branch (context_p,
                                    CBC_BLOCK_CREATE_CONTEXT,
                                    &block_context.branch);
    parser_stack_push (context_p, &block_context, sizeof (parser_block_context_t));
    is_context_needed = true;
  }

  scanner_create_variables (context_p, SCANNER_CREATE_VARS_NO_OPTS);
  parser_stack_push (context_p, &block_statement, sizeof (parser_block_statement_t));

  uint8_t statement_type;

  if (is_private)
  {
    statement_type = (is_context_needed ? PARSER_STATEMENT_PRIVATE_CONTEXT : PARSER_STATEMENT_PRIVATE_SCOPE);
  }
  else
  {
    statement_type = (is_context_needed ? PARSER_STATEMENT_BLOCK_CONTEXT : PARSER_STATEMENT_BLOCK_SCOPE);
  }

  parser_stack_push_uint8 (context_p, statement_type);

  return is_context_needed;
} /* parser_push_block_context */
parser_push_block_context (parser_context_t *context_p,  
                           bool is_private)  
{
  JERRY_ASSERT (context_p->next_scanner_info_p->type == SCANNER_TYPE_BLOCK);

  parser_block_statement_t block_statement;
  block_statement.scope_stack_top = context_p->scope_stack_top;
  block_statement.scope_stack_reg_top = context_p->scope_stack_reg_top;

  bool is_context_needed = false;

  if (scanner_is_context_needed (context_p, PARSER_CHECK_BLOCK_CONTEXT))
  {
    parser_block_context_t block_context;

#ifndef JERRY_NDEBUG
    PARSER_PLUS_EQUAL_U16 (context_p->context_stack_depth, PARSER_BLOCK_CONTEXT_STACK_ALLOCATION);
#endif  

    parser_emit_cbc_forward_branch (context_p,
                                    CBC_BLOCK_CREATE_CONTEXT,
                                    &block_context.branch);
    parser_stack_push (context_p, &block_context, sizeof (parser_block_context_t));
    is_context_needed = true;
  }

  scanner_create_variables (context_p, SCANNER_CREATE_VARS_NO_OPTS);
  parser_stack_push (context_p, &block_statement, sizeof (parser_block_statement_t));

  uint8_t statement_type;

  if (is_private)
  {
    statement_type = (is_context_needed ? PARSER_STATEMENT_PRIVATE_CONTEXT : PARSER_STATEMENT_PRIVATE_SCOPE);
  }
  else
  {
    statement_type = (is_context_needed ? PARSER_STATEMENT_BLOCK_CONTEXT : PARSER_STATEMENT_BLOCK_SCOPE);
  }

  parser_stack_push_uint8 (context_p, statement_type);

  return is_context_needed;
}  