scanner_literal_is_const_reg (parser_context_t *context_p, /**< context */
                              uint16_t literal_index) /**< literal index */
{
  if (literal_index < PARSER_REGISTER_START)
  {
    /* Re-assignment of non-register const bindings are detected elsewhere. */
    return false;
  }

  parser_scope_stack_t *scope_stack_p = context_p->scope_stack_p + context_p->scope_stack_top;

  literal_index = (uint16_t) (literal_index - (PARSER_REGISTER_START - 1));

  do
  {
    /* Registers must be found in the scope stack. */
    JERRY_ASSERT (scope_stack_p > context_p->scope_stack_p);
    scope_stack_p--;
  }
  while (scope_stack_p->map_from == PARSER_SCOPE_STACK_FUNC
         || literal_index != (scope_stack_p->map_to & PARSER_SCOPE_STACK_REGISTER_MASK));

  return (scope_stack_p->map_to & PARSER_SCOPE_STACK_IS_CONST_REG) != 0;
} /* scanner_literal_is_const_reg */
scanner_literal_is_const_reg (parser_context_t *context_p,  
                              uint16_t literal_index)  
{
  if (literal_index < PARSER_REGISTER_START)
  {
     
    return false;
  }

  parser_scope_stack_t *scope_stack_p = context_p->scope_stack_p + context_p->scope_stack_top;

  literal_index = (uint16_t) (literal_index - (PARSER_REGISTER_START - 1));

  do
  {
     
    JERRY_ASSERT (scope_stack_p > context_p->scope_stack_p);
    scope_stack_p--;
  }
  while (scope_stack_p->map_from == PARSER_SCOPE_STACK_FUNC
         || literal_index != (scope_stack_p->map_to & PARSER_SCOPE_STACK_REGISTER_MASK));

  return (scope_stack_p->map_to & PARSER_SCOPE_STACK_IS_CONST_REG) != 0;
}  