projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
NPAR TESTS: Fix two test failures.
[pspp]
/
src
/
language
/
dictionary
/
mrsets.c
diff --git
a/src/language/dictionary/mrsets.c
b/src/language/dictionary/mrsets.c
index 96f1a110f5a5066be42ca24d08b5a48f4761cc3d..c775f49784eab659d715cc0bb2408a7c20ad21aa 100644
(file)
--- a/
src/language/dictionary/mrsets.c
+++ b/
src/language/dictionary/mrsets.c
@@
-47,7
+47,7
@@
cmd_mrsets (struct lexer *lexer, struct dataset *ds)
{
struct dictionary *dict = dataset_dict (ds);
{
struct dictionary *dict = dataset_dict (ds);
- while (lex_match (lexer,
'/'
))
+ while (lex_match (lexer,
T_SLASH
))
{
bool ok;
{
bool ok;
@@
-87,27
+87,27
@@
parse_group (struct lexer *lexer, struct dictionary *dict,
labelsource_varlabel = false;
has_value = false;
labelsource_varlabel = false;
has_value = false;
- while (lex_token (lexer) !=
'/' && lex_token (lexer) != '.'
)
+ while (lex_token (lexer) !=
T_SLASH && lex_token (lexer) != T_ENDCMD
)
{
if (lex_match_id (lexer, "NAME"))
{
{
if (lex_match_id (lexer, "NAME"))
{
- if (!lex_force_match (lexer,
'='
) || !lex_force_id (lexer))
+ if (!lex_force_match (lexer,
T_EQUALS
) || !lex_force_id (lexer))
goto error;
goto error;
- if (lex_tok
id
(lexer)[0] != '$')
+ if (lex_tok
cstr
(lexer)[0] != '$')
{
msg (SE, _("%s is not a valid name for a multiple response "
"set. Multiple response set names must begin with "
{
msg (SE, _("%s is not a valid name for a multiple response "
"set. Multiple response set names must begin with "
- "`$'."), lex_tok
id
(lexer));
+ "`$'."), lex_tok
cstr
(lexer));
goto error;
}
free (mrset->name);
goto error;
}
free (mrset->name);
- mrset->name = xstrdup (lex_tok
id
(lexer));
+ mrset->name = xstrdup (lex_tok
cstr
(lexer));
lex_get (lexer);
}
else if (lex_match_id (lexer, "VARIABLES"))
{
lex_get (lexer);
}
else if (lex_match_id (lexer, "VARIABLES"))
{
- if (!lex_force_match (lexer,
'='
))
+ if (!lex_force_match (lexer,
T_EQUALS
))
goto error;
free (mrset->vars);
goto error;
free (mrset->vars);
@@
-125,16
+125,16
@@
parse_group (struct lexer *lexer, struct dictionary *dict,
}
else if (lex_match_id (lexer, "LABEL"))
{
}
else if (lex_match_id (lexer, "LABEL"))
{
- if (!lex_force_match (lexer,
'='
) || !lex_force_string (lexer))
+ if (!lex_force_match (lexer,
T_EQUALS
) || !lex_force_string (lexer))
goto error;
free (mrset->label);
goto error;
free (mrset->label);
- mrset->label =
ds_xstrdup (lex_tokstr
(lexer));
+ mrset->label =
ss_xstrdup (lex_tokss
(lexer));
lex_get (lexer);
}
else if (type == MRSET_MD && lex_match_id (lexer, "LABELSOURCE"))
{
lex_get (lexer);
}
else if (type == MRSET_MD && lex_match_id (lexer, "LABELSOURCE"))
{
- if (!lex_force_match (lexer,
'='
)
+ if (!lex_force_match (lexer,
T_EQUALS
)
|| !lex_force_match_id (lexer, "VARLABEL"))
goto error;
|| !lex_force_match_id (lexer, "VARLABEL"))
goto error;
@@
-142,7
+142,7
@@
parse_group (struct lexer *lexer, struct dictionary *dict,
}
else if (type == MRSET_MD && lex_match_id (lexer, "VALUE"))
{
}
else if (type == MRSET_MD && lex_match_id (lexer, "VALUE"))
{
- if (!lex_force_match (lexer,
'='
))
+ if (!lex_force_match (lexer,
T_EQUALS
))
goto error;
has_value = true;
goto error;
has_value = true;
@@
-159,7
+159,7
@@
parse_group (struct lexer *lexer, struct dictionary *dict,
}
else if (lex_is_string (lexer))
{
}
else if (lex_is_string (lexer))
{
- const char *s =
ds_cstr (lex_tokstr (lexer)
);
+ const char *s =
lex_tokcstr (lexer
);
int width;
/* Trim off trailing spaces, but don't trim the string until
int width;
/* Trim off trailing spaces, but don't trim the string until
@@
-182,7
+182,7
@@
parse_group (struct lexer *lexer, struct dictionary *dict,
}
else if (type == MRSET_MD && lex_match_id (lexer, "CATEGORYLABELS"))
{
}
else if (type == MRSET_MD && lex_match_id (lexer, "CATEGORYLABELS"))
{
- if (!lex_force_match (lexer,
'='
))
+ if (!lex_force_match (lexer,
T_EQUALS
))
goto error;
if (lex_match_id (lexer, "VARLABELS"))
goto error;
if (lex_match_id (lexer, "VARLABELS"))
@@
-469,24
+469,25
@@
static bool
parse_mrset_names (struct lexer *lexer, struct dictionary *dict,
struct stringi_set *mrset_names)
{
parse_mrset_names (struct lexer *lexer, struct dictionary *dict,
struct stringi_set *mrset_names)
{
- if (!lex_force_match_id (lexer, "NAME") || !lex_force_match (lexer, '='))
+ if (!lex_force_match_id (lexer, "NAME")
+ || !lex_force_match (lexer, T_EQUALS))
return false;
stringi_set_init (mrset_names);
return false;
stringi_set_init (mrset_names);
- if (lex_match (lexer,
'['
))
+ if (lex_match (lexer,
T_LBRACK
))
{
{
- while (!lex_match (lexer,
']'
))
+ while (!lex_match (lexer,
T_RBRACK
))
{
if (!lex_force_id (lexer))
return false;
{
if (!lex_force_id (lexer))
return false;
- if (dict_lookup_mrset (dict, lex_tok
id
(lexer)) == NULL)
+ if (dict_lookup_mrset (dict, lex_tok
cstr
(lexer)) == NULL)
{
msg (SE, _("No multiple response set named %s."),
{
msg (SE, _("No multiple response set named %s."),
- lex_tok
id
(lexer));
+ lex_tok
cstr
(lexer));
stringi_set_destroy (mrset_names);
return false;
}
stringi_set_destroy (mrset_names);
return false;
}
- stringi_set_insert (mrset_names, lex_tok
id
(lexer));
+ stringi_set_insert (mrset_names, lex_tok
cstr
(lexer));
lex_get (lexer);
}
}
lex_get (lexer);
}
}