summaryrefslogtreecommitdiff
path: root/gcc/fortran/match.c
diff options
context:
space:
mode:
authorjvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4>2010-12-11 23:14:45 +0000
committerjvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4>2010-12-11 23:14:45 +0000
commit857616f6172b13aec886bb0b3e2e166f5e75622b (patch)
tree982b960730fe59e92f42e77b35659f096fb2a00c /gcc/fortran/match.c
parent63bbb2db4e6044a9c2537900406f57bb7cd8e6bd (diff)
downloadgcc-857616f6172b13aec886bb0b3e2e166f5e75622b.tar.gz
2010-12-11 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/46705 * gfortran.h: New enum gfc_instring. (gfc_next_char_literal): Update prototype. * scanner.c (gfc_next_char_literal): Use new enum. Only give missing '&' warning for INSTRING_WARN. (gfc_next_char): Use new enum. (gfc_gobble_whitespace): Likewise. * io.c (next_char): Use new enum. (next_char_not_space): Likewise. (format_lex): Likewise. * match.c (gfc_match_parens): Likewise. (gfc_match_special_char): Likewise. (gfc_match_name_C): Likewise. * parse.c (next_fixed): Likewise. * primary.c (match_hollerith_constant): Likewise. (next_string_char): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@167716 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/match.c')
-rw-r--r--gcc/fortran/match.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/gcc/fortran/match.c b/gcc/fortran/match.c
index 6cd1c467def..44da1bb97bd 100644
--- a/gcc/fortran/match.c
+++ b/gcc/fortran/match.c
@@ -118,12 +118,13 @@ match
gfc_match_parens (void)
{
locus old_loc, where;
- int count, instring;
+ int count;
+ gfc_instring instring;
gfc_char_t c, quote;
old_loc = gfc_current_locus;
count = 0;
- instring = 0;
+ instring = NONSTRING;
quote = ' ';
for (;;)
@@ -134,13 +135,13 @@ gfc_match_parens (void)
if (quote == ' ' && ((c == '\'') || (c == '"')))
{
quote = c;
- instring = 1;
+ instring = INSTRING_WARN;
continue;
}
if (quote != ' ' && c == quote)
{
quote = ' ';
- instring = 0;
+ instring = NONSTRING;
continue;
}
@@ -185,7 +186,7 @@ gfc_match_special_char (gfc_char_t *res)
m = MATCH_YES;
- switch ((c = gfc_next_char_literal (1)))
+ switch ((c = gfc_next_char_literal (INSTRING_WARN)))
{
case 'a':
*res = '\a';
@@ -225,7 +226,7 @@ gfc_match_special_char (gfc_char_t *res)
{
char buf[2] = { '\0', '\0' };
- c = gfc_next_char_literal (1);
+ c = gfc_next_char_literal (INSTRING_WARN);
if (!gfc_wide_fits_in_byte (c)
|| !gfc_check_digit ((unsigned char) c, 16))
return MATCH_NO;
@@ -592,7 +593,7 @@ gfc_match_name_C (char *buffer)
/* Get the next char (first possible char of name) and see if
it's valid for C (either a letter or an underscore). */
- c = gfc_next_char_literal (1);
+ c = gfc_next_char_literal (INSTRING_WARN);
/* If the user put nothing expect spaces between the quotes, it is valid
and simply means there is no name= specifier and the name is the fortran
@@ -632,7 +633,7 @@ gfc_match_name_C (char *buffer)
old_loc = gfc_current_locus;
/* Get next char; param means we're in a string. */
- c = gfc_next_char_literal (1);
+ c = gfc_next_char_literal (INSTRING_WARN);
} while (ISALNUM (c) || c == '_');
buffer[i] = '\0';