Work on getting rid of trns_chain_finalize().
[pspp] / src / language / data-io / inpt-pgm.c
index 0301d7d057aa77ca000a36abc51937ab638d982e..607196169b1dc1ca3c7ec7f7d9e922dc1e7b4392 100644 (file)
@@ -1,5 +1,5 @@
 /* PSPP - a program for statistical analysis.
-   Copyright (C) 1997-9, 2000, 2009, 2010, 2011, 2012, 2013 Free Software Foundation, Inc.
+   Copyright (C) 1997-9, 2000, 2009, 2010, 2011, 2012, 2013, 2015 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -22,6 +22,7 @@
 #include "data/case.h"
 #include "data/caseinit.h"
 #include "data/casereader-provider.h"
+#include "data/control-stack.h"
 #include "data/dataset.h"
 #include "data/dictionary.h"
 #include "data/session.h"
@@ -130,7 +131,7 @@ cmd_input_program (struct lexer *lexer, struct dataset *ds)
               && lex_get_error_mode (lexer) != LEX_ERROR_TERMINAL)
             {
               if (result == CMD_EOF)
-                msg (SE, _("Unexpected end-of-file within INPUT PROGRAM."));
+                msg (SE, _("Unexpected end-of-file within %s."), "INPUT PROGRAM");
               inside_input_program = false;
               destroy_input_program (inp);
               return result;
@@ -143,7 +144,7 @@ cmd_input_program (struct lexer *lexer, struct dataset *ds)
 
   if (!saw_DATA_LIST && !saw_END_FILE)
     {
-      msg (SE, _("Input program must contain DATA LIST or END FILE."));
+      msg (SE, _("Input program must contain %s or %s."), "DATA LIST", "END FILE");
       destroy_input_program (inp);
       return CMD_FAILURE;
     }
@@ -154,8 +155,8 @@ cmd_input_program (struct lexer *lexer, struct dataset *ds)
       return CMD_FAILURE;
     }
 
-  inp->trns_chain = proc_capture_transformations (inp->ds);
-  trns_chain_finalize (inp->trns_chain);
+  ctl_stack_clear ();
+  inp->trns_chain = proc_capture_transformations (ds);
 
   inp->restart = TRNS_CONTINUE;
 
@@ -230,6 +231,7 @@ destroy_input_program (struct input_program_pgm *pgm)
   if (pgm != NULL)
     {
       session_destroy (pgm->session);
+      ctl_stack_clear ();
       trns_chain_destroy (pgm->trns_chain);
       caseinit_destroy (pgm->init);
       caseproto_unref (pgm->proto);