X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flanguage%2Fdictionary%2Frename-variables.c;h=4fc5bada85df3cc3f716bfb816767173660329b2;hb=6e2be552b8c17b0632803e21b296155e79dd67b4;hp=437450451075797d0dc022ef808231c726243691;hpb=81579d9e9f994fb2908f50af41c3eb033d216e58;p=pspp diff --git a/src/language/dictionary/rename-variables.c b/src/language/dictionary/rename-variables.c index 4374504510..4fc5bada85 100644 --- a/src/language/dictionary/rename-variables.c +++ b/src/language/dictionary/rename-variables.c @@ -18,8 +18,8 @@ #include +#include "data/dataset.h" #include "data/dictionary.h" -#include "data/procedure.h" #include "data/variable.h" #include "language/command.h" #include "language/lexer/lexer.h" @@ -53,20 +53,15 @@ cmd_rename_variables (struct lexer *lexer, struct dataset *ds) size_t prev_nv_1 = rename_cnt; size_t prev_nv_2 = rename_cnt; - if (!lex_match (lexer, T_LPAREN)) - { - msg (SE, _("`(' expected.")); - goto lossage; - } + if (!lex_force_match (lexer, T_LPAREN)) + goto lossage; if (!parse_variables (lexer, dataset_dict (ds), &rename_vars, &rename_cnt, PV_APPEND | PV_NO_DUPLICATE)) goto lossage; - if (!lex_match (lexer, T_EQUALS)) - { - msg (SE, _("`=' expected between lists of new and old variable names.")); - goto lossage; - } - if (!parse_DATA_LIST_vars (lexer, &rename_new_names, &prev_nv_1, + if (!lex_force_match (lexer, T_EQUALS)) + goto lossage; + if (!parse_DATA_LIST_vars (lexer, dataset_dict (ds), + &rename_new_names, &prev_nv_1, PV_APPEND | PV_NO_DUPLICATE)) goto lossage; if (prev_nv_1 != rename_cnt) @@ -82,11 +77,8 @@ cmd_rename_variables (struct lexer *lexer, struct dataset *ds) rename_new_names = NULL; goto lossage; } - if (!lex_match (lexer, T_RPAREN)) - { - msg (SE, _("`)' expected after variable names.")); - goto lossage; - } + if (!lex_force_match (lexer, T_RPAREN)) + goto lossage; } while (lex_token (lexer) != T_ENDCMD);