projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Correct name of function fn_is_special. Thanks to John McCabe-Dansted
[pspp]
/
src
/
language
/
dictionary
/
rename-variables.c
diff --git
a/src/language/dictionary/rename-variables.c
b/src/language/dictionary/rename-variables.c
index 9ba6630281877fd779f8f43898bed72da42f399f..1d7d7f521bbf4ff229aabedaf2917fb0234c478b 100644
(file)
--- a/
src/language/dictionary/rename-variables.c
+++ b/
src/language/dictionary/rename-variables.c
@@
-1,6
+1,5
@@
/* PSPP - computes sample statistics.
Copyright (C) 1997-9, 2000 Free Software Foundation, Inc.
/* PSPP - computes sample statistics.
Copyright (C) 1997-9, 2000 Free Software Foundation, Inc.
- Written by Ben Pfaff <blp@gnu.org>.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
@@
-18,16
+17,19
@@
02110-1301, USA. */
#include <config.h>
02110-1301, USA. */
#include <config.h>
+
#include <stdlib.h>
#include <stdlib.h>
-#include <libpspp/message.h>
-#include <libpspp/alloc.h>
-#include <language/command.h>
+
#include <data/dictionary.h>
#include <data/dictionary.h>
-#include <libpspp/message.h>
-#include <libpspp/hash.h>
+#include <data/procedure.h>
+#include <data/variable.h>
+#include <language/command.h>
#include <language/lexer/lexer.h>
#include <language/lexer/lexer.h>
+#include <language/lexer/variable-parser.h>
+#include <libpspp/alloc.h>
+#include <libpspp/hash.h>
+#include <libpspp/message.h>
#include <libpspp/str.h>
#include <libpspp/str.h>
-#include <data/variable.h>
#include "gettext.h"
#define _(msgid) gettext (msgid)
#include "gettext.h"
#define _(msgid) gettext (msgid)
@@
-35,7
+37,7
@@
/* The code for this function is very similar to the code for the
RENAME subcommand of MODIFY VARS. */
int
/* The code for this function is very similar to the code for the
RENAME subcommand of MODIFY VARS. */
int
-cmd_rename_variables (
void
)
+cmd_rename_variables (
struct lexer *lexer, struct dataset *ds
)
{
struct variable **rename_vars = NULL;
char **rename_new_names = NULL;
{
struct variable **rename_vars = NULL;
char **rename_new_names = NULL;
@@
-44,32
+46,29
@@
cmd_rename_variables (void)
int status = CMD_CASCADING_FAILURE;
int status = CMD_CASCADING_FAILURE;
- if (temporary != 0)
- {
- msg (SE, _("RENAME VARS may not be used after TEMPORARY. "
- "Temporary transformations will be made permanent."));
- cancel_temporary ();
- }
+ if (proc_make_temporary_transformations_permanent (ds))
+ msg (SE, _("RENAME VARS may not be used after TEMPORARY. "
+ "Temporary transformations will be made permanent."));
do
{
size_t prev_nv_1 = rename_cnt;
size_t prev_nv_2 = rename_cnt;
do
{
size_t prev_nv_1 = rename_cnt;
size_t prev_nv_2 = rename_cnt;
- if (!lex_match ('('))
+ if (!lex_match (
lexer,
'('))
{
msg (SE, _("`(' expected."));
goto lossage;
}
{
msg (SE, _("`(' expected."));
goto lossage;
}
- if (!parse_variables (
default_dict
, &rename_vars, &rename_cnt,
+ if (!parse_variables (
lexer, dataset_dict (ds)
, &rename_vars, &rename_cnt,
PV_APPEND | PV_NO_DUPLICATE))
goto lossage;
PV_APPEND | PV_NO_DUPLICATE))
goto lossage;
- if (!lex_match ('='))
+ if (!lex_match (
lexer,
'='))
{
msg (SE, _("`=' expected between lists of new and old variable names."));
goto lossage;
}
{
msg (SE, _("`=' expected between lists of new and old variable names."));
goto lossage;
}
- if (!parse_DATA_LIST_vars (&rename_new_names, &prev_nv_1, PV_APPEND))
+ if (!parse_DATA_LIST_vars (
lexer,
&rename_new_names, &prev_nv_1, PV_APPEND))
goto lossage;
if (prev_nv_1 != rename_cnt)
{
goto lossage;
if (prev_nv_1 != rename_cnt)
{
@@
-85,15
+84,15
@@
cmd_rename_variables (void)
rename_new_names = NULL;
goto lossage;
}
rename_new_names = NULL;
goto lossage;
}
- if (!lex_match (')'))
+ if (!lex_match (
lexer,
')'))
{
msg (SE, _("`)' expected after variable names."));
goto lossage;
}
}
{
msg (SE, _("`)' expected after variable names."));
goto lossage;
}
}
- while (
token
!= '.');
+ while (
lex_token (lexer)
!= '.');
- if (!dict_rename_vars (d
efault_dict
,
+ if (!dict_rename_vars (d
ataset_dict (ds)
,
rename_vars, rename_new_names, rename_cnt,
&err_name))
{
rename_vars, rename_new_names, rename_cnt,
&err_name))
{