aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/scanner.c
diff options
context:
space:
mode:
authorTobias Burnus <burnus@net-b.de>2008-01-22 08:33:46 +0100
committerTobias Burnus <burnus@gcc.gnu.org>2008-01-22 08:33:46 +0100
commitfd1935d5e1d1db05547cbcf866e8afc26d1132f3 (patch)
treec296af0517ea5fbeb3b28b77ed5faa3ef2d09626 /gcc/fortran/scanner.c
parent87a64f537b2da1b02a7ec0de254b60614db72074 (diff)
downloadgcc-fd1935d5e1d1db05547cbcf866e8afc26d1132f3.zip
gcc-fd1935d5e1d1db05547cbcf866e8afc26d1132f3.tar.gz
gcc-fd1935d5e1d1db05547cbcf866e8afc26d1132f3.tar.bz2
re PR fortran/34899 (Continuation lines with <tab><number> not recognized)
2008-01-22 Tobias Burnus <burnus@net-b.de> PR fortran/34899 * scanner.c (load_line): Support <tab><digit> continuation * lines. * invoke.texi (-Wtabs): Document this. 2008-01-22 Tobias Burnus <burnus@net-b.de> PR fortran/34899 * gfortran.dg/tab_continuation.f: New. From-SVN: r131713
Diffstat (limited to 'gcc/fortran/scanner.c')
-rw-r--r--gcc/fortran/scanner.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/gcc/fortran/scanner.c b/gcc/fortran/scanner.c
index da4c37b..9bbb065 100644
--- a/gcc/fortran/scanner.c
+++ b/gcc/fortran/scanner.c
@@ -1106,6 +1106,7 @@ load_line (FILE *input, char **pbuf, int *pbuflen)
int trunc_flag = 0, seen_comment = 0;
int seen_printable = 0, seen_ampersand = 0;
char *buffer;
+ bool found_tab = false;
/* Determine the maximum allowed line length. */
if (gfc_current_form == FORM_FREE)
@@ -1184,17 +1185,30 @@ load_line (FILE *input, char **pbuf, int *pbuflen)
&& (c == '*' || c == 'c' || c == 'd'))
seen_comment = 1;
- if (gfc_current_form == FORM_FIXED && c == '\t' && i <= 6)
+ /* Vendor extension: "<tab>1" marks a continuation line. */
+ if (found_tab)
{
+ found_tab = false;
+ if (c >= '1' && c <= '9')
+ {
+ *(buffer-1) = c;
+ continue;
+ }
+ }
+
+ if (gfc_current_form == FORM_FIXED && c == '\t' && i < 6)
+ {
+ found_tab = true;
+
if (!gfc_option.warn_tabs && seen_comment == 0
&& current_line != linenum)
{
linenum = current_line;
- gfc_warning_now ("Nonconforming tab character in column 1 "
- "of line %d", linenum);
+ gfc_warning_now ("Nonconforming tab character in column %d "
+ "of line %d", i+1, linenum);
}
- while (i <= 6)
+ while (i < 6)
{
*buffer++ = ' ';
i++;