X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Finpt-pgm.c;h=ef9c3646440cc889c8d0fcd2fee0e93ee927bd28;hb=4fdeb2145d081ff1b84e3f6c99f9d1c048c0d64a;hp=e27b9dee83bb02bc94b8c96c0eb201793369512e;hpb=b321086267ad1014dc5d09886396cde30f094437;p=pspp diff --git a/src/inpt-pgm.c b/src/inpt-pgm.c index e27b9dee83..ef9c364644 100644 --- a/src/inpt-pgm.c +++ b/src/inpt-pgm.c @@ -14,8 +14,8 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA - 02111-1307, USA. */ + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301, USA. */ #include #include "error.h" @@ -28,7 +28,7 @@ #include "dfm-read.h" #include "dictionary.h" #include "error.h" -#include "expr.h" +#include "expressions/public.h" #include "file-handle.h" #include "lexer.h" #include "misc.h" @@ -65,8 +65,7 @@ cmd_input_program (void) /* FIXME: we shouldn't do this here, but I'm afraid that other code will check the class of vfm_source. */ - vfm_source = create_case_source (&input_program_source_class, - default_dict, NULL); + vfm_source = create_case_source (&input_program_source_class, NULL); return lex_end_of_command (); } @@ -116,9 +115,6 @@ cmd_end_input_program (void) /* Put inp into vfm_source for later use. */ vfm_source->aux = inp; - /* FIXME: we should use create_case_source() here. */ - vfm_source->value_cnt = dict_get_next_value_idx (default_dict); - return lex_end_of_command (); } @@ -340,7 +336,7 @@ cmd_reread (void) return CMD_FAILURE; } - e = expr_parse (EXPR_NUMERIC); + e = expr_parse (default_dict, EXPR_NUMBER); if (!e) return CMD_FAILURE; } @@ -383,17 +379,15 @@ reread_trns_proc (struct trns_header * pt, struct ccase * c, dfm_reread_record (t->reader, 1); else { - union value column; - - expr_evaluate (t->column, c, case_num, &column); - if (!finite (column.f) || column.f < 1) + double column = expr_evaluate_num (t->column, c, case_num); + if (!finite (column) || column < 1) { msg (SE, _("REREAD: Column numbers must be positive finite " "numbers. Column set to 1.")); dfm_reread_record (t->reader, 1); } else - dfm_reread_record (t->reader, column.f); + dfm_reread_record (t->reader, column); } return -1; }