+2006-01-01 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR fortran/24268
+ * io.c (next_char_not_space): New function that returns the next
+ character that is not white space.
+ (format_lex): Use the new function to skip whitespace within
+ a format string.
+
2006-01-05 Erik Edelmann <eedelman@gcc.gnu.org>
PR fortran/23675
use_last_char = 1;
}
+/* Eat up the spaces and return a character. */
+
+static char
+next_char_not_space(void)
+{
+ char c;
+ do
+ {
+ c = next_char (0);
+ }
+ while (gfc_is_whitespace (c));
+ return c;
+}
+
static int value = 0;
/* Simple lexical analyzer for getting the next token in a FORMAT
return token;
}
- do
- {
- c = next_char (0);
- }
- while (gfc_is_whitespace (c));
-
+ c = next_char_not_space ();
+
negative_flag = 0;
switch (c)
{
case '-':
negative_flag = 1;
case '+':
- c = next_char (0);
+ c = next_char_not_space ();
if (!ISDIGIT (c))
{
token = FMT_UNKNOWN;
do
{
- c = next_char (0);
+ c = next_char_not_space ();
if(ISDIGIT (c))
value = 10 * value + c - '0';
}
do
{
- c = next_char (0);
+ c = next_char_not_space ();
if (c != '0')
zflag = 0;
if (ISDIGIT (c))
value = 10 * value + c - '0';
}
- while (ISDIGIT (c) || gfc_is_whitespace(c));
+ while (ISDIGIT (c));
unget_char ();
token = zflag ? FMT_ZERO : FMT_POSINT;
break;
case 'T':
- c = next_char (0);
+ c = next_char_not_space ();
if (c != 'L' && c != 'R')
unget_char ();
break;
case 'S':
- c = next_char (0);
+ c = next_char_not_space ();
if (c != 'P' && c != 'S')
unget_char ();
break;
case 'B':
- c = next_char (0);
+ c = next_char_not_space ();
if (c == 'N' || c == 'Z')
token = FMT_BLANK;
else
break;
case 'E':
- c = next_char (0);
+ c = next_char_not_space ();
if (c == 'N' || c == 'S')
token = FMT_EXT;
else