diff options
Diffstat (limited to 'gcc/fortran/scanner.c')
-rw-r--r-- | gcc/fortran/scanner.c | 57 |
1 files changed, 28 insertions, 29 deletions
diff --git a/gcc/fortran/scanner.c b/gcc/fortran/scanner.c index 4949fe6..95d2e81d 100644 --- a/gcc/fortran/scanner.c +++ b/gcc/fortran/scanner.c @@ -113,7 +113,6 @@ gfc_scanner_done_1 (void) gfc_free(file_head); file_head = f; } - } @@ -248,12 +247,12 @@ gfc_open_intrinsic_module (const char *name) return open_included_file (name, intrinsic_modules_dirs, true); } + /* Test to see if we're at the end of the main source file. */ int gfc_at_end (void) { - return end_flag; } @@ -263,7 +262,6 @@ gfc_at_end (void) int gfc_at_eof (void) { - if (gfc_at_end ()) return 1; @@ -294,7 +292,6 @@ gfc_at_bol (void) int gfc_at_eol (void) { - if (gfc_at_eof ()) return 1; @@ -318,7 +315,7 @@ gfc_advance_line (void) gfc_current_locus.lb = gfc_current_locus.lb->next; - if (gfc_current_locus.lb != NULL) + if (gfc_current_locus.lb != NULL) gfc_current_locus.nextc = gfc_current_locus.lb->line; else { @@ -355,6 +352,7 @@ next_char (void) return c; } + /* Skip a comment. When we come here the parse pointer is positioned immediately after the comment character. If we ever implement compiler directives withing comments, here is where we parse the @@ -714,10 +712,9 @@ restart: { if (++continue_count == gfc_option.max_continue_free) { - if (gfc_notification_std (GFC_STD_GNU) - || pedantic) - gfc_warning ("Limit of %d continuations exceeded in statement at %C", - gfc_option.max_continue_free); + if (gfc_notification_std (GFC_STD_GNU) || pedantic) + gfc_warning ("Limit of %d continuations exceeded in " + "statement at %C", gfc_option.max_continue_free); } } continue_line = gfc_current_locus.lb->linenum; @@ -761,7 +758,8 @@ restart: if (in_string) { if (gfc_option.warn_ampersand) - gfc_warning_now ("Missing '&' in continued character constant at %C"); + gfc_warning_now ("Missing '&' in continued character " + "constant at %C"); gfc_current_locus.nextc--; } /* Both !$omp and !$ -fopenmp continuation lines have & on the @@ -835,10 +833,10 @@ restart: { if (++continue_count == gfc_option.max_continue_fixed) { - if (gfc_notification_std (GFC_STD_GNU) - || pedantic) - gfc_warning ("Limit of %d continuations exceeded in statement at %C", - gfc_option.max_continue_fixed); + if (gfc_notification_std (GFC_STD_GNU) || pedantic) + gfc_warning ("Limit of %d continuations exceeded in " + "statement at %C", + gfc_option.max_continue_fixed); } } @@ -997,7 +995,7 @@ gfc_gobble_whitespace (void) parts of gfortran. */ static int -load_line (FILE * input, char **pbuf, int *pbuflen) +load_line (FILE *input, char **pbuf, int *pbuflen) { static int linenum = 0, current_line = 1; int c, maxlen, i, preprocessor_flag, buflen = *pbuflen; @@ -1052,11 +1050,11 @@ load_line (FILE * input, char **pbuf, int *pbuflen) && !seen_printable && seen_ampersand) { if (pedantic) - gfc_error_now - ("'&' not allowed by itself in line %d", current_line); + gfc_error_now ("'&' not allowed by itself in line %d", + current_line); else - gfc_warning_now - ("'&' not allowed by itself in line %d", current_line); + gfc_warning_now ("'&' not allowed by itself in line %d", + current_line); } break; } @@ -1084,11 +1082,11 @@ load_line (FILE * input, char **pbuf, int *pbuflen) && c == '!' && !seen_printable && seen_ampersand) { if (pedantic) - gfc_error_now ( - "'&' not allowed by itself with comment in line %d", current_line); + gfc_error_now ("'&' not allowed by itself with comment in " + "line %d", current_line); else - gfc_warning_now ( - "'&' not allowed by itself with comment in line %d", current_line); + gfc_warning_now ("'&' not allowed by itself with comment in " + "line %d", current_line); seen_printable = 1; } @@ -1103,8 +1101,8 @@ load_line (FILE * input, char **pbuf, int *pbuflen) && 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 1 " + "of line %d", linenum); } while (i <= 6) @@ -1127,7 +1125,7 @@ load_line (FILE * input, char **pbuf, int *pbuflen) overlong line. */ buflen = buflen * 2; *pbuf = xrealloc (*pbuf, buflen + 1); - buffer = (*pbuf)+i; + buffer = (*pbuf) + i; } } else if (i >= maxlen) @@ -1234,10 +1232,10 @@ preprocessor_line (char *c) /* Make filename end at quote. */ unescape = 0; escaped = false; - while (*c && ! (! escaped && *c == '"')) + while (*c && ! (!escaped && *c == '"')) { if (escaped) - escaped = false; + escaped = false; else if (*c == '\\') { escaped = true; @@ -1407,6 +1405,7 @@ include_line (char *line) return true; } + /* Load a file into memory by calling load_line until the file ends. */ static try @@ -1582,7 +1581,7 @@ unescape_filename (const char *ptr) ++p; } - if (! *p || p[1]) + if (!*p || p[1]) return NULL; /* Undo effects of cpp_quote_string. */ |