aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/parse.c
diff options
context:
space:
mode:
authorTobias Schlüter <tobias.schlueter@physik.uni-muenchen.de>2004-05-27 14:35:12 +0200
committerTobias Schlüter <tobi@gcc.gnu.org>2004-05-27 14:35:12 +0200
commit63645982e7f5d9d95f152052431db81c2f119a15 (patch)
tree3c7af6dcd25c3b7df4df9f719eb578e68eb49801 /gcc/fortran/parse.c
parenta4171ce18efea96907998485b2a71e3d4f9dde4f (diff)
downloadgcc-63645982e7f5d9d95f152052431db81c2f119a15.zip
gcc-63645982e7f5d9d95f152052431db81c2f119a15.tar.gz
gcc-63645982e7f5d9d95f152052431db81c2f119a15.tar.bz2
gfortran.h (gfc_current_locus, [...]): Remove.
* gfortran.h (gfc_current_locus, gfc_set_locus): Remove. (gfc_current_locus): Declare new global variable. * scanner.c (gfc_current_locus, gfc_set_locus): Remove. (gfc_current_locus1): Rename ... (gfc_current_locus): ... to this. (gfc_at_eof, gfc_at_bol, gfc_at_eol, gfc_advance_line, next_char, skip_fixed_comments, skip_free_comments, gfc_next_char_literal, gfc_peek_char, gfc_gobble_whitespace, gfc_new_file): Use gfc_current_locus instead of gfc_current_locus1, gfc_set_locus() and gfc_current_locus(), respectively. * array.c (match_subscript, gfc_match_array_ref, match_array_list, match_array_cons_element, gfc_match_array_constructor): Read/modify gfc_current_locus instead of calling gfc_set_locus() and gfc_current_locus(). * decl.c (gfc_match_null, variable_decl, gfc_match_kind_spec, match_attr_spec, gfc_match_function_decl, gfc_match_end, attr_decl1, gfc_match_save): Likewise. * error.c (error_print, gfc_internal_error): Likewise. * expr.c (gfc_int_expr, gfc_default_logical_kind): Likewise. * interface.c (gfc_add_interface): Likewise. * io.c (gfc_match_format, match_dt_format, match_dt_element, match_io_iterator, match_io): Likewise. * match.c (gfc_match_space, gfc_match_eos, gfc_match_small_literal_int, gfc_match_st_label, gfc_match_strings, gfc_match_name, gfc_match_iterator, gfc_match_char, gfc_match, gfc_match_assignment, gfc_match_pointer_assignment, gfc_match_if, gfc_match_do, gfc_match_nullify, gfc_match_call, match_implicit_range, gfc_match_implicit, gfc_match_data, match_case_selector, gfc_match_case, match_forall_iterator): Likewise. * matchexp.c (gfc_match_defined_op_name, next_operator, match_level_1, match_mult_operand, match_ext_mult_operand, match_add_operand, match_ext_add_operand, match_level_2, match_level_3, match_level_4, match_and_operand, match_or_operand, match_equiv_operand, match_level_5, gfc_match_expr): Likewise. * module.c (gfc_match_use, mio_array_ref, mio_expr): Likewise. * parse.c (match_word, decode_statement, next_free, next_fixed, add_statement, verify_st_order, parse_if_block, gfc_parse_file): Likewise. * primary.c (match_digits, match_integer_constant, match_boz_constant, match_real_constant, match_substring, next_string_char, match_charkind_name, match_string_constant, match_logical_constant, match_const_complex_part, match_complex_constant, match_actual_arg, match_keyword_arg, gfc_match_actual_arglist, gfc_match_structure_constructor, gfc_match_rvalue, gfc_match_variable): Likewise. * st.c (gfc_get_code): Likewise. * symbol.c (check_conflict, check_used, check_done, duplicate_attr, add_flavor, gfc_add_procedure, gfc_add_intent, gfc_add_access, gfc_add_explicit_interface, gfc_add_type, gfc_add_component, gfc_reference_st_label, gfc_new_symbol): Likewise. From-SVN: r82320
Diffstat (limited to 'gcc/fortran/parse.c')
-rw-r--r--gcc/fortran/parse.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/gcc/fortran/parse.c b/gcc/fortran/parse.c
index dea613b..8b8aa5a 100644
--- a/gcc/fortran/parse.c
+++ b/gcc/fortran/parse.c
@@ -66,7 +66,7 @@ match_word (const char *str, match (*subr) (void), locus * old_locus)
if (m != MATCH_YES)
{
- gfc_set_locus (old_locus);
+ gfc_current_locus = *old_locus;
reject_statement ();
}
@@ -101,7 +101,7 @@ decode_statement (void)
if (gfc_match_eos () == MATCH_YES)
return ST_NONE;
- old_locus = *gfc_current_locus ();
+ old_locus = gfc_current_locus;
/* Try matching a data declaration or function declaration. The
input "REALFUNCTIONA(N)" can mean several things in different
@@ -118,7 +118,7 @@ decode_statement (void)
reject_statement ();
gfc_undo_symbols ();
- gfc_set_locus (&old_locus);
+ gfc_current_locus = old_locus;
}
/* Match statements whose error messages are meant to be overwritten
@@ -136,7 +136,7 @@ decode_statement (void)
if (gfc_match_subroutine () == MATCH_YES)
return ST_SUBROUTINE;
gfc_undo_symbols ();
- gfc_set_locus (&old_locus);
+ gfc_current_locus = old_locus;
/* Check for the IF, DO, SELECT, WHERE and FORALL statements, which
might begin with a block label. The match functions for these
@@ -146,17 +146,17 @@ decode_statement (void)
if (gfc_match_if (&st) == MATCH_YES)
return st;
gfc_undo_symbols ();
- gfc_set_locus (&old_locus);
+ gfc_current_locus = old_locus;
if (gfc_match_where (&st) == MATCH_YES)
return st;
gfc_undo_symbols ();
- gfc_set_locus (&old_locus);
+ gfc_current_locus = old_locus;
if (gfc_match_forall (&st) == MATCH_YES)
return st;
gfc_undo_symbols ();
- gfc_set_locus (&old_locus);
+ gfc_current_locus = old_locus;
match (NULL, gfc_match_do, ST_DO);
match (NULL, gfc_match_select, ST_SELECT_CASE);
@@ -327,7 +327,7 @@ next_free (void)
}
else
{
- label_locus = *gfc_current_locus ();
+ label_locus = gfc_current_locus;
if (gfc_statement_label->value == 0)
{
@@ -394,7 +394,7 @@ next_fixed (void)
case '8':
case '9':
label = label * 10 + c - '0';
- label_locus = *gfc_current_locus ();
+ label_locus = gfc_current_locus;
digit_flag = 1;
break;
@@ -440,14 +440,14 @@ next_fixed (void)
do
{
- loc = *gfc_current_locus ();
+ loc = gfc_current_locus;
c = gfc_next_char_literal (0);
}
while (gfc_is_whitespace (c));
if (c == '!')
goto blank_line;
- gfc_set_locus (&loc);
+ gfc_current_locus = loc;
if (gfc_match_eos () == MATCH_YES)
goto blank_line;
@@ -606,7 +606,7 @@ add_statement (void)
p = gfc_get_code ();
*p = new_st;
- p->loc = *gfc_current_locus ();
+ p->loc = gfc_current_locus;
if (gfc_state_stack->head == NULL)
gfc_state_stack->head = p;
@@ -1237,7 +1237,7 @@ verify_st_order (st_state * p, gfc_statement st)
}
/* All is well, record the statement in case we need it next time. */
- p->where = *gfc_current_locus ();
+ p->where = gfc_current_locus;
p->last_statement = st;
return SUCCESS;
@@ -1811,7 +1811,7 @@ parse_if_block (void)
}
seen_else = 1;
- else_locus = *gfc_current_locus ();
+ else_locus = gfc_current_locus;
d = new_level (gfc_state_stack->head);
d->op = EXEC_IF;
@@ -2411,7 +2411,7 @@ loop:
if (seen_program)
goto duplicate_main;
seen_program = 1;
- prog_locus = *gfc_current_locus ();
+ prog_locus = gfc_current_locus;
push_state (&s, COMP_PROGRAM, gfc_new_block);
accept_statement (st);
@@ -2449,7 +2449,7 @@ loop:
if (seen_program)
goto duplicate_main;
seen_program = 1;
- prog_locus = *gfc_current_locus ();
+ prog_locus = gfc_current_locus;
push_state (&s, COMP_PROGRAM, gfc_new_block);
parse_progunit (st);