gfc_current_locus and backing up

Steve Kargl sgk@troutmask.apl.washington.edu
Mon Nov 21 04:54:00 GMT 2005


This is a heads up for people tracking down weird locus
problems.  In looking at PR 24917, which concerns BOZ
literal constants in post-fixed notation (e.g., 'ABC'Z),
I modified match_boz_constant().  I, however, am getting
strange errors because the single quote that I was expecting
to get from gfc_next_char was an 'i'.  If one looks in
gfc_match_literal_constant(), we see the following code:

  m = match_string_constant (result);
  if (m != MATCH_NO)
    return m;

  m = match_boz_constant (result);
  if (m != MATCH_NO)
    return m;

If I flip these blocks, my new and improved match_boz_constant()
suddenly behaves as I expect.  It turns out that when MATCH_NO 
occurs in match_string_constant(), gfc_current_locus is not 
restored to the initial starting locus before returning.  I'm
haven't investigated beyond this point.

-- 
Steve



More information about the Fortran mailing list