+2019-11-01 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/90988
+ * decl.c (gfc_match_private, gfc_match_public): Fixed-form source code
+ does not require whitespace between PRIVATE (or PUBLIC) and an entity.
+
2019-11-01 Tobias Burnus <tobias@codesourcery.com>
* f95-lang.c (LANG_HOOKS_OMP_ARRAY_DATA): Set to gfc_omp_array_data.
gfc_match_private (gfc_statement *st)
{
gfc_state_data *prev;
- char c;
if (gfc_match ("private") != MATCH_YES)
return MATCH_NO;
return MATCH_YES;
}
- /* At this point, PRIVATE must be followed by whitespace or ::. */
- c = gfc_peek_ascii_char ();
- if (!gfc_is_whitespace (c) && c != ':')
- return MATCH_NO;
+ /* At this point in free-form source code, PRIVATE must be followed
+ by whitespace or ::. */
+ if (gfc_current_form == FORM_FREE)
+ {
+ char c = gfc_peek_ascii_char ();
+ if (!gfc_is_whitespace (c) && c != ':')
+ return MATCH_NO;
+ }
prev = gfc_state_stack->previous;
if (gfc_current_state () != COMP_MODULE
match
gfc_match_public (gfc_statement *st)
{
- char c;
-
if (gfc_match ("public") != MATCH_YES)
return MATCH_NO;
return MATCH_YES;
}
- /* At this point, PUBLIC must be followed by whitespace or ::. */
- c = gfc_peek_ascii_char ();
- if (!gfc_is_whitespace (c) && c != ':')
- return MATCH_NO;
+ /* At this point in free-form source code, PUBLIC must be followed
+ by whitespace or ::. */
+ if (gfc_current_form == FORM_FREE)
+ {
+ char c = gfc_peek_ascii_char ();
+ if (!gfc_is_whitespace (c) && c != ':')
+ return MATCH_NO;
+ }
if (gfc_current_state () != COMP_MODULE)
{