Commit 8fc541d3 by Francois-Xavier Coudert Committed by François-Xavier Coudert

openmp.c (gfc_match_omp_eos): Use gfc_next_ascii_char and gfc_peek_ascii_char.

	* openmp.c (gfc_match_omp_eos): Use gfc_next_ascii_char and
	gfc_peek_ascii_char.
	* decl.c (gfc_match_kind_spec, gfc_match_type_spec,
	gfc_match_implicit_none, match_implicit_range, gfc_match_implicit,
	match_string_p, match_attr_spec, gfc_match_suffix,
	match_procedure_decl, gfc_match_entry, gfc_match_subroutine):
	Likewise.
	* gfortran.h (gfc_char_t): New type.
	(gfc_linebuf): Make line member a gfc_char_t.
	(locus): Make nextc member a gfc_char_t.
	(gfc_wide_is_printable, gfc_wide_is_digit, gfc_wide_fits_in_byte,
	gfc_wide_tolower, gfc_wide_strlen, gfc_next_ascii_char,
	gfc_peek_ascii_char, gfc_check_digit): New prototypes.
	* error.c (print_wide_char): New function.
	(show_locus): Use print_wide_char and gfc_wide_strlen.
	* io.c (next_char): Use gfc_char_t type.
	(match_io): Use gfc_peek_ascii_char and gfc_next_ascii_char.
	* match.c (gfc_match_parens, gfc_match_eos,
	gfc_match_small_literal_int, gfc_match_name, gfc_match_name_C,
	gfc_match_intrinsic_op, gfc_match_char,  gfc_match_return,
	gfc_match_common): Likewise.
	* match.h (gfc_match_special_char): Change prototype.
	* parse.c (decode_specification_statement, decode_statement,
	decode_omp_directive, next_free, next_fixed): Use
	gfc_peek_ascii_char and gfc_next_ascii_char.
	* primary.c (gfc_check_digit): Change name.
	(match_digits, match_hollerith_constant, match_boz_constant,
	match_real_constant, next_string_char, match_charkind_name,
	match_string_constant, match_logical_constant_string,
	match_complex_constant, match_actual_arg, match_varspec,
	gfc_match_rvalue, match_variable): Use gfc_peek_ascii_char and
	gfc_next_ascii_char.
	* scanner.c (gfc_wide_fits_in_byte, wide_is_ascii,
	gfc_wide_is_printable, gfc_wide_tolower, gfc_wide_is_digit,
	gfc_wide_is_digit, wide_atoi, gfc_wide_strlen, wide_strcpy,
	wide_strchr, widechar_to_char, wide_strncmp, wide_strncasecmp,
	gfc_next_ascii_char, gfc_peek_ascii_char):
	New functions.
	(next_char, gfc_define_undef_line, skip_free_comments,
	gfc_next_char_literal, gfc_next_char, gfc_peek_char,
	gfc_error_recovery, load_line, preprocessor_line, include_line,
	load_file, gfc_read_orig_filename): Use gfc_char_t for source
	characters and the {gfc_,}wide_* functions to manipulate wide
	strings.

From-SVN: r134992
parent d0b48c67
2008-05-06 Francois-Xavier Coudert <coudert@clipper.ens.fr>
* openmp.c (gfc_match_omp_eos): Use gfc_next_ascii_char and
gfc_peek_ascii_char.
* decl.c (gfc_match_kind_spec, gfc_match_type_spec,
gfc_match_implicit_none, match_implicit_range, gfc_match_implicit,
match_string_p, match_attr_spec, gfc_match_suffix,
match_procedure_decl, gfc_match_entry, gfc_match_subroutine):
Likewise.
* gfortran.h (gfc_char_t): New type.
(gfc_linebuf): Make line member a gfc_char_t.
(locus): Make nextc member a gfc_char_t.
(gfc_wide_is_printable, gfc_wide_is_digit, gfc_wide_fits_in_byte,
gfc_wide_tolower, gfc_wide_strlen, gfc_next_ascii_char,
gfc_peek_ascii_char, gfc_check_digit): New prototypes.
* error.c (print_wide_char): New function.
(show_locus): Use print_wide_char and gfc_wide_strlen.
* io.c (next_char): Use gfc_char_t type.
(match_io): Use gfc_peek_ascii_char and gfc_next_ascii_char.
* match.c (gfc_match_parens, gfc_match_eos,
gfc_match_small_literal_int, gfc_match_name, gfc_match_name_C,
gfc_match_intrinsic_op, gfc_match_char, gfc_match_return,
gfc_match_common): Likewise.
* match.h (gfc_match_special_char): Change prototype.
* parse.c (decode_specification_statement, decode_statement,
decode_omp_directive, next_free, next_fixed): Use
gfc_peek_ascii_char and gfc_next_ascii_char.
* primary.c (gfc_check_digit): Change name.
(match_digits, match_hollerith_constant, match_boz_constant,
match_real_constant, next_string_char, match_charkind_name,
match_string_constant, match_logical_constant_string,
match_complex_constant, match_actual_arg, match_varspec,
gfc_match_rvalue, match_variable): Use gfc_peek_ascii_char and
gfc_next_ascii_char.
* scanner.c (gfc_wide_fits_in_byte, wide_is_ascii,
gfc_wide_is_printable, gfc_wide_tolower, gfc_wide_is_digit,
gfc_wide_is_digit, wide_atoi, gfc_wide_strlen, wide_strcpy,
wide_strchr, widechar_to_char, wide_strncmp, wide_strncasecmp,
gfc_next_ascii_char, gfc_peek_ascii_char):
New functions.
(next_char, gfc_define_undef_line, skip_free_comments,
gfc_next_char_literal, gfc_next_char, gfc_peek_char,
gfc_error_recovery, load_line, preprocessor_line, include_line,
load_file, gfc_read_orig_filename): Use gfc_char_t for source
characters and the {gfc_,}wide_* functions to manipulate wide
strings.
2008-05-06 Tobias Burnus <burnus@net-b.de>
PR fortran/36117
......
......@@ -1940,7 +1940,8 @@ kind_expr:
}
gfc_gobble_whitespace ();
if ((c = gfc_next_char ()) != ')' && (ts->type != BT_CHARACTER || c != ','))
if ((c = gfc_next_ascii_char ()) != ')'
&& (ts->type != BT_CHARACTER || c != ','))
{
if (ts->type == BT_CHARACTER)
gfc_error ("Missing right parenthesis or comma at %C");
......@@ -2213,7 +2214,7 @@ gfc_match_type_spec (gfc_typespec *ts, int implicit_flag)
char name[GFC_MAX_SYMBOL_LEN + 1];
gfc_symbol *sym;
match m;
int c;
char c;
bool seen_deferred_kind;
/* A belt and braces check that the typespec is correctly being treated
......@@ -2360,7 +2361,7 @@ get_kind:
if (gfc_current_form == FORM_FREE)
{
c = gfc_peek_char();
c = gfc_peek_ascii_char();
if (!gfc_is_whitespace(c) && c != '*' && c != '('
&& c != ':' && c != ',')
return MATCH_NO;
......@@ -2400,13 +2401,14 @@ gfc_match_implicit_none (void)
static match
match_implicit_range (void)
{
int c, c1, c2, inner;
char c, c1, c2;
int inner;
locus cur_loc;
cur_loc = gfc_current_locus;
gfc_gobble_whitespace ();
c = gfc_next_char ();
c = gfc_next_ascii_char ();
if (c != '(')
{
gfc_error ("Missing character range in IMPLICIT at %C");
......@@ -2417,12 +2419,12 @@ match_implicit_range (void)
while (inner)
{
gfc_gobble_whitespace ();
c1 = gfc_next_char ();
c1 = gfc_next_ascii_char ();
if (!ISALPHA (c1))
goto bad;
gfc_gobble_whitespace ();
c = gfc_next_char ();
c = gfc_next_ascii_char ();
switch (c)
{
......@@ -2435,12 +2437,12 @@ match_implicit_range (void)
case '-':
gfc_gobble_whitespace ();
c2 = gfc_next_char ();
c2 = gfc_next_ascii_char ();
if (!ISALPHA (c2))
goto bad;
gfc_gobble_whitespace ();
c = gfc_next_char ();
c = gfc_next_ascii_char ();
if ((c != ',') && (c != ')'))
goto bad;
......@@ -2503,7 +2505,7 @@ gfc_match_implicit (void)
{
gfc_typespec ts;
locus cur_loc;
int c;
char c;
match m;
gfc_clear_ts (&ts);
......@@ -2534,7 +2536,7 @@ gfc_match_implicit (void)
{
/* We may have <TYPE> (<RANGE>). */
gfc_gobble_whitespace ();
c = gfc_next_char ();
c = gfc_next_ascii_char ();
if ((c == '\n') || (c == ','))
{
/* Check for CHARACTER with no length parameter. */
......@@ -2584,7 +2586,7 @@ gfc_match_implicit (void)
goto syntax;
gfc_gobble_whitespace ();
c = gfc_next_char ();
c = gfc_next_ascii_char ();
if ((c != '\n') && (c != ','))
goto syntax;
......@@ -2713,7 +2715,7 @@ match_string_p (const char *target)
const char *p;
for (p = target; *p; p++)
if (gfc_next_char () != *p)
if ((char) gfc_next_ascii_char () != *p)
return false;
return true;
}
......@@ -2765,22 +2767,22 @@ match_attr_spec (void)
for (;;)
{
int ch;
char ch;
d = DECL_NONE;
gfc_gobble_whitespace ();
ch = gfc_next_char ();
ch = gfc_next_ascii_char ();
if (ch == ':')
{
/* This is the successful exit condition for the loop. */
if (gfc_next_char () == ':')
if (gfc_next_ascii_char () == ':')
break;
}
else if (ch == ',')
{
gfc_gobble_whitespace ();
switch (gfc_peek_char ())
switch (gfc_peek_ascii_char ())
{
case 'a':
if (match_string_p ("allocatable"))
......@@ -2809,7 +2811,7 @@ match_attr_spec (void)
case 'i':
if (match_string_p ("int"))
{
ch = gfc_next_char ();
ch = gfc_next_ascii_char ();
if (ch == 'e')
{
if (match_string_p ("nt"))
......@@ -2841,8 +2843,8 @@ match_attr_spec (void)
break;
case 'p':
gfc_next_char ();
switch (gfc_next_char ())
gfc_next_ascii_char ();
switch (gfc_next_ascii_char ())
{
case 'a':
if (match_string_p ("rameter"))
......@@ -2861,7 +2863,7 @@ match_attr_spec (void)
break;
case 'r':
ch = gfc_next_char ();
ch = gfc_next_ascii_char ();
if (ch == 'i')
{
if (match_string_p ("vate"))
......@@ -2901,8 +2903,8 @@ match_attr_spec (void)
break;
case 'v':
gfc_next_char ();
ch = gfc_next_char ();
gfc_next_ascii_char ();
ch = gfc_next_ascii_char ();
if (ch == 'a')
{
if (match_string_p ("lue"))
......@@ -3938,7 +3940,7 @@ gfc_match_suffix (gfc_symbol *sym, gfc_symbol **result)
match is_bind_c; /* Found bind(c). */
match is_result; /* Found result clause. */
match found_match; /* Status of whether we've found a good match. */
int peek_char; /* Character we're going to peek at. */
char peek_char; /* Character we're going to peek at. */
bool allow_binding_name;
/* Initialize to having found nothing. */
......@@ -3948,7 +3950,7 @@ gfc_match_suffix (gfc_symbol *sym, gfc_symbol **result)
/* Get the next char to narrow between result and bind(c). */
gfc_gobble_whitespace ();
peek_char = gfc_peek_char ();
peek_char = gfc_peek_ascii_char ();
/* C binding names are not allowed for internal procedures. */
if (gfc_current_state () == COMP_CONTAINS
......@@ -4037,7 +4039,7 @@ match_procedure_decl (void)
/* Get the type spec. for the procedure interface. */
old_loc = gfc_current_locus;
m = gfc_match_type_spec (&current_ts, 0);
if (m == MATCH_YES || (m == MATCH_NO && gfc_peek_char () == ')'))
if (m == MATCH_YES || (m == MATCH_NO && gfc_peek_ascii_char () == ')'))
goto got_ts;
if (m == MATCH_ERROR)
......@@ -4530,7 +4532,7 @@ gfc_match_entry (void)
/* Check what next non-whitespace character is so we can tell if there
is the required parens if we have a BIND(C). */
gfc_gobble_whitespace ();
peek_char = gfc_peek_char ();
peek_char = gfc_peek_ascii_char ();
if (state == COMP_SUBROUTINE)
{
......@@ -4686,7 +4688,7 @@ gfc_match_subroutine (void)
/* Check what next non-whitespace character is so we can tell if there
is the required parens if we have a BIND(C). */
gfc_gobble_whitespace ();
peek_char = gfc_peek_char ();
peek_char = gfc_peek_ascii_char ();
if (gfc_add_subroutine (&sym->attr, sym->name, NULL) == FAILURE)
return MATCH_ERROR;
......@@ -5486,7 +5488,7 @@ match
gfc_match_pointer (void)
{
gfc_gobble_whitespace ();
if (gfc_peek_char () == '(')
if (gfc_peek_ascii_char () == '(')
{
if (!gfc_option.flag_cray_pointer)
{
......
......@@ -156,6 +156,66 @@ error_integer (long int i)
locus. Calls error_printf() recursively, but the recursion is at
most one level deep. */
static void
print_wide_char (gfc_char_t c)
{
static const char xdigit[16] = { '0', '1', '2', '3', '4', '5', '6',
'7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };
char buf[9];
if (gfc_wide_is_printable (c))
error_char (c);
else if (c < ((gfc_char_t) 1 << 8))
{
buf[2] = '\0';
buf[1] = xdigit[c & 0x0F];
c = c >> 4;
buf[0] = xdigit[c & 0x0F];
error_char ('\\');
error_char ('x');
error_string (buf);
}
else if (c < ((gfc_char_t) 1 << 16))
{
buf[4] = '\0';
buf[3] = xdigit[c & 0x0F];
c = c >> 4;
buf[2] = xdigit[c & 0x0F];
c = c >> 4;
buf[1] = xdigit[c & 0x0F];
c = c >> 4;
buf[0] = xdigit[c & 0x0F];
error_char ('\\');
error_char ('u');
error_string (buf);
}
else
{
buf[8] = '\0';
buf[7] = xdigit[c & 0x0F];
c = c >> 4;
buf[6] = xdigit[c & 0x0F];
c = c >> 4;
buf[5] = xdigit[c & 0x0F];
c = c >> 4;
buf[4] = xdigit[c & 0x0F];
c = c >> 4;
buf[3] = xdigit[c & 0x0F];
c = c >> 4;
buf[2] = xdigit[c & 0x0F];
c = c >> 4;
buf[1] = xdigit[c & 0x0F];
c = c >> 4;
buf[0] = xdigit[c & 0x0F];
error_char ('\\');
error_char ('U');
error_string (buf);
}
}
static void error_printf (const char *, ...) ATTRIBUTE_GCC_GFC(1,2);
static void
......@@ -163,8 +223,8 @@ show_locus (locus *loc, int c1, int c2)
{
gfc_linebuf *lb;
gfc_file *f;
char c, *p;
int i, m, offset, cmax;
gfc_char_t c, *p;
int i, offset, cmax;
/* TODO: Either limit the total length and number of included files
displayed or add buffering of arbitrary number of characters in
......@@ -246,8 +306,8 @@ show_locus (locus *loc, int c1, int c2)
to work correctly when nonprintable characters exist. A better
solution should be found. */
p = lb->line + offset;
i = strlen (p);
p = &(lb->line[offset]);
i = gfc_wide_strlen (p);
if (i > terminal_width)
i = terminal_width - 1;
......@@ -257,23 +317,7 @@ show_locus (locus *loc, int c1, int c2)
if (c == '\t')
c = ' ';
if (ISPRINT (c))
error_char (c);
else
{
error_char ('\\');
error_char ('x');
m = ((c >> 4) & 0x0F) + '0';
if (m > '9')
m += 'A' - '9' - 1;
error_char (m);
m = (c & 0x0F) + '0';
if (m > '9')
m += 'A' - '9' - 1;
error_char (m);
}
print_wide_char (c);
}
error_char ('\n');
......
......@@ -700,6 +700,21 @@ typedef struct
symbol_attribute;
/* We need to store source lines as sequences of multibyte source
characters. We define here a type wide enough to hold any multibyte
source character, just like libcpp does. A 32-bit type is enough. */
#if HOST_BITS_PER_INT >= 32
typedef unsigned int gfc_char_t;
#elif HOST_BITS_PER_LONG >= 32
typedef unsigned long gfc_char_t;
#elif defined(HAVE_LONG_LONG) && (HOST_BITS_PER_LONGLONG >= 32)
typedef unsigned long long gfc_char_t;
#else
# error "Cannot find an integer type with at least 32 bits"
#endif
/* The following three structures are used to identify a location in
the sources.
......@@ -729,7 +744,7 @@ typedef struct gfc_linebuf
int truncated;
bool dbg_emitted;
char line[1];
gfc_char_t line[1];
} gfc_linebuf;
#define gfc_linebuf_header_size (offsetof (gfc_linebuf, line))
......@@ -738,7 +753,7 @@ typedef struct gfc_linebuf
typedef struct
{
char *nextc;
gfc_char_t *nextc;
gfc_linebuf *lb;
} locus;
......@@ -1940,10 +1955,18 @@ void gfc_advance_line (void);
int gfc_check_include (void);
int gfc_define_undef_line (void);
int gfc_wide_is_printable (gfc_char_t);
int gfc_wide_is_digit (gfc_char_t);
int gfc_wide_fits_in_byte (gfc_char_t);
gfc_char_t gfc_wide_tolower (gfc_char_t);
size_t gfc_wide_strlen (const gfc_char_t *);
void gfc_skip_comments (void);
int gfc_next_char_literal (int);
int gfc_next_char (void);
int gfc_peek_char (void);
gfc_char_t gfc_next_char_literal (int);
gfc_char_t gfc_next_char (void);
char gfc_next_ascii_char (void);
gfc_char_t gfc_peek_char (void);
char gfc_peek_ascii_char (void);
void gfc_error_recovery (void);
void gfc_gobble_whitespace (void);
try gfc_new_file (void);
......@@ -2354,6 +2377,7 @@ bool gfc_check_access (gfc_access, gfc_access);
symbol_attribute gfc_variable_attr (gfc_expr *, gfc_typespec *);
symbol_attribute gfc_expr_attr (gfc_expr *);
match gfc_match_rvalue (gfc_expr **);
int gfc_check_digit (char, int);
/* trans.c */
void gfc_generate_code (gfc_namespace *);
......
......@@ -237,13 +237,17 @@ Allow @samp{$} as a valid character in a symbol name.
@opindex @code{backslash}
@cindex backslash
@cindex escape characters
Change the interpretation of backslashes in string literals
from a single backslash character to ``C-style'' escape characters.
The following combinations are expanded \a, \b, \f, \n, \r, \t,
\v, \\, and \0 to the ASCII characters alert, backspace, form feed,
newline, carriage return, horizontal tab, vertical tab, backslash,
and NUL, respectively. All other combinations of a character preceded
by \ are unexpanded.
Change the interpretation of backslashes in string literals from a single
backslash character to ``C-style'' escape characters. The following
combinations are expanded @code{\a}, @code{\b}, @code{\f}, @code{\n},
@code{\r}, @code{\t}, @code{\v}, @code{\\}, and @code{\0} to the ASCII
characters alert, backspace, form feed, newline, carriage return,
horizontal tab, vertical tab, backslash, and NUL, respectively.
Additionally, @code{\x}@var{nn}, @code{\u}@var{nnnn} and
@code{\U}@var{nnnnnnnn} (where each @var{n} is a hexadecimal digit) are
translated into the Unicode characters corresponding to the specified code
points. All other combinations of a character preceded by \ are
unexpanded.
@item -fmodule-private
@opindex @code{fmodule-private}
......
......@@ -132,7 +132,7 @@ mode;
static char
next_char (int in_string)
{
static char c;
static gfc_char_t c;
if (use_last_char)
{
......@@ -153,18 +153,11 @@ next_char (int in_string)
if (gfc_option.flag_backslash && c == '\\')
{
int tmp;
locus old_locus = gfc_current_locus;
/* Use a temp variable to avoid side effects from gfc_match_special_char
since it uses an int * for its argument. */
tmp = (int)c;
if (gfc_match_special_char (&tmp) == MATCH_NO)
if (gfc_match_special_char (&c) == MATCH_NO)
gfc_current_locus = old_locus;
c = (char)tmp;
if (!(gfc_option.allow_std & GFC_STD_GNU) && !inhibit_warnings)
gfc_warning ("Extension: backslash character at %C");
}
......@@ -172,7 +165,7 @@ next_char (int in_string)
if (mode == MODE_COPY)
*format_string++ = c;
c = TOUPPER (c);
c = TOUPPER ((unsigned char) c);
return c;
}
......@@ -3185,7 +3178,7 @@ match_io (io_kind k)
char name[GFC_MAX_SYMBOL_LEN + 1];
gfc_code *io_code;
gfc_symbol *sym;
int comma_flag, c;
int comma_flag;
locus where;
locus spec_end;
gfc_dt *dt;
......@@ -3203,7 +3196,7 @@ match_io (io_kind k)
else if (k == M_PRINT)
{
/* Treat the non-standard case of PRINT namelist. */
if ((gfc_current_form == FORM_FIXED || gfc_peek_char () == ' ')
if ((gfc_current_form == FORM_FIXED || gfc_peek_ascii_char () == ' ')
&& gfc_match_name (name) == MATCH_YES)
{
gfc_find_symbol (name, NULL, 1, &sym);
......@@ -3227,7 +3220,7 @@ match_io (io_kind k)
if (gfc_current_form == FORM_FREE)
{
c = gfc_peek_char();
char c = gfc_peek_ascii_char ();
if (c != ' ' && c != '*' && c != '\'' && c != '"')
{
m = MATCH_NO;
......
......@@ -38,7 +38,7 @@ extern gfc_st_label *gfc_statement_label;
/* match.c. */
/* Generic match subroutines. */
match gfc_match_special_char (int *);
match gfc_match_special_char (gfc_char_t *);
match gfc_match_space (void);
match gfc_match_eos (void);
match gfc_match_small_literal_int (int *, int *);
......
......@@ -36,17 +36,17 @@ match
gfc_match_omp_eos (void)
{
locus old_loc;
int c;
char c;
old_loc = gfc_current_locus;
gfc_gobble_whitespace ();
c = gfc_next_char ();
c = gfc_next_ascii_char ();
switch (c)
{
case '!':
do
c = gfc_next_char ();
c = gfc_next_ascii_char ();
while (c != '\n');
/* Fall through */
......
......@@ -100,7 +100,7 @@ decode_specification_statement (void)
{
gfc_statement st;
locus old_locus;
int c;
char c;
if (gfc_match_eos () == MATCH_YES)
return ST_NONE;
......@@ -121,7 +121,7 @@ decode_specification_statement (void)
statement, we eliminate most possibilities by peeking at the
first character. */
c = gfc_peek_char ();
c = gfc_peek_ascii_char ();
switch (c)
{
......@@ -229,7 +229,7 @@ decode_statement (void)
gfc_statement st;
locus old_locus;
match m;
int c;
char c;
#ifdef GFC_DEBUG
gfc_symbol_state ();
......@@ -315,7 +315,7 @@ decode_statement (void)
statement, we eliminate most possibilities by peeking at the
first character. */
c = gfc_peek_char ();
c = gfc_peek_ascii_char ();
switch (c)
{
......@@ -462,7 +462,7 @@ static gfc_statement
decode_omp_directive (void)
{
locus old_locus;
int c;
char c;
#ifdef GFC_DEBUG
gfc_symbol_state ();
......@@ -485,7 +485,7 @@ decode_omp_directive (void)
statement, we eliminate most possibilities by peeking at the
first character. */
c = gfc_peek_char ();
c = gfc_peek_ascii_char ();
switch (c)
{
......@@ -569,31 +569,34 @@ static gfc_statement
next_free (void)
{
match m;
int c, d, cnt, at_bol;
int i, cnt, at_bol;
char c;
at_bol = gfc_at_bol ();
gfc_gobble_whitespace ();
c = gfc_peek_char ();
c = gfc_peek_ascii_char ();
if (ISDIGIT (c))
{
char d;
/* Found a statement label? */
m = gfc_match_st_label (&gfc_statement_label);
d = gfc_peek_char ();
d = gfc_peek_ascii_char ();
if (m != MATCH_YES || !gfc_is_whitespace (d))
{
gfc_match_small_literal_int (&c, &cnt);
gfc_match_small_literal_int (&i, &cnt);
if (cnt > 5)
gfc_error_now ("Too many digits in statement label at %C");
if (c == 0)
if (i == 0)
gfc_error_now ("Zero is not a valid statement label at %C");
do
c = gfc_next_char ();
c = gfc_next_ascii_char ();
while (ISDIGIT(c));
if (!gfc_is_whitespace (c))
......@@ -607,11 +610,11 @@ next_free (void)
gfc_gobble_whitespace ();
if (at_bol && gfc_peek_char () == ';')
if (at_bol && gfc_peek_ascii_char () == ';')
{
gfc_error_now ("Semicolon at %C needs to be preceded by "
"statement");
gfc_next_char (); /* Eat up the semicolon. */
gfc_next_ascii_char (); /* Eat up the semicolon. */
return ST_NONE;
}
......@@ -633,8 +636,8 @@ next_free (void)
{
int i;
c = gfc_next_char ();
for (i = 0; i < 5; i++, c = gfc_next_char ())
c = gfc_next_ascii_char ();
for (i = 0; i < 5; i++, c = gfc_next_ascii_char ())
gcc_assert (c == "!$omp"[i]);
gcc_assert (c == ' ');
......@@ -646,7 +649,7 @@ next_free (void)
if (at_bol && c == ';')
{
gfc_error_now ("Semicolon at %C needs to be preceded by statement");
gfc_next_char (); /* Eat up the semicolon. */
gfc_next_ascii_char (); /* Eat up the semicolon. */
return ST_NONE;
}
......@@ -661,7 +664,7 @@ next_fixed (void)
{
int label, digit_flag, i;
locus loc;
char c;
gfc_char_t c;
if (!gfc_at_bol ())
return decode_statement ();
......@@ -694,7 +697,7 @@ next_fixed (void)
case '7':
case '8':
case '9':
label = label * 10 + c - '0';
label = label * 10 + ((unsigned char) c - '0');
label_locus = gfc_current_locus;
digit_flag = 1;
break;
......@@ -705,7 +708,7 @@ next_fixed (void)
if (gfc_option.flag_openmp)
{
for (i = 0; i < 5; i++, c = gfc_next_char_literal (0))
gcc_assert (TOLOWER (c) == "*$omp"[i]);
gcc_assert ((char) gfc_wide_tolower (c) == "*$omp"[i]);
if (c != ' ' && c != '0')
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment