+Mon May 2 23:45:01 2005 Ben Pfaff <blp@gnu.org>
+
+ Code improvements.
+
+ * data-list.c: (parse_fixed) Use lex_end_of_command().
+ (parse_free) Ditto.
+ (cmd_repeating_data) Set cont_end.num in right situations.
+ (parse_repeating_data) Remove redundant test.
+
+Mon May 2 23:37:19 2005 Ben Pfaff <blp@gnu.org>
+
+ Partial fix for PR 12859.
+
+ * data-list.c: (cmd_data_list) Add transformation properly in
+ vfm_source == NULL case.
+
Mon May 2 23:27:28 2005 Ben Pfaff <blp@gnu.org>
* lexer.c: (lex_error) Improve error messages.
if (vfm_source != NULL)
{
- struct data_list_pgm *new_pgm;
-
dls->h.proc = data_list_trns_proc;
dls->h.free = data_list_trns_free;
-
- new_pgm = xmalloc (sizeof *new_pgm);
- memcpy (new_pgm, &dls, sizeof *new_pgm);
- add_transformation (&new_pgm->h);
+ add_transformation (&dls->h);
}
else
vfm_source = create_case_source (&data_list_source_class, dls);
}
else if (!dls->rec_cnt)
dls->rec_cnt = dls->last->rec;
- if (token != '.')
- {
- lex_error (_("expecting end of command"));
- return 0;
- }
- return 1;
+ return lex_end_of_command () == CMD_SUCCESS;
fail:
for (i = 0; i < fx.name_cnt; i++)
free (name);
}
- if (token != '.')
- lex_error (_("expecting end of command"));
- return 1;
+ return lex_end_of_command () == CMD_SUCCESS;
}
/* Displays a table giving information on free-format variable parsing
/* Calculate starts_end, cont_end if necessary. */
if (rpd->starts_end.num == 0 && rpd->starts_end.var == NULL)
rpd->starts_end.num = handle_get_record_width (fh);
- if (rpd->cont_end.num == 0 && rpd->starts_end.var == NULL)
+ if (rpd->cont_end.num == 0 && rpd->cont_end.var == NULL)
rpd->cont_end.num = handle_get_record_width (fh);
/* Calculate length if possible. */
else
{
msg (SE, _("SPSS-like or FORTRAN-like format "
- "specification expected after variable names."));
+ "specification expected after variable names."));
goto fail;
}
free (fx.name[i]);
free (fx.name);
}
- if (token != '.')
- {
- lex_error (_("expecting end of command"));
- return 0;
- }
return 1;