summaryrefslogtreecommitdiff
path: root/gcc/fortran/scanner.c
diff options
context:
space:
mode:
authorjvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4>2007-04-21 21:34:04 +0000
committerjvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4>2007-04-21 21:34:04 +0000
commit774244a790fbf64d41dade7e49a98b6f7f01b3a4 (patch)
tree4a1955d976569c717b0f3c5ff01fe68470417d99 /gcc/fortran/scanner.c
parent98d4f925caa14e46516a6ee9f00db93862634b08 (diff)
downloadgcc-774244a790fbf64d41dade7e49a98b6f7f01b3a4.tar.gz
2007-04-21 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/31495 * scanner.c (load_line): Remove check for comment after ampersand and adjust tracking of ampersand. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@124022 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/scanner.c')
-rw-r--r--gcc/fortran/scanner.c22
1 files changed, 7 insertions, 15 deletions
diff --git a/gcc/fortran/scanner.c b/gcc/fortran/scanner.c
index 1f1593b3d15..685039cb170 100644
--- a/gcc/fortran/scanner.c
+++ b/gcc/fortran/scanner.c
@@ -1050,7 +1050,7 @@ load_line (FILE *input, char **pbuf, int *pbuflen)
{
/* Check for illegal use of ampersand. See F95 Standard 3.3.1.3. */
if (gfc_current_form == FORM_FREE
- && !seen_printable && seen_ampersand)
+ && !seen_printable && seen_ampersand)
{
if (pedantic)
gfc_error_now ("'&' not allowed by itself in line %d",
@@ -1067,25 +1067,17 @@ load_line (FILE *input, char **pbuf, int *pbuflen)
if (c == '\0')
continue;
- /* Check for illegal use of ampersand. See F95 Standard 3.3.1.3. */
if (c == '&')
- seen_ampersand = 1;
-
- if ((c != ' ' && c != '&' && c != '!') || (c == '!' && !seen_ampersand))
- seen_printable = 1;
-
- if (gfc_current_form == FORM_FREE
- && c == '!' && !seen_printable && seen_ampersand)
{
- if (pedantic)
- gfc_error_now ("'&' not allowed by itself with comment in "
- "line %d", current_line);
+ if (seen_ampersand)
+ seen_ampersand = 0;
else
- gfc_warning_now ("'&' not allowed by itself with comment in "
- "line %d", current_line);
- seen_printable = 1;
+ seen_ampersand = 1;
}
+ if ((c != '&' && c != '!') || (c == '!' && !seen_ampersand))
+ seen_printable = 1;
+
/* Is this a fixed-form comment? */
if (gfc_current_form == FORM_FIXED && i == 0
&& (c == '*' || c == 'c' || c == 'd'))