projects
/
pspp-builds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
po: Update Dutch translation from translation-project.org.
[pspp-builds.git]
/
src
/
language
/
lexer
/
variable-parser.c
diff --git
a/src/language/lexer/variable-parser.c
b/src/language/lexer/variable-parser.c
index 84cf972563545becd34344a8b1b64a787c89ce0e..49d6a5deb900a6e63e8363b1fd020c685116f16c 100644
(file)
--- a/
src/language/lexer/variable-parser.c
+++ b/
src/language/lexer/variable-parser.c
@@
-23,8
+23,8
@@
#include <stdbool.h>
#include <stdlib.h>
#include <stdbool.h>
#include <stdlib.h>
+#include "data/dataset.h"
#include "data/dictionary.h"
#include "data/dictionary.h"
-#include "data/procedure.h"
#include "data/variable.h"
#include "language/lexer/lexer.h"
#include "libpspp/assertion.h"
#include "data/variable.h"
#include "language/lexer/lexer.h"
#include "libpspp/assertion.h"
@@
-415,8
+415,8
@@
add_var_name (char *name,
/* Parses a list of variable names according to the DATA LIST version
of the TO convention. */
bool
/* Parses a list of variable names according to the DATA LIST version
of the TO convention. */
bool
-parse_DATA_LIST_vars (struct lexer *lexer, c
har ***namesp
,
- size_t *n_varsp, int pv_opts)
+parse_DATA_LIST_vars (struct lexer *lexer, c
onst struct dictionary *dict
,
+
char ***namesp,
size_t *n_varsp, int pv_opts)
{
char **names;
size_t n_vars;
{
char **names;
size_t n_vars;
@@
-453,7
+453,8
@@
parse_DATA_LIST_vars (struct lexer *lexer, char ***namesp,
do
{
do
{
- if (lex_token (lexer) != T_ID)
+ if (lex_token (lexer) != T_ID
+ || !dict_id_is_valid (dict, lex_tokcstr (lexer), true))
{
lex_error (lexer, "expecting variable name");
goto exit;
{
lex_error (lexer, "expecting variable name");
goto exit;
@@
-474,7
+475,8
@@
parse_DATA_LIST_vars (struct lexer *lexer, char ***namesp,
unsigned long int number;
lex_get (lexer);
unsigned long int number;
lex_get (lexer);
- if (lex_token (lexer) != T_ID)
+ if (lex_token (lexer) != T_ID
+ || !dict_id_is_valid (dict, lex_tokcstr (lexer), true))
{
lex_error (lexer, "expecting variable name");
goto exit;
{
lex_error (lexer, "expecting variable name");
goto exit;
@@
-574,7
+576,8
@@
register_vars_pool (struct pool *pool, char **names, size_t nnames)
parse_DATA_LIST_vars(), except that all allocations are taken
from the given POOL. */
bool
parse_DATA_LIST_vars(), except that all allocations are taken
from the given POOL. */
bool
-parse_DATA_LIST_vars_pool (struct lexer *lexer, struct pool *pool,
+parse_DATA_LIST_vars_pool (struct lexer *lexer, const struct dictionary *dict,
+ struct pool *pool,
char ***names, size_t *nnames, int pv_opts)
{
int retval;
char ***names, size_t *nnames, int pv_opts)
{
int retval;
@@
-585,7
+588,7
@@
parse_DATA_LIST_vars_pool (struct lexer *lexer, struct pool *pool,
re-free it later. */
assert (!(pv_opts & PV_APPEND));
re-free it later. */
assert (!(pv_opts & PV_APPEND));
- retval = parse_DATA_LIST_vars (lexer, names, nnames, pv_opts);
+ retval = parse_DATA_LIST_vars (lexer,
dict,
names, nnames, pv_opts);
if (retval)
register_vars_pool (pool, *names, *nnames);
return retval;
if (retval)
register_vars_pool (pool, *names, *nnames);
return retval;
@@
-624,7
+627,7
@@
parse_mixed_vars (struct lexer *lexer, const struct dictionary *dict,
free (v);
*nnames += nv;
}
free (v);
*nnames += nv;
}
- else if (!parse_DATA_LIST_vars (lexer, names, nnames, PV_APPEND))
+ else if (!parse_DATA_LIST_vars (lexer,
dict,
names, nnames, PV_APPEND))
goto fail;
}
return 1;
goto fail;
}
return 1;