Implemented calculation of percentiles and Tukey hinges
[pspp-builds.git] / src / sel-if.c
index 514c44711a78bd5df5af762d74054876ab29edfd..8d224d0215d793e03d2966d5319efece3eb2c208 100644 (file)
@@ -20,6 +20,7 @@
 #include <config.h>
 #include "alloc.h"
 #include "command.h"
+#include "dictionary.h"
 #include "error.h"
 #include "expr.h"
 #include "lexer.h"
@@ -43,10 +44,7 @@ cmd_select_if (void)
   struct expression *e;
   struct select_if_trns *t;
 
-  lex_match_id ("SELECT");
-  lex_match_id ("IF");
-
-  e = expr_parse (PXP_BOOLEAN);
+  e = expr_parse (EXPR_BOOLEAN);
   if (!e)
     return CMD_FAILURE;
 
@@ -86,8 +84,6 @@ select_if_free (struct trns_header * t)
 int
 cmd_filter (void)
 {
-  lex_match_id ("FILTER");
-
   if (lex_match_id ("OFF"))
     dict_set_filter (default_dict, NULL);
   else
@@ -105,7 +101,7 @@ cmd_filter (void)
          return CMD_FAILURE;
        }
 
-      if (v->name[0] == '#')
+      if (dict_class_from_id (v->name) == DC_SCRATCH)
        {
          msg (SE, _("The filter variable may not be scratch."));
          return CMD_FAILURE;
@@ -125,10 +121,7 @@ cmd_process_if (void)
 {
   struct expression *e;
 
-  lex_match_id ("PROCESS");
-  lex_match_id ("IF");
-
-  e = expr_parse (PXP_BOOLEAN);
+  e = expr_parse (EXPR_BOOLEAN);
   if (!e)
     return CMD_FAILURE;