diff options
Diffstat (limited to 'gcc/fortran/primary.c')
-rw-r--r-- | gcc/fortran/primary.c | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/gcc/fortran/primary.c b/gcc/fortran/primary.c index 560b5fa..48a5f34 100644 --- a/gcc/fortran/primary.c +++ b/gcc/fortran/primary.c @@ -2173,10 +2173,15 @@ gfc_match_rvalue (gfc_expr ** result) starts as a symbol, can be a structure component or an array reference. It can be a function if the function doesn't have a separate RESULT variable. If the symbol has not been previously - seen, we assume it is a variable. */ + seen, we assume it is a variable. -match -gfc_match_variable (gfc_expr ** result, int equiv_flag) + This function is called by two interface functions: + gfc_match_variable, which has host_flag = 1, and + gfc_match_equiv_variable, with host_flag = 0, to restrict the + match of the symbol to the local scope. */ + +static match +match_variable (gfc_expr ** result, int equiv_flag, int host_flag) { gfc_symbol *sym; gfc_symtree *st; @@ -2184,7 +2189,7 @@ gfc_match_variable (gfc_expr ** result, int equiv_flag) locus where; match m; - m = gfc_match_sym_tree (&st, 1); + m = gfc_match_sym_tree (&st, host_flag); if (m != MATCH_YES) return m; where = gfc_current_locus; @@ -2258,3 +2263,16 @@ gfc_match_variable (gfc_expr ** result, int equiv_flag) *result = expr; return MATCH_YES; } + +match +gfc_match_variable (gfc_expr ** result, int equiv_flag) +{ + return match_variable (result, equiv_flag, 1); +} + +match +gfc_match_equiv_variable (gfc_expr ** result) +{ + return match_variable (result, 1, 0); +} + |