[PATCH,Fortran] Taking a BYTE out of type-spec

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH,Fortran] Taking a BYTE out of type-spec

Steve Kargl
The patch moves the matching of the nonstandard type-spec
BYTE to its own matching function.  During this move, a
check for invalid matching in free-form source code it
detected (see byte_4.f90).  OK to commit?

2019-10-24  Steven G. Kargl  <[hidden email]>

        * decl.c (match_byte_typespec): New function.  Match BYTE type-spec.
        (gfc_match_decl_type_spec): Use it.

2019-10-24  Steven G. Kargl  <[hidden email]>

        * gfortran.dg/byte_3.f: New test.
        * gfortran.dg/byte_4.f90: Ditto.

--
Steve

byte.diff (2K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH,Fortran] Taking a BYTE out of type-spec

Steve Kargl
On Fri, Oct 25, 2019 at 09:05:03AM +0200, Tobias Burnus wrote:

> On 10/24/19 10:43 PM, Steve Kargl wrote:
> > The patch moves the matching of the nonstandard type-spec
> > BYTE to its own matching function.  During this move, a
> > check for invalid matching in free-form source code it
> > detected (see byte_4.f90).  OK to commit?
>
> OK with a nit.
>
> > +      if (gfc_current_form == FORM_FREE)
> > + {
> > +  char c = gfc_peek_ascii_char ();
> > +  if (!gfc_is_whitespace (c) && c != ',')
> > +    return MATCH_NO;
>
> You also want to permit "byte::var", hence: c == ':' is also okay – you
> can also add this as variant to the test case.
>
> Cheers,

Thanks and good catch.  I tend to think of BYTE as a legacy
extension, which likely was used prior to the double colon
notation, so 'byte ::' won't appear.  But, it does hurt to
allow it.

--
Steve