EXAMINE: Correct bug where /PLOT=ALL would not include the spreadlevel plot
[pspp] / src / language / stats / sort-criteria.c
index b8bdbd06f85b658808e7cfd6126a9350b845ab00..0556f93b6821ef2457c82445aa984ccfde2af6f9 100644 (file)
@@ -44,7 +44,7 @@ parse_sort_criteria (struct lexer *lexer, const struct dictionary *dict,
   const struct variable **local_vars = NULL;
   size_t var_cnt = 0;
 
-  if (vars == NULL) 
+  if (vars == NULL)
     vars = &local_vars;
   *vars = NULL;
 
@@ -71,26 +71,23 @@ parse_sort_criteria (struct lexer *lexer, const struct dictionary *dict,
             direction = SC_ASCEND;
           else
            {
-             msg (SE, _("`A' or `D' expected inside parentheses."));
-              goto error;
-           }
-         if (!lex_match (lexer, T_RPAREN))
-           {
-             msg (SE, _("`)' expected."));
+              lex_error_expecting (lexer, "A", "D", NULL_SENTINEL);
               goto error;
            }
+         if (!lex_force_match (lexer, T_RPAREN))
+            goto error;
           if (saw_direction != NULL)
             *saw_direction = true;
        }
       else
         direction = SC_ASCEND;
 
-      for (i = prev_var_cnt; i < var_cnt; i++) 
+      for (i = prev_var_cnt; i < var_cnt; i++)
         {
           const struct variable *var = (*vars)[i];
           if (!subcase_add_var (ordering, var, direction))
             msg (SW, _("Variable %s specified twice in sort criteria."),
-                 var_get_name (var)); 
+                 var_get_name (var));
         }
     }
   while (lex_token (lexer) == T_ID