projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge 'master' into 'psppsheet'.
[pspp]
/
src
/
language
/
lexer
/
variable-parser.c
diff --git
a/src/language/lexer/variable-parser.c
b/src/language/lexer/variable-parser.c
index c1e1c28cdf404441cd701edd1ef62fdbaee2d6a8..8c4f8fe8a61acff13b83aee122c76ed2b4140e6c 100644
(file)
--- a/
src/language/lexer/variable-parser.c
+++ b/
src/language/lexer/variable-parser.c
@@
-1,5
+1,5
@@
/* PSPP - a program for statistical analysis.
/* PSPP - a program for statistical analysis.
- Copyright (C) 1997-9, 2000, 2009, 2010, 2011 Free Software Foundation, Inc.
+ Copyright (C) 1997-9, 2000, 2009, 2010, 2011
, 2012
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
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
@@
-30,6
+30,7
@@
#include "libpspp/assertion.h"
#include "libpspp/cast.h"
#include "libpspp/hash-functions.h"
#include "libpspp/assertion.h"
#include "libpspp/cast.h"
#include "libpspp/hash-functions.h"
+#include "libpspp/i18n.h"
#include "libpspp/hmapx.h"
#include "libpspp/message.h"
#include "libpspp/misc.h"
#include "libpspp/hmapx.h"
#include "libpspp/message.h"
#include "libpspp/misc.h"
@@
-819,9
+820,9
@@
array_var_set_lookup_var_idx (const struct var_set *vs, const char *name,
struct hmapx_node *node;
struct variable **varp;
struct hmapx_node *node;
struct variable **varp;
- HMAPX_FOR_EACH_WITH_HASH (varp, node, hash_case_string (name, 0),
+ HMAPX_FOR_EACH_WITH_HASH (varp, node,
utf8_
hash_case_string (name, 0),
&avs->vars_by_name)
&avs->vars_by_name)
- if (!strcasecmp (name, var_get_name (*varp)))
+ if (!
utf8_
strcasecmp (name, var_get_name (*varp)))
{
*idx = varp - avs->var;
return true;
{
*idx = varp - avs->var;
return true;
@@
-869,7
+870,7
@@
var_set_create_from_array (struct variable *const *var, size_t var_cnt)
return NULL;
}
hmapx_insert (&avs->vars_by_name, CONST_CAST (void *, &avs->var[i]),
return NULL;
}
hmapx_insert (&avs->vars_by_name, CONST_CAST (void *, &avs->var[i]),
- hash_case_string (name, 0));
+
utf8_
hash_case_string (name, 0));
}
return vs;
}
return vs;
@@
-893,8
+894,8
@@
lex_match_variable (struct lexer *lexer, const struct dictionary *dict, const st
}
/* An interaction is a variable followed by {*, BY} followed by an interaction */
}
/* An interaction is a variable followed by {*, BY} followed by an interaction */
-bool
-parse_
design_interaction (struct lexer *lexer, const struct dictionary *dict, struct interaction **iac
t)
+
static
bool
+parse_
internal_interaction (struct lexer *lexer, const struct dictionary *dict, struct interaction **iact, struct interaction **i
t)
{
const struct variable *v = NULL;
assert (iact);
{
const struct variable *v = NULL;
assert (iact);
@@
-915,7
+916,8
@@
parse_design_interaction (struct lexer *lexer, const struct dictionary *dict, st
if (! lex_match_variable (lexer, dict, &v))
{
if (! lex_match_variable (lexer, dict, &v))
{
- interaction_destroy (*iact);
+ if (it)
+ interaction_destroy (*it);
*iact = NULL;
return false;
}
*iact = NULL;
return false;
}
@@
-929,9
+931,15
@@
parse_design_interaction (struct lexer *lexer, const struct dictionary *dict, st
if ( lex_match (lexer, T_ASTERISK) || lex_match (lexer, T_BY))
{
if ( lex_match (lexer, T_ASTERISK) || lex_match (lexer, T_BY))
{
- return parse_
design_interaction (lexer, di
ct, iact);
+ return parse_
internal_interaction (lexer, dict, ia
ct, iact);
}
return true;
}
}
return true;
}
+bool
+parse_design_interaction (struct lexer *lexer, const struct dictionary *dict, struct interaction **iact)
+{
+ return parse_internal_interaction (lexer, dict, iact, NULL);
+}
+