X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flanguage%2Fdictionary%2Frename-variables.c;h=437450451075797d0dc022ef808231c726243691;hb=81579d9e9f994fb2908f50af41c3eb033d216e58;hp=c175831d8dacb6c3d448ac2821a9d7362725e1b5;hpb=f550aee00a62fe1d8baf62d83cd7efef6cc2ee92;p=pspp-builds.git diff --git a/src/language/dictionary/rename-variables.c b/src/language/dictionary/rename-variables.c index c175831d..43745045 100644 --- a/src/language/dictionary/rename-variables.c +++ b/src/language/dictionary/rename-variables.c @@ -1,5 +1,5 @@ /* PSPP - a program for statistical analysis. - Copyright (C) 1997-9, 2000, 2010 Free Software Foundation, Inc. + Copyright (C) 1997-9, 2000, 2010, 2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -18,17 +18,16 @@ #include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "data/dictionary.h" +#include "data/procedure.h" +#include "data/variable.h" +#include "language/command.h" +#include "language/lexer/lexer.h" +#include "language/lexer/variable-parser.h" +#include "libpspp/message.h" +#include "libpspp/str.h" -#include "xalloc.h" +#include "gl/xalloc.h" #include "gettext.h" #define _(msgid) gettext (msgid) @@ -54,7 +53,7 @@ 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, '(')) + if (!lex_match (lexer, T_LPAREN)) { msg (SE, _("`(' expected.")); goto lossage; @@ -62,7 +61,7 @@ cmd_rename_variables (struct lexer *lexer, struct dataset *ds) if (!parse_variables (lexer, dataset_dict (ds), &rename_vars, &rename_cnt, PV_APPEND | PV_NO_DUPLICATE)) goto lossage; - if (!lex_match (lexer, '=')) + if (!lex_match (lexer, T_EQUALS)) { msg (SE, _("`=' expected between lists of new and old variable names.")); goto lossage; @@ -83,13 +82,13 @@ cmd_rename_variables (struct lexer *lexer, struct dataset *ds) rename_new_names = NULL; goto lossage; } - if (!lex_match (lexer, ')')) + if (!lex_match (lexer, T_RPAREN)) { msg (SE, _("`)' expected after variable names.")); goto lossage; } } - while (lex_token (lexer) != '.'); + while (lex_token (lexer) != T_ENDCMD); if (!dict_rename_vars (dataset_dict (ds), rename_vars, rename_new_names, rename_cnt,