This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Restructure intrinsic operator parsing


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]