diff options
author | tobi <tobi@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-05-18 19:20:31 +0000 |
---|---|---|
committer | tobi <tobi@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-05-18 19:20:31 +0000 |
commit | c5dad293c0fdf35e569b5e4b2488287bc042716c (patch) | |
tree | 103eb1e45541bcba7b7352fc170509174c22cd36 /gcc/fortran/array.c | |
parent | 156fac8bf264fb3e3eb91782855c454bf03007eb (diff) | |
download | gcc-c5dad293c0fdf35e569b5e4b2488287bc042716c.tar.gz |
fortran/
* array.c (gfc_match_array_constructor): Support [ ... ]
style array constructors.
testsuite/
* gfortran.dg/array_constructor_1.f90: New test.
* gfortran.dg/array_constructor_2.f90: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@99919 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/array.c')
-rw-r--r-- | gcc/fortran/array.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/gcc/fortran/array.c b/gcc/fortran/array.c index dc660d45580..f6284408567 100644 --- a/gcc/fortran/array.c +++ b/gcc/fortran/array.c @@ -866,14 +866,27 @@ gfc_match_array_constructor (gfc_expr ** result) gfc_expr *expr; locus where; match m; + const char *end_delim; if (gfc_match (" (/") == MATCH_NO) - return MATCH_NO; + { + if (gfc_match (" [") == MATCH_NO) + return MATCH_NO; + else + { + if (gfc_notify_std (GFC_STD_F2003, "New in Fortran 2003: [...] " + "style array constructors at %C") == FAILURE) + return MATCH_ERROR; + end_delim = " ]"; + } + } + else + end_delim = " /)"; where = gfc_current_locus; head = tail = NULL; - if (gfc_match (" /)") == MATCH_YES) + if (gfc_match (end_delim) == MATCH_YES) goto empty; /* Special case */ for (;;) @@ -895,7 +908,7 @@ gfc_match_array_constructor (gfc_expr ** result) break; } - if (gfc_match (" /)") == MATCH_NO) + if (gfc_match (end_delim) == MATCH_NO) goto syntax; empty: |