This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [gfortran] Support for [...] style array constructors
- From: Tobias Schlüter <tobias dot schlueter at physik dot uni-muenchen dot de>
- To: Richard E Maine <Richard dot Maine at nasa dot gov>
- Cc: fortran at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org,Erik Edelmann <eedelman at acclab dot helsinki dot fi>
- Date: Tue, 19 Apr 2005 00:55:20 +0200
- Subject: Re: [gfortran] Support for [...] style array constructors
- References: <20050418215227.GA21513@acclab.helsinki.fi> <426430F1.9030906@physik.uni-muenchen.de> <eb8e7716c50f0731a1c391de45551418@nasa.gov>
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