- tab_dim (t, tab_natural_dimensions);
- for (nspec = recno = 0, spec = prt.spec; spec; spec = spec->next)
- switch (spec->type)
- {
- case PRT_NEWLINE:
- recno++;
- break;
- case PRT_CONST:
- {
- int len = strlen (spec->u.c);
- nspec++;
- tab_text (t, 0, nspec, TAB_LEFT | TAB_FIX | TAT_PRINTF,
- "\"%s\"", spec->u.c);
- tab_text (t, 1, nspec, TAT_PRINTF, "%d", recno + 1);
- tab_text (t, 2, nspec, TAT_PRINTF, "%3d-%3d",
- spec->fc + 1, spec->fc + len);
- tab_text (t, 3, nspec, TAB_LEFT | TAB_FIX | TAT_PRINTF,
- "A%d", len);
- break;
- }
- case PRT_VAR:
- {
- nspec++;
- tab_text (t, 0, nspec, TAB_LEFT, spec->u.v.v->name);
- tab_text (t, 1, nspec, TAT_PRINTF, "%d", recno + 1);
- tab_text (t, 2, nspec, TAT_PRINTF, "%3d-%3d",
- spec->fc + 1, spec->fc + spec->u.v.f.w);
- tab_text (t, 3, nspec, TAB_LEFT | TAB_FIX,
- fmt_to_string (&spec->u.v.f));
- break;
+ row = 1;
+ ll_for_each (spec, struct prt_out_spec, ll, &trns->specs)
+ {
+ char fmt_string[FMT_STRING_LEN_MAX + 1];
+ int width;
+ switch (spec->type)
+ {
+ case PRT_LITERAL:
+ tab_text_format (t, 0, row, TAB_LEFT | TAB_FIX, "`%.*s'",
+ (int) ds_length (&spec->string),
+ ds_data (&spec->string));
+ width = ds_length (&spec->string);
+ break;
+ case PRT_VAR:
+ tab_text (t, 0, row, TAB_LEFT, var_get_name (spec->var));
+ tab_text (t, 3, row, TAB_LEFT | TAB_FIX,
+ fmt_to_string (&spec->format, fmt_string));
+ width = spec->format.w;
+ break;
+ default:
+ NOT_REACHED ();