}
+/* Match a legacy nonstandard BYTE type-spec. */
+
+static match
+match_byte_typespec (gfc_typespec *ts)
+{
+ if (gfc_match (" byte") == MATCH_YES)
+ {
+ if (!gfc_notify_std (GFC_STD_GNU, "BYTE type at %C"))
+ return MATCH_ERROR;
+
+ if (gfc_current_form == FORM_FREE)
+ {
+ char c = gfc_peek_ascii_char ();
+ if (!gfc_is_whitespace (c) && c != ',')
+ return MATCH_NO;
+ }
+
+ if (gfc_validate_kind (BT_INTEGER, 1, true) < 0)
+ {
+ gfc_error ("BYTE type used at %C "
+ "is not available on the target machine");
+ return MATCH_ERROR;
+ }
+
+ ts->type = BT_INTEGER;
+ ts->kind = 1;
+ return MATCH_YES;
+ }
+ return MATCH_NO;
+}
+
+
/* Matches a declaration-type-spec (F03:R502). If successful, sets the ts
structure to the matched specification. This is necessary for FUNCTION and
IMPLICIT statements.
/* Clear the current binding label, in case one is given. */
curr_binding_label = NULL;
- if (gfc_match (" byte") == MATCH_YES)
- {
- if (!gfc_notify_std (GFC_STD_GNU, "BYTE type at %C"))
- return MATCH_ERROR;
-
- if (gfc_validate_kind (BT_INTEGER, 1, true) < 0)
- {
- gfc_error ("BYTE type used at %C "
- "is not available on the target machine");
- return MATCH_ERROR;
- }
-
- ts->type = BT_INTEGER;
- ts->kind = 1;
- return MATCH_YES;
- }
+ /* Match BYTE type-spec. */
+ m = match_byte_typespec (ts);
+ if (m != MATCH_NO)
+ return m;
m = gfc_match (" type (");
matched_type = (m == MATCH_YES);