re PR fortran/31495 (Is this continuation line legal?)
authorJerry DeLisle <jvdelisle@gcc.gnu.org>
Sat, 21 Apr 2007 21:34:04 +0000 (21:34 +0000)
committerJerry DeLisle <jvdelisle@gcc.gnu.org>
Sat, 21 Apr 2007 21:34:04 +0000 (21:34 +0000)
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.

From-SVN: r124022

gcc/fortran/ChangeLog
gcc/fortran/scanner.c

index a02a381ecdd616d1547608a8710a66e068ef5e2e..95afac66548c28cdcd37e20af1048e8414a33190 100644 (file)
@@ -1,3 +1,9 @@
+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.
+
 2007-04-21  Andrew Pinski  <andrew_pinski@playstation.sony.com>
 
        * f95-lang.c (lang_tree_node): Use GENERIC_NEXT
index 1f1593b3d155d6b88f2b0059c8db93e8d4eb3b92..685039cb1707eac62bb14b8c6ffa028390b8574b 100644 (file)
@@ -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'))