parser_parse_script (void *source_p, /**< source code */
                     uint32_t parse_opts, /**< ecma_parse_opts_t option bits */
                     const jerry_parse_options_t *options_p) /**< additional configuration options */
{
#if JERRY_PARSER
  ecma_compiled_code_t *bytecode_p = parser_parse_source (source_p,
                                                          parse_opts,
                                                          options_p);

  if (JERRY_UNLIKELY (bytecode_p == NULL))
  {
    /* Exception has already thrown. */
    return NULL;
  }

#if JERRY_DEBUGGER
  if ((JERRY_CONTEXT (debugger_flags) & (JERRY_DEBUGGER_CONNECTED | JERRY_DEBUGGER_PARSER_WAIT))
      == (JERRY_DEBUGGER_CONNECTED | JERRY_DEBUGGER_PARSER_WAIT))
  {
    JERRY_DEBUGGER_SET_FLAGS (JERRY_DEBUGGER_PARSER_WAIT_MODE);
    jerry_debugger_send_type (JERRY_DEBUGGER_WAITING_AFTER_PARSE);

    while (JERRY_CONTEXT (debugger_flags) & JERRY_DEBUGGER_PARSER_WAIT_MODE)
    {
      jerry_debugger_receive (NULL);

      if (!(JERRY_CONTEXT (debugger_flags) & JERRY_DEBUGGER_CONNECTED))
      {
        break;
      }

      jerry_debugger_transport_sleep ();
    }
  }
#endif /* JERRY_DEBUGGER */

  return bytecode_p;
#else /* !JERRY_PARSER */
  JERRY_UNUSED (arg_list_p);
  JERRY_UNUSED (arg_list_size);
  JERRY_UNUSED (source_p);
  JERRY_UNUSED (source_size);
  JERRY_UNUSED (parse_opts);
  JERRY_UNUSED (resource_name);

  ecma_raise_syntax_error (ECMA_ERR_MSG ("Source code parsing is disabled"));
  return NULL;
#endif /* JERRY_PARSER */
} /* parser_parse_script */
parser_parse_script (void *source_p,  
                     uint32_t parse_opts,  
                     const jerry_parse_options_t *options_p)  
{
#if JERRY_PARSER
  ecma_compiled_code_t *bytecode_p = parser_parse_source (source_p,
                                                          parse_opts,
                                                          options_p);

  if (JERRY_UNLIKELY (bytecode_p == NULL))
  {
     
    return NULL;
  }

#if JERRY_DEBUGGER
  if ((JERRY_CONTEXT (debugger_flags) & (JERRY_DEBUGGER_CONNECTED | JERRY_DEBUGGER_PARSER_WAIT))
      == (JERRY_DEBUGGER_CONNECTED | JERRY_DEBUGGER_PARSER_WAIT))
  {
    JERRY_DEBUGGER_SET_FLAGS (JERRY_DEBUGGER_PARSER_WAIT_MODE);
    jerry_debugger_send_type (JERRY_DEBUGGER_WAITING_AFTER_PARSE);

    while (JERRY_CONTEXT (debugger_flags) & JERRY_DEBUGGER_PARSER_WAIT_MODE)
    {
      jerry_debugger_receive (NULL);

      if (!(JERRY_CONTEXT (debugger_flags) & JERRY_DEBUGGER_CONNECTED))
      {
        break;
      }

      jerry_debugger_transport_sleep ();
    }
  }
#endif  

  return bytecode_p;
#else  
  JERRY_UNUSED (arg_list_p);
  JERRY_UNUSED (arg_list_size);
  JERRY_UNUSED (source_p);
  JERRY_UNUSED (source_size);
  JERRY_UNUSED (parse_opts);
  JERRY_UNUSED (resource_name);

  ecma_raise_syntax_error (ECMA_ERR_MSG ("Source code parsing is disabled"));
  return NULL;
#endif  
}  