diff options
Diffstat (limited to 'libgfortran/io')
-rw-r--r-- | libgfortran/io/format.c | 10 | ||||
-rw-r--r-- | libgfortran/io/list_read.c | 28 | ||||
-rw-r--r-- | libgfortran/io/read.c | 2 |
3 files changed, 34 insertions, 6 deletions
diff --git a/libgfortran/io/format.c b/libgfortran/io/format.c index eef1d34..87e21a9 100644 --- a/libgfortran/io/format.c +++ b/libgfortran/io/format.c @@ -1235,9 +1235,9 @@ parse_format_list (st_parameter_dt *dtp, bool *seen_dd) default: /* Assume a missing comma with -std=legacy, GNU extension. */ - if (compile_options.warn_std == 0) - goto format_item_1; - format_error (dtp, tail, comma_missing); + if (compile_options.warn_std != 0) + fmt->error = comma_missing; + goto format_item_1; } /* Optional comma is a weird between state where we've just finished @@ -1252,7 +1252,7 @@ parse_format_list (st_parameter_dt *dtp, bool *seen_dd) case FMT_RPAREN: goto finished; - default: /* Assume that we have another format item */ + default: /* Assume that we have another format item */ fmt->saved_token = t; break; } @@ -1419,7 +1419,7 @@ parse_format (st_parameter_dt *dtp) else fmt->error = "Missing initial left parenthesis in format"; - if (format_cache_ok) + if (format_cache_ok && !fmt->error) save_parsed_format (dtp); else dtp->u.p.format_not_saved = 1; diff --git a/libgfortran/io/list_read.c b/libgfortran/io/list_read.c index 83124b5..7c22f61 100644 --- a/libgfortran/io/list_read.c +++ b/libgfortran/io/list_read.c @@ -1262,6 +1262,11 @@ read_character (st_parameter_dt *dtp, int length __attribute__ ((unused))) if ((c = next_char (dtp)) == EOF) goto eof; + if (c == ';') + { + push_char (dtp, c); + goto get_string; + } switch (c) { CASE_DIGITS: @@ -1294,6 +1299,13 @@ read_character (st_parameter_dt *dtp, int length __attribute__ ((unused))) for (;;) { c = next_char (dtp); + + if (c == ';') + { + push_char (dtp, c); + goto get_string; + } + switch (c) { CASE_DIGITS: @@ -1323,6 +1335,13 @@ read_character (st_parameter_dt *dtp, int length __attribute__ ((unused))) if ((c = next_char (dtp)) == EOF) goto eof; + + if (c == ';') + { + push_char (dtp, c); + goto get_string; + } + switch (c) { CASE_SEPARATORS: @@ -1346,6 +1365,13 @@ read_character (st_parameter_dt *dtp, int length __attribute__ ((unused))) { if ((c = next_char (dtp)) == EOF) goto done_eof; + + if (c == ';') + { + push_char (dtp, c); + continue; + } + switch (c) { case '"': @@ -2275,6 +2301,8 @@ list_formatted_read_scalar (st_parameter_dt *dtp, bt type, void *p, } if (c == ',' && dtp->u.p.current_unit->decimal_status == DECIMAL_COMMA) c = '.'; + if (c == ';' && dtp->u.p.current_unit->decimal_status == DECIMAL_POINT) + unget_char (dtp, c); else if (is_separator (c)) { /* Found a null value. */ diff --git a/libgfortran/io/read.c b/libgfortran/io/read.c index a8a6a69..e34d31b 100644 --- a/libgfortran/io/read.c +++ b/libgfortran/io/read.c @@ -1375,7 +1375,7 @@ exponent: /* At this point a digit string is required. We calculate the value of the exponent in order to take account of the scale factor and - the d parameter before explict conversion takes place. */ + the d parameter before explicit conversion takes place. */ if (w == 0) { |