Move var_set and variable parsing declarations into new header.
[pspp-builds.git] / src / language / dictionary / numeric.c
index 3e3d7651dbe83b73e244ec9f822805fb1f891900..a914b06ac2502012ade383d2c5b5b84fb844f44a 100644 (file)
    02110-1301, USA. */
 
 #include <config.h>
-#include <libpspp/message.h>
+
 #include <stdlib.h>
-#include <language/command.h>
+
 #include <data/dictionary.h>
-#include <libpspp/message.h>
+#include <data/procedure.h>
+#include <data/variable.h>
+#include <language/command.h>
 #include <language/lexer/lexer.h>
+#include <language/lexer/variable-parser.h>
+#include <libpspp/message.h>
+#include <libpspp/message.h>
 #include <libpspp/str.h>
-#include <data/variable.h>
 
 #include "gettext.h"
 #define _(msgid) gettext (msgid)
@@ -47,7 +51,7 @@ cmd_numeric (void)
   do
     {
       if (!parse_DATA_LIST_vars (&v, &nv, PV_NONE))
-       return CMD_PART_SUCCESS_MAYBE;
+       return CMD_FAILURE;
 
       /* Get the optional format specification. */
       if (lex_match ('('))
@@ -98,7 +102,7 @@ fail:
   for (i = 0; i < nv; i++)
     free (v[i]);
   free (v);
-  return CMD_PART_SUCCESS_MAYBE;
+  return CMD_FAILURE;
 }
 
 /* Parses the STRING command. */
@@ -120,7 +124,7 @@ cmd_string (void)
   do
     {
       if (!parse_DATA_LIST_vars (&v, &nv, PV_NONE))
-       return CMD_PART_SUCCESS_MAYBE;
+       return CMD_FAILURE;
 
       if (!lex_force_match ('(')
          || !parse_format_specifier (&f, 0))
@@ -177,7 +181,7 @@ fail:
   for (i = 0; i < nv; i++)
     free (v[i]);
   free (v);
-  return CMD_PART_SUCCESS_MAYBE;
+  return CMD_FAILURE;
 }
 
 /* Parses the LEAVE command. */
@@ -192,12 +196,7 @@ cmd_leave (void)
   if (!parse_variables (default_dict, &v, &nv, PV_NONE))
     return CMD_CASCADING_FAILURE;
   for (i = 0; i < nv; i++)
-    {
-      if (!v[i]->reinit)
-       continue;
-      v[i]->reinit = 0;
-      v[i]->init = 1;
-    }
+    v[i]->leave = true;
   free (v);
 
   return lex_end_of_command ();