scanner_pop_binding_list (scanner_context_t *scanner_context_p) /**< scanner context */
{
  scanner_binding_list_t *binding_list_p = scanner_context_p->active_binding_list_p;
  JERRY_ASSERT (binding_list_p != NULL);

  scanner_binding_item_t *item_p = binding_list_p->items_p;
  scanner_binding_list_t *prev_binding_list_p = binding_list_p->prev_p;
  bool is_nested = binding_list_p->is_nested;

  scanner_free (binding_list_p, sizeof (scanner_binding_list_t));
  scanner_context_p->active_binding_list_p = prev_binding_list_p;

  if (!is_nested)
  {
    while (item_p != NULL)
    {
      scanner_binding_item_t *next_p = item_p->next_p;

      JERRY_ASSERT (item_p->literal_p->type & (SCANNER_LITERAL_IS_LOCAL | SCANNER_LITERAL_IS_ARG));

      scanner_free (item_p, sizeof (scanner_binding_item_t));
      item_p = next_p;
    }
    return;
  }

  JERRY_ASSERT (prev_binding_list_p != NULL);

  while (item_p != NULL)
  {
    scanner_binding_item_t *next_p = item_p->next_p;

    item_p->next_p = prev_binding_list_p->items_p;
    prev_binding_list_p->items_p = item_p;

    item_p = next_p;
  }
} /* scanner_pop_binding_list */
scanner_pop_binding_list (scanner_context_t *scanner_context_p)  
{
  scanner_binding_list_t *binding_list_p = scanner_context_p->active_binding_list_p;
  JERRY_ASSERT (binding_list_p != NULL);

  scanner_binding_item_t *item_p = binding_list_p->items_p;
  scanner_binding_list_t *prev_binding_list_p = binding_list_p->prev_p;
  bool is_nested = binding_list_p->is_nested;

  scanner_free (binding_list_p, sizeof (scanner_binding_list_t));
  scanner_context_p->active_binding_list_p = prev_binding_list_p;

  if (!is_nested)
  {
    while (item_p != NULL)
    {
      scanner_binding_item_t *next_p = item_p->next_p;

      JERRY_ASSERT (item_p->literal_p->type & (SCANNER_LITERAL_IS_LOCAL | SCANNER_LITERAL_IS_ARG));

      scanner_free (item_p, sizeof (scanner_binding_item_t));
      item_p = next_p;
    }
    return;
  }

  JERRY_ASSERT (prev_binding_list_p != NULL);

  while (item_p != NULL)
  {
    scanner_binding_item_t *next_p = item_p->next_p;

    item_p->next_p = prev_binding_list_p->items_p;
    prev_binding_list_p->items_p = item_p;

    item_p = next_p;
  }
}  