summaryrefslogtreecommitdiff
path: root/gcc/fortran/parse.c
diff options
context:
space:
mode:
authorTobias Burnus <burnus@net-b.de>2006-11-15 16:46:42 +0100
committerTobias Burnus <burnus@gcc.gnu.org>2006-11-15 16:46:42 +0100
commit8998be203171c0f305386fa12306aa282ddb5d06 (patch)
tree72938501a423f4774c1cefa48f17941af90b4ee7 /gcc/fortran/parse.c
parentdd5f63f83e862faee09a5a02bd417438a81ef8a1 (diff)
downloadgcc-8998be203171c0f305386fa12306aa282ddb5d06.tar.gz
re PR fortran/27546 (IMPORT is broken)
fortran/ 2006-11-15 Tobias Burnus <burnus@net-b.de> PR fortran/27546 * decl.c (gfc_match_import,variable_decl): Add IMPORT support. (gfc_match_kind_spec): Fix typo in gfc_error. * gfortran.h (gfc_namespace, gfc_statement): Add IMPORT support. * parse.c (decode_statement,gfc_ascii_statement, verify_st_order): Add IMPORT support. * match.h: Add gfc_match_import. * gfortran.texi: Add IMPORT to the supported Fortran 2003 features. testsuite/ 2006-11-15 Tobias Burnus <burnus@net-b.de> PR fortran/27546 * gfortran.dg/import.f90: New test. * gfortran.dg/import2.f90: New test. * gfortran.dg/import3.f90: New test. From-SVN: r118857
Diffstat (limited to 'gcc/fortran/parse.c')
-rw-r--r--gcc/fortran/parse.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/gcc/fortran/parse.c b/gcc/fortran/parse.c
index 9d855164666..cff00d5c0c3 100644
--- a/gcc/fortran/parse.c
+++ b/gcc/fortran/parse.c
@@ -229,6 +229,7 @@ decode_statement (void)
match ("inquire", gfc_match_inquire, ST_INQUIRE);
match ("implicit", gfc_match_implicit, ST_IMPLICIT);
match ("implicit% none", gfc_match_implicit_none, ST_IMPLICIT_NONE);
+ match ("import", gfc_match_import, ST_IMPORT);
match ("interface", gfc_match_interface, ST_INTERFACE);
match ("intent", gfc_match_intent, ST_ATTR_DECL);
match ("intrinsic", gfc_match_intrinsic, ST_ATTR_DECL);
@@ -1038,6 +1039,9 @@ gfc_ascii_statement (gfc_statement st)
case ST_IMPLIED_ENDDO:
p = _("implied END DO");
break;
+ case ST_IMPORT:
+ p = "IMPORT";
+ break;
case ST_INQUIRE:
p = "INQUIRE";
break;
@@ -1352,7 +1356,9 @@ unexpected_statement (gfc_statement st)
| program subroutine function module |
+---------------------------------------+
| use |
- |---------------------------------------+
+ +---------------------------------------+
+ | import |
+ +---------------------------------------+
| | implicit none |
| +-----------+------------------+
| | parameter | implicit |
@@ -1376,8 +1382,8 @@ unexpected_statement (gfc_statement st)
typedef struct
{
enum
- { ORDER_START, ORDER_USE, ORDER_IMPLICIT_NONE, ORDER_IMPLICIT,
- ORDER_SPEC, ORDER_EXEC
+ { ORDER_START, ORDER_USE, ORDER_IMPORT, ORDER_IMPLICIT_NONE,
+ ORDER_IMPLICIT, ORDER_SPEC, ORDER_EXEC
}
state;
gfc_statement last_statement;
@@ -1401,6 +1407,12 @@ verify_st_order (st_state * p, gfc_statement st)
p->state = ORDER_USE;
break;
+ case ST_IMPORT:
+ if (p->state > ORDER_IMPORT)
+ goto order;
+ p->state = ORDER_IMPORT;
+ break;
+
case ST_IMPLICIT_NONE:
if (p->state > ORDER_IMPLICIT_NONE)
goto order;
@@ -1820,6 +1832,7 @@ loop:
/* Fall through */
case ST_USE:
+ case ST_IMPORT:
case ST_IMPLICIT_NONE:
case ST_IMPLICIT:
case ST_PARAMETER: