&& (tokstart[namelen] == ' ' || tokstart[namelen] == '\t')
&& ! scanning_macro_expansion ())
{
- const char *p = tokstart + namelen + 1;
-
- while (*p == ' ' || *p == '\t')
- p++;
+ const char *p = skip_spaces (tokstart + namelen + 1);
if (*p >= '0' && *p <= '9')
return 0;
}
const char *beg = arg;
size_t beg_len = arg1 - beg;
- while (*arg1 == ' ' || *arg1 == '\t')
- arg1++;
+ arg1 = skip_spaces (arg1);
if (*arg1 == ',')
{
no_end = 0;
return;
}
arg1++;
- while (*arg1 == ' ' || *arg1 == '\t')
- arg1++;
+ arg1 = skip_spaces (arg1);
if (*arg1 == 0)
dummy_end = 1;
else
bool found_alias = false;
const char *line = *text;
- while (**text == ' ' || **text == '\t')
- (*text)++;
+ *text = skip_spaces (*text);
/* Identify the name of the command. */
len = find_command_name_length (*text);
/* We've got something. It may still not be what the caller
wants (if this command *needs* a subcommand). */
- while (**line == ' ' || **line == '\t')
- (*line)++;
+ *line = skip_spaces (*line);
if (c->is_prefix () && **line && !c->allow_unknown)
undef_cmd_error (c->prefixname ().c_str (), *line);
int bsquote = 0;
/* Strip whitespace. */
- while (*p == ' ' || *p == '\t')
- p++;
+ p = skip_spaces (p);
/* P now points to an argument. */
start_arg = p;
true);
/* Move p up to the next interesting thing. */
- while (*p == ' ' || *p == '\t')
- {
- p++;
- }
+ p = skip_spaces (p);
tracker.advance_custom_word_point_by (p - tmp_command);
|| strncmp (tokstart, "task", namelen) == 0)
&& (tokstart[namelen] == ' ' || tokstart[namelen] == '\t'))
{
- const char *p = tokstart + namelen + 1;
-
- while (*p == ' ' || *p == '\t')
- p++;
+ const char *p = skip_spaces (tokstart + namelen + 1);
if (*p >= '0' && *p <= '9')
return 0;
}
command_handler (const char *command)
{
struct ui *ui = current_ui;
- const char *c;
if (ui->instream == ui->stdin_stream)
reinitialize_more_filter ();
scoped_command_stats stat_reporter (true);
/* Do not execute commented lines. */
- for (c = command; *c == ' ' || *c == '\t'; c++)
- ;
+ const char *c = skip_spaces (command);
if (c[0] != '#')
{
execute_command (command, ui->instream == ui->stdin_stream);
/* If we just got an empty line, and that is supposed to repeat the
previous command, return the previously saved command. */
- const char *p1;
- for (p1 = cmd_line_buffer.c_str (); *p1 == ' ' || *p1 == '\t'; p1++)
- ;
+ const char *p1 = skip_spaces (cmd_line_buffer.c_str ());
if (repeat && *p1 == '\0')
return get_saved_command_line ();
&& strncmp (tokstart, "thread", namelen) == 0
&& (tokstart[namelen] == ' ' || tokstart[namelen] == '\t'))
{
- const char *p = tokstart + namelen + 1;
-
- while (*p == ' ' || *p == '\t')
- p++;
+ const char *p = skip_spaces (tokstart + namelen + 1);
if (*p >= '0' && *p <= '9')
return 0;
}
else
{
/* Not setting variable value to null. */
- val = p + 1;
- while (*val == ' ' || *val == '\t')
- val++;
+ val = skip_spaces (p + 1);
}
while (p != arg && (p[-1] == ' ' || p[-1] == '\t'))
if (*regexp == '+' || *regexp == '-')
{ /* User wants only class methods or only instance methods. */
plusminus = *regexp++;
- while (*regexp == ' ' || *regexp == '\t')
- regexp++;
+ regexp = skip_spaces (regexp);
}
if (*regexp == '\0')
strcpy(myregexp, ".*]");
while (1)
{
/* Skip whitespace. */
- while (*p == ' ' || *p == '\t' || *p == '\n')
- ++p;
+ p = skip_spaces (p);
if (*p == ':' && p[1] == ':')
{
/* Skip the `::'. */
p += 2;
/* Skip whitespace. */
- while (*p == ' ' || *p == '\t' || *p == '\n')
- ++p;
+ p = skip_spaces (p);
namestart = p;
while (*p == '_' || *p == '$' || (*p >= '0' && *p <= '9')
|| (*p >= 'a' && *p <= 'z')
static bool
space_then_number (const char *string)
{
- const char *p = string;
+ const char *p = skip_spaces (string);
- while (p[0] == ' ' || p[0] == '\t')
- ++p;
if (p == string)
return false;
rust_parser::lex_one_token (bool decimal_only)
{
/* Skip all leading whitespace. */
- while (pstate->lexptr[0] == ' '
- || pstate->lexptr[0] == '\t'
- || pstate->lexptr[0] == '\r'
- || pstate->lexptr[0] == '\n')
- ++pstate->lexptr;
+ pstate->lexptr = skip_spaces (pstate->lexptr);
/* If we hit EOF and we're completing, then return COMPLETE -- maybe
we're completing an empty string at the end of a field_expr.
return *end;
/* Allow some whitespace between `operator' and the operator symbol. */
- while (*p == ' ' || *p == '\t')
- p++;
+ p = skip_spaces (p);
/* Recognize 'operator TYPENAME'. */
target_log_command (p);
- while (*p == ' ' || *p == '\t')
- p++;
+ p = skip_spaces (p);
if (*p)
{
const char *cmd = p;
if (ignore != NULL)
{
- char *p = ignore.get ();
+ char *p = skip_spaces (ignore.get ());
- while (*p == ' ' || *p == '\t')
- ++p;
if (p[0] == 'q')
/* Do not call quit here; there is no possibility of SIGINT. */
throw_quit ("Quit");