This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [PATCH] Restructure intrinsic operator parsing
- From: Tobias Schlüter <tobias dot schlueter at physik dot uni-muenchen dot de>
- To: Roger Sayle <roger at eyesopen dot com>
- Cc: fortran at gcc dot gnu dot org
- Date: Tue, 21 Aug 2007 19:51:44 +0200
- Subject: Re: [PATCH] Restructure intrinsic operator parsing
- References: <3770.65.19.16.50.1187717611.squirrel@mail.eyesopen.com>
Roger Sayle wrote:
2007-08-21 Roger Sayle <roger@eyesopen.com>
* match.c (intrinsic_operators): Delete.
(gfc_match_intrinsic_op): Rewrite matcher to avoid calling
gfc_match_strings.
Ok, but I would prefer if you rewrote this to use gfc_peek_char(), as in
the following example:
! case '>':
! best_loc = gfc_current_locus;
! if (gfc_next_char () == '=')
! {
! /* Matched ">=". */
! *result = INTRINSIC_GE;
! return MATCH_YES;
! }
! /* Matched ">". */
! gfc_current_locus = best_loc;
! *result = INTRINSIC_GT;
! return MATCH_YES;
rewrite as:
case '>':
if (gfc_peek_char () == '=')
{
/* Matched ">=". */
gfc_next_char ();
*result = INTRINSIC_GE;
return MATCH_YES;
}
/* Matched ">". */
*result = INTRINSIC_GT;
return MATCH_YES;
Do you have plans to remove the last caller of gfc_match_strings() as well?
Cheers,
- Tobi