diff options
author | Jerry DeLisle <jvdelisle@gcc.gnu.org> | 2019-11-07 03:06:20 +0000 |
---|---|---|
committer | Jerry DeLisle <jvdelisle@gcc.gnu.org> | 2019-11-07 03:06:20 +0000 |
commit | 67732fbced89c42dabea4a3bc160da80d0db046a (patch) | |
tree | feabf2ec8e1c3d38e1b267137d531abd42748a24 /libgfortran/io/io.h | |
parent | ce6c0a20b5875c18a8416d60950febea76a4b9d3 (diff) | |
download | gcc-67732fbced89c42dabea4a3bc160da80d0db046a.zip gcc-67732fbced89c42dabea4a3bc160da80d0db046a.tar.gz gcc-67732fbced89c42dabea4a3bc160da80d0db046a.tar.bz2 |
re PR libfortran/90374 (Fortran 2018: Support d0.d, e0.d, es0.d, en0.d, g0.d and ew.d e0 edit descriptors for output)
2019-11-06 Jerry DeLisle <jvdelisle@gcc.ngu.org>
PR fortran/90374
* io.c (check_format): Allow zero width for D, E, EN, and ES
specifiers as default and when -std=F2018 is given. Retain
existing errors when using the -fdec family of flags.
* libgfortran/io/format.c (parse_format_list): Relax format checking for
zero width as default and when -std=f2018.
io/format.h (format_token): Move definition to io.h.
io/io.h (format_token): Add definition here to allow access to
this definition at higher levels. Rename the declaration of
write_real_g0 to write_real_w0 and add a new format_token
argument, allowing higher level functions to pass in the
token for handling of g0 vs the other zero width specifiers.
io/transfer.c (formatted_transfer_scalar_write): Add checks for
zero width and call write_real_w0 to handle it.
io/write.c (write_real_g0): Remove.
(write_real_w0): Add new, same as previous write_real_g0 except
check format token to handle the g0 case.
* gfortran.dg/fmt_error_10.f: Modify for new constraints.
* gfortran.dg/fmt_error_7.f: Add dg-options "-std=f95".
* gfortran.dg/fmt_error_9.f: Modify for new constraints.
* gfortran.dg/fmt_zero_width.f90: New test.
From-SVN: r277905
Diffstat (limited to 'libgfortran/io/io.h')
-rw-r--r-- | libgfortran/io/io.h | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/libgfortran/io/io.h b/libgfortran/io/io.h index bcd6dde..5b89d47 100644 --- a/libgfortran/io/io.h +++ b/libgfortran/io/io.h @@ -132,6 +132,20 @@ typedef struct format_hash_entry } format_hash_entry; +/* Format tokens. Only about half of these can be stored in the + format nodes. */ + +typedef enum +{ + FMT_NONE = 0, FMT_UNKNOWN, FMT_SIGNED_INT, FMT_ZERO, FMT_POSINT, FMT_PERIOD, + FMT_COMMA, FMT_COLON, FMT_SLASH, FMT_DOLLAR, FMT_T, FMT_TR, FMT_TL, + FMT_LPAREN, FMT_RPAREN, FMT_X, FMT_S, FMT_SS, FMT_SP, FMT_STRING, + FMT_BADSTRING, FMT_P, FMT_I, FMT_B, FMT_BN, FMT_BZ, FMT_O, FMT_Z, FMT_F, + FMT_E, FMT_EN, FMT_ES, FMT_G, FMT_L, FMT_A, FMT_D, FMT_H, FMT_END, FMT_DC, + FMT_DP, FMT_STAR, FMT_RC, FMT_RD, FMT_RN, FMT_RP, FMT_RU, FMT_RZ, FMT_DT +} +format_token; + /* Representation of a namelist object in libgfortran Namelist Records @@ -928,8 +942,8 @@ internal_proto(write_o); extern void write_real (st_parameter_dt *, const char *, int); internal_proto(write_real); -extern void write_real_g0 (st_parameter_dt *, const char *, int, int); -internal_proto(write_real_g0); +extern void write_real_w0 (st_parameter_dt *, const char *, int, format_token, int); +internal_proto(write_real_w0); extern void write_x (st_parameter_dt *, int, int); internal_proto(write_x); |