while (nextchar == ',')
{
/* Skip leading whitespace */
- while (*p == ' ' || *p == '\t')
+ while (is_whitespace (*p))
p++;
/* Check to see if we have any operands left to parse */
- if (*p == 0 || *p == '\n' || *p == '\r')
+ if (is_end_of_stmt (*p))
{
break;
}
p = input_line_pointer;
/* Skip leading whitespace */
- while (*p == ' ' || *p == '\t')
+ while (is_whitespace (*p))
p++;
nextchar = *p++;
}
int regno;
/* Skip leading whitespace */
- while (*p == ' ' || *p == '\t')
+ while (is_whitespace (*p))
p++;
input_line_pointer = p;
p = input_line_pointer;
/* Skip whitespace */
- while (*p == ' ' || *p == '\t')
+ while (is_whitespace (*p))
p++;
if (*p == ',')
p++;
/* Skip whitespace */
- while (*p == ' ' || *p == '\t')
+ while (is_whitespace (*p))
p++;
sregp = p;
input_line_pointer = sregp;
p = input_line_pointer;
/* Skip whitespace */
- while (*p == ' ' || *p == '\t')
+ while (is_whitespace (*p))
p++;
if (*p == ',')
p++;
/* Skip whitespace */
- while (*p == ' ' || *p == '\t')
+ while (is_whitespace (*p))
p++;
input_line_pointer = p;
++operands)
;
- if (ISSPACE (*operands))
+ if (is_whitespace (*operands))
{
modified_char = *operands;
*operands++ = '\0';
/* If we're on a line with a label, check if it's a mmixal fb-label.
Save an indicator and skip the label; it must be set only after all
fb-labels of expressions are evaluated. */
- if (ISDIGIT (s[0]) && s[1] == 'H' && ISSPACE (s[2]))
+ if (ISDIGIT (s[0]) && s[1] == 'H'
+ /* A lone "1H" on a line is valid: we'll then see is_end_of_stmt()
+ being true for the following character (likely a '\n' but '\n'
+ doesn't count as is_whitespace). */
+ && (is_whitespace (s[2]) || is_end_of_stmt (s[2])))
{
current_fb_label = s[0] - '0';
s += 2;
input_line_pointer = s;
- while (*s && ISSPACE (*s) && ! is_end_of_line[(unsigned int) *s])
+ while (is_whitespace (*s))
s++;
/* For errors emitted here, the book-keeping is off by one; the
caller is about to bump the counters. Adjust the error messages. */
- if (is_end_of_line[(unsigned int) *s])
+ if (is_end_of_stmt (*s))
{
unsigned int line;
const char * name = as_where (&line);
return;
}
- if (*s == 0 || is_end_of_line[(unsigned int) *s])
+ if (is_end_of_stmt (*s))
/* We avoid handling empty lines here. */
return;
/* Find the start of the instruction or pseudo following the label,
if there is one. */
- for (insn = s;
- *insn && ISSPACE (*insn) && ! is_end_of_line[(unsigned int) *insn];
- insn++)
+ for (insn = s; is_whitespace (*insn); insn++)
/* Empty */
;
instruction or MMIXAL-pseudo (getting its alignment). Thus
is acts like a "normal" :-ended label. Ditto if it's
followed by a non-MMIXAL pseudo. */
- && !is_end_of_line[(unsigned int) *insn]
+ && !is_end_of_stmt (*insn)
&& *insn != '.')
{
/* For labels that don't end in ":", we save it so we can later give
while (*s)
{
c = *s++;
- if (is_end_of_line[(unsigned int) c])
+ if (is_end_of_stmt (c))
break;
if (c == MAGIC_FB_BACKWARD_CHAR || c == MAGIC_FB_FORWARD_CHAR)
as_bad (_("invalid characters in input"));
s = insn;
/* Skip the insn. */
- while (*s
- && ! ISSPACE (*s)
- && *s != ';'
- && ! is_end_of_line[(unsigned int) *s])
+ while (! is_whitespace (*s) && ! is_end_of_stmt (*s))
s++;
/* Skip the spaces after the insn. */
- while (*s
- && ISSPACE (*s)
- && *s != ';'
- && ! is_end_of_line[(unsigned int) *s])
+ while (is_whitespace (*s))
s++;
/* Skip the operands. While doing this, replace [0-9][BF] with
(MAGIC_FB_BACKWARD_CHAR|MAGIC_FB_FORWARD_CHAR)[0-9]. */
- while ((c = *s) != 0
- && ! ISSPACE (c)
- && c != ';'
- && ! is_end_of_line[(unsigned int) c])
+ while (! is_whitespace (c = *s) && ! is_end_of_stmt (c))
{
if (c == '"')
{
s++;
/* FIXME: Test-case for semi-colon in string. */
- while (*s
- && *s != '"'
- && (! is_end_of_line[(unsigned int) *s] || *s == ';'))
+ while (*s != '"'
+ && (! is_end_of_stmt (*s) || *s == ';'))
s++;
if (*s == '"')
}
/* Skip any spaces after the operands. */
- while (*s
- && ISSPACE (*s)
- && *s != ';'
- && !is_end_of_line[(unsigned int) *s])
+ while (is_whitespace (*s))
s++;
/* If we're now looking at a semi-colon, then it's an end-of-line
/* Make IS into an EQU by replacing it with "= ". Only match upper-case
though; let lower-case be a syntax error. */
s = insn;
- if (s[0] == 'I' && s[1] == 'S' && ISSPACE (s[2]))
+ if (s[0] == 'I' && s[1] == 'S'
+ && (is_whitespace (s[2]) || is_end_of_stmt (s[2])))
{
*s = '=';
s[1] = ' ';
else if (s[0] == 'G'
&& s[1] == 'R'
&& startswith (s, "GREG")
- && (ISSPACE (s[4]) || is_end_of_line[(unsigned char) s[4]]))
+ && (is_whitespace (s[4]) || is_end_of_stmt (s[4])))
{
input_line_pointer = s + 4;
SKIP_WHITESPACE ();
- if (is_end_of_line[(unsigned int) *input_line_pointer])
+ if (is_end_of_stmt (*input_line_pointer))
{
/* Default to zero if the expression was absent. */