lexer: Use error helper functions in more situations.
[pspp-builds.git] / src / language / stats / sort-criteria.c
index b8bdbd06f85b658808e7cfd6126a9350b845ab00..a8c1ff13d221424119a348320ba7b0549e804165 100644 (file)
@@ -71,14 +71,11 @@ 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;
        }