- else
- for (i = 0; i < f->count; i++)
- if (f->f.type == FMT_DESCEND)
- {
- if (!dump_fmt_list (f->down))
- return 0;
- }
- else
- {
- struct variable *v;
-
- if (fx.cv >= fx.nv)
- {
- msg (SE, _("The number of format "
- "specifications exceeds the number of variable "
- "names given."));
- return 0;
- }
-
- v = fx.v[fx.cv++];
- if (!check_output_specifier (&f->f, true)
- || !check_specifier_type (&f->f, v->type, true)
- || !check_string_width (&f->f, v))
- return false;
-
- fx.spec.type = PRT_VAR;
- fx.spec.u.v.v = v;
- fx.spec.u.v.f = f->f;
- fx.spec.fc = fx.sc - 1;
- append_var_spec (&fx.spec);
-
- fx.sc += f->f.w;
- }
- return 1;
-}
-
-/* Recursively parses a list of FORTRAN-like format specifiers. Calls
- itself to parse nested levels of parentheses. Returns to its
- original caller NULL, to indicate error, non-NULL, but nothing
- useful, to indicate success (it returns a free()'d block). */
-static struct fmt_list *
-fixed_parse_fortran (void)
-{
- struct fmt_list *head = NULL;
- struct fmt_list *fl = NULL;
-
- lex_get (); /* skip opening parenthesis */
- while (token != ')')
- {
- if (fl)
- fl = fl->next = xmalloc (sizeof *fl);
- else
- head = fl = xmalloc (sizeof *fl);
-
- if (lex_is_number ())
- {
- if (!lex_is_integer ())
- goto fail;
- fl->count = lex_integer ();
- lex_get ();
- }
- else
- fl->count = 1;
-
- if (token == '(')
- {
- fl->f.type = FMT_DESCEND;
- fx.level++;
- fl->down = fixed_parse_fortran ();
- fx.level--;
- if (!fl->down)
- goto fail;
- }
- else if (lex_match ('/'))
- fl->f.type = FMT_NEWREC;
- else if (!parse_format_specifier (&fl->f, FMTP_ALLOW_XT)
- || !check_output_specifier (&fl->f, 1))
- goto fail;
-
- lex_match (',');
- }
- fl->next = NULL;
- lex_get ();
-
- if (fx.level)
- return head;
-
- fl->next = NULL;
- dump_fmt_list (head);
- destroy_fmt_list (head, 1);
- if (fx.cv < fx.nv)
- {
- msg (SE, _("There aren't enough format specifications "
- "to match the number of variable names given."));
- goto fail;
- }
- return head;
-
-fail:
- fl->next = NULL;
- destroy_fmt_list (head, 0);