diff options
Diffstat (limited to 'gcc/fortran/match.c')
-rw-r--r-- | gcc/fortran/match.c | 84 |
1 files changed, 0 insertions, 84 deletions
diff --git a/gcc/fortran/match.c b/gcc/fortran/match.c index dcf6ad1..83b8873 100644 --- a/gcc/fortran/match.c +++ b/gcc/fortran/match.c @@ -417,90 +417,6 @@ gfc_match_label (void) } -/* Try and match the input against an array of possibilities. If one - potential matching string is a substring of another, the longest - match takes precedence. Spaces in the target strings are optional - spaces that do not necessarily have to be found in the input - stream. In fixed mode, spaces never appear. If whitespace is - matched, it matches unlimited whitespace in the input. For this - reason, the 'mp' member of the mstring structure is used to track - the progress of each potential match. - - If there is no match we return the tag associated with the - terminating NULL mstring structure and leave the locus pointer - where it started. If there is a match we return the tag member of - the matched mstring and leave the locus pointer after the matched - character. - - A '%' character is a mandatory space. */ - -int -gfc_match_strings (mstring *a) -{ - mstring *p, *best_match; - int no_match, c, possibles; - locus match_loc; - - possibles = 0; - - for (p = a; p->string != NULL; p++) - { - p->mp = p->string; - possibles++; - } - - no_match = p->tag; - - best_match = NULL; - match_loc = gfc_current_locus; - - gfc_gobble_whitespace (); - - while (possibles > 0) - { - c = gfc_next_char (); - - /* Apply the next character to the current possibilities. */ - for (p = a; p->string != NULL; p++) - { - if (p->mp == NULL) - continue; - - if (*p->mp == ' ') - { - /* Space matches 1+ whitespace(s). */ - if ((gfc_current_form == FORM_FREE) && gfc_is_whitespace (c)) - continue; - - p->mp++; - } - - if (*p->mp != c) - { - /* Match failed. */ - p->mp = NULL; - possibles--; - continue; - } - - p->mp++; - if (*p->mp == '\0') - { - /* Found a match. */ - match_loc = gfc_current_locus; - best_match = p; - possibles--; - p->mp = NULL; - } - } - } - - gfc_current_locus = match_loc; - - return (best_match == NULL) ? no_match : best_match->tag; -} - - /* See if the current input looks like a name of some sort. Modifies the passed buffer which must be GFC_MAX_SYMBOL_LEN+1 bytes long. Note that options.c restricts max_identifier_length to not more |