Make the expression code a little nicer and fix bugs found
[pspp-builds.git] / src / do-if.c
index 339710696326035de2bf4ec760a9b05dedfe246f..6f9aa507ed5ecada4516e8a13622df036f5fa103 100644 (file)
@@ -19,7 +19,7 @@
 
 #include <config.h>
 #include "do-ifP.h"
-#include <assert.h>
+#include "error.h"
 #include <stdlib.h>
 #include "alloc.h"
 #include "command.h"
@@ -155,8 +155,6 @@ cmd_else (void)
 {
   struct do_if_trns *t;
 
-  lex_match_id ("ELSE");
-
   /* Check that we're in a pleasing situation. */
   if (!ctl_stack || ctl_stack->type != CST_DO_IF)
     {
@@ -198,8 +196,6 @@ cmd_end_if (void)
   /* List iterator. */
   struct do_if_trns *iter;
 
-  lex_match_id ("IF");
-
   /* Check that we're in a pleasing situation. */
   if (!ctl_stack || ctl_stack->type != CST_DO_IF)
     {
@@ -252,9 +248,7 @@ parse_do_if (void)
   struct do_if_trns *t;
   struct expression *e;
 
-  lex_match_id ("IF");
-
-  e = expr_parse (PXP_BOOLEAN);
+  e = expr_parse (EXPR_BOOLEAN);
   if (!e)
     return NULL;
   if (token != '.')