+ enum fmt_type fmt_type;
+ if (!fmt_from_name (fmt_type_name, &fmt_type))
+ {
+ lex_next_error (lexer, -1, -1,
+ _("Unknown format type `%s'."), fmt_type_name);
+ goto error;
+ }
+ int end_ofs = lex_ofs (lexer) - 1;
+
+ /* Compose input format. */
+ input = (struct fmt_spec) { .type = fmt_type, .w = lc - fc + 1 };
+ error = fmt_check_input__ (&input);
+ if (error)
+ {
+ lex_next_error (lexer, start_ofs, end_ofs, "%s", error);
+ free (error);
+ goto error;
+ }
+
+ /* Compose output format. */
+ if (w != 0)
+ {
+ output = (struct fmt_spec) { .type = fmt_type, .w = w, .d = d };
+ error = fmt_check_output__ (&output);
+ if (error)
+ {
+ lex_next_error (lexer, start_ofs, end_ofs, "%s", error);
+ free (error);
+ goto error;
+ }
+ }
+ else
+ output = fmt_for_output_from_input (&input,
+ settings_get_fmt_settings ());
+ }