This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [gfortran] Support for [...] style array constructors


Richard E Maine wrote:
> It is possible for there to be nested array constructors. You have to 
> make sure that the end delimiter is correctly matched in such nested 
> cases. I don't know the right C terms (hey, I haltingly speak a little 
> bit of C, but it is Fortran that I am fluent in), but in Fortran I'd 
> say that it was important that the end-delim thing better be a distinct 
> variable for each recursive instance of the procedure. Probably it is, 
> but I don't speak C well enough to know.

It is, that's one of the few things that C got right :-)

> I.e., in something like
> 
>    (/ [ ... ] /)
> 
> you need to be back to looking for a "/)" to match the "(/" and not get 
> thrown off by the nested "[]". Just an obvious kind of thing to put in 
> the test.

Yes, among a bunch of others liek implied do-loops, array-valued expressions
inside the ocnstructor etc.

- Tobi


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]