scanner_push_literal_pool (parser_context_t *context_p, /**< context */
                           scanner_context_t *scanner_context_p, /**< scanner context */
                           uint16_t status_flags) /**< combination of scanner_literal_pool_flags_t flags */
{
  scanner_literal_pool_t *prev_literal_pool_p = scanner_context_p->active_literal_pool_p;
  scanner_literal_pool_t *literal_pool_p;

  literal_pool_p = (scanner_literal_pool_t *) scanner_malloc (context_p, sizeof (scanner_literal_pool_t));

  if (!(status_flags & SCANNER_LITERAL_POOL_FUNCTION))
  {
    JERRY_ASSERT (prev_literal_pool_p != NULL);
    status_flags |= SCANNER_LITERAL_POOL_NO_ARGUMENTS;

#if JERRY_ESNEXT
    const uint16_t copied_flags = (SCANNER_LITERAL_POOL_IN_WITH
                                   | SCANNER_LITERAL_POOL_GENERATOR
                                   | SCANNER_LITERAL_POOL_ASYNC);
#else /* !JERRY_ESNEXT */
    const uint16_t copied_flags = SCANNER_LITERAL_POOL_IN_WITH;
#endif /* JERRY_ESNEXT */

    status_flags |= (uint16_t) (prev_literal_pool_p->status_flags & copied_flags);
  }
#if JERRY_ESNEXT
  else
  {
    context_p->status_flags &= (uint32_t) ~(PARSER_IS_GENERATOR_FUNCTION | PARSER_IS_ASYNC_FUNCTION);

    if (status_flags & SCANNER_LITERAL_POOL_GENERATOR)
    {
      context_p->status_flags |= PARSER_IS_GENERATOR_FUNCTION;
    }

    if (status_flags & SCANNER_LITERAL_POOL_ASYNC)
    {
      context_p->status_flags |= PARSER_IS_ASYNC_FUNCTION;
    }
  }
#endif /* JERRY_ESNEXT */

  if (prev_literal_pool_p != NULL)
  {
    const uint16_t copied_flags = SCANNER_LITERAL_POOL_IS_STRICT;
    status_flags |= (uint16_t) (prev_literal_pool_p->status_flags & copied_flags);

    /* The logical value of these flags must be the same. */
    JERRY_ASSERT (!(status_flags & SCANNER_LITERAL_POOL_IS_STRICT) == !(context_p->status_flags & PARSER_IS_STRICT));
  }

  parser_list_init (&literal_pool_p->literal_pool,
                    sizeof (lexer_lit_location_t),
                    (uint32_t) ((128 - sizeof (void *)) / sizeof (lexer_lit_location_t)));
  literal_pool_p->source_p = NULL;
  literal_pool_p->status_flags = status_flags;
  literal_pool_p->no_declarations = 0;

  literal_pool_p->prev_p = prev_literal_pool_p;
  scanner_context_p->active_literal_pool_p = literal_pool_p;

  return literal_pool_p;
} /* scanner_push_literal_pool */
scanner_push_literal_pool (parser_context_t *context_p,  
                           scanner_context_t *scanner_context_p,  
                           uint16_t status_flags)  
{
  scanner_literal_pool_t *prev_literal_pool_p = scanner_context_p->active_literal_pool_p;
  scanner_literal_pool_t *literal_pool_p;

  literal_pool_p = (scanner_literal_pool_t *) scanner_malloc (context_p, sizeof (scanner_literal_pool_t));

  if (!(status_flags & SCANNER_LITERAL_POOL_FUNCTION))
  {
    JERRY_ASSERT (prev_literal_pool_p != NULL);
    status_flags |= SCANNER_LITERAL_POOL_NO_ARGUMENTS;

#if JERRY_ESNEXT
    const uint16_t copied_flags = (SCANNER_LITERAL_POOL_IN_WITH
                                   | SCANNER_LITERAL_POOL_GENERATOR
                                   | SCANNER_LITERAL_POOL_ASYNC);
#else  
    const uint16_t copied_flags = SCANNER_LITERAL_POOL_IN_WITH;
#endif  

    status_flags |= (uint16_t) (prev_literal_pool_p->status_flags & copied_flags);
  }
#if JERRY_ESNEXT
  else
  {
    context_p->status_flags &= (uint32_t) ~(PARSER_IS_GENERATOR_FUNCTION | PARSER_IS_ASYNC_FUNCTION);

    if (status_flags & SCANNER_LITERAL_POOL_GENERATOR)
    {
      context_p->status_flags |= PARSER_IS_GENERATOR_FUNCTION;
    }

    if (status_flags & SCANNER_LITERAL_POOL_ASYNC)
    {
      context_p->status_flags |= PARSER_IS_ASYNC_FUNCTION;
    }
  }
#endif  

  if (prev_literal_pool_p != NULL)
  {
    const uint16_t copied_flags = SCANNER_LITERAL_POOL_IS_STRICT;
    status_flags |= (uint16_t) (prev_literal_pool_p->status_flags & copied_flags);

     
    JERRY_ASSERT (!(status_flags & SCANNER_LITERAL_POOL_IS_STRICT) == !(context_p->status_flags & PARSER_IS_STRICT));
  }

  parser_list_init (&literal_pool_p->literal_pool,
                    sizeof (lexer_lit_location_t),
                    (uint32_t) ((128 - sizeof (void *)) / sizeof (lexer_lit_location_t)));
  literal_pool_p->source_p = NULL;
  literal_pool_p->status_flags = status_flags;
  literal_pool_p->no_declarations = 0;

  literal_pool_p->prev_p = prev_literal_pool_p;
  scanner_context_p->active_literal_pool_p = literal_pool_p;

  return literal_pool_p;
}  