Repository: neovim/neovim
File: src/nvim/ex_docmd.c (C)

Code before:

  return OK;
}

/// Check if command is not implemented
bool is_cmd_ni(cmdidx_T cmdidx)
{
  return !IS_USER_CMDIDX(cmdidx) && (cmdnames[cmdidx].cmd_func == ex_ni
                                     || cmdnames[cmdidx].cmd_func == ex_script_ni);
}

// Find the command name after skipping range specifiers.
static char *find_command_after_range(exarg_T *eap)
{
  char *cmd = eap->cmd;
  eap->cmd = skip_range(eap->cmd, NULL);
  if (*eap->cmd == '*') {
    eap->cmd = skipwhite(eap->cmd + 1);
  }
  char *p = find_ex_command(eap, NULL);
  eap->cmd = cmd;  // Restore original position for address parsing
  return p;
}

// Set the forceit flag based on the presence of '!' after the command.
static void set_forceit_flag(exarg_T *eap, char **p)
{
  if (**p == '!' && eap->cmdidx != CMD_substitute
      && eap->cmdidx != CMD_smagic && eap->cmdidx != CMD_snomagic) {
    (*p)++;
    eap->forceit = true;
  } else {
    eap->forceit = false;
  }
}

/// Parse command line and return information about the first command.
/// If parsing is done successfully, need to free cmod_filter_pat and cmod_filter_regmatch.regprog
/// after calling, usually done using undo_cmdmod() or execute_cmd().
///
/// @param cmdline Command line string
/// @param[out] eap Ex command arguments
/// @param[out] cmdinfo Command parse information
/// @param[out] errormsg Error message, if any
///
/// @return Success or failure
bool parse_cmdline(char **cmdline, exarg_T *eap, CmdParseInfo *cmdinfo, const char **errormsg)
{
  char *after_modifier = NULL;
  bool retval = false;
  // parsing the command modifiers may set ex_pressedreturn

Review comment (suggestion):
this name is a  bit misleading.

```suggestion
static void parse_bang(exarg_T *eap, char **p)
```

Code after:

  return OK;
}

/// Check if command is not implemented
bool is_cmd_ni(cmdidx_T cmdidx)
{
  return !IS_USER_CMDIDX(cmdidx) && (cmdnames[cmdidx].cmd_func == ex_ni
                                     || cmdnames[cmdidx].cmd_func == ex_script_ni);
}

// Find the command name after skipping range specifiers.
static char *find_excmd_after_range(exarg_T *eap)
{
  // Save location after command modifiers.
  char *cmd = eap->cmd;
  eap->cmd = skip_range(eap->cmd, NULL);
  if (*eap->cmd == '*') {
    eap->cmd = skipwhite(eap->cmd + 1);
  }
  char *p = find_ex_command(eap, NULL);
  eap->cmd = cmd;  // Restore original position for address parsing
  return p;
}

// Set the forceit flag based on the presence of '!' after the command.
static bool parse_bang(const exarg_T *eap, char **p)
{
  if (**p == '!'
      && eap->cmdidx != CMD_substitute
      && eap->cmdidx != CMD_smagic
      && eap->cmdidx != CMD_snomagic) {
    (*p)++;
    return true;
  }
  return false;
}

/// Parse command line and return information about the first command.
/// If parsing is done successfully, need to free cmod_filter_pat and cmod_filter_regmatch.regprog
/// after calling, usually done using undo_cmdmod() or execute_cmd().
///
/// @param cmdline Command line string
/// @param[out] eap Ex command arguments
/// @param[out] cmdinfo Command parse information
/// @param[out] errormsg Error message, if any
///
/// @return Success or failure
bool parse_cmdline(char **cmdline, exarg_T *eap, CmdParseInfo *cmdinfo, const char **errormsg)
{
  char *after_modifier = NULL;