/* PSPP - a program for statistical analysis.
- Copyright (C) 1997-9, 2000, 2009 Free Software Foundation, Inc.
+ Copyright (C) 1997-9, 2000, 2009, 2010 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
if (lvalue == NULL)
goto fail;
- if (!lex_force_match (lexer, '='))
+ if (!lex_force_match (lexer, T_EQUALS))
goto fail;
compute->rvalue = parse_rvalue (lexer, lvalue, ds);
if (compute->rvalue == NULL)
if (compute->test == NULL
|| expr_evaluate_num (compute->test, *c, case_num) == 1.0)
{
+ char *s;
+
*c = case_unshare (*c);
- expr_evaluate_str (compute->rvalue, *c, case_num,
- case_data_rw (*c, compute->variable)->s,
- compute->width);
+ s = CHAR_CAST_BUG (char *, case_str_rw (*c, compute->variable));
+ expr_evaluate_str (compute->rvalue, *c, case_num, s, compute->width);
}
return TRNS_CONTINUE;
vr = vector_get_var (compute->vector, rindx - 1);
*c = case_unshare (*c);
expr_evaluate_str (compute->rvalue, *c, case_num,
- case_data_rw (*c, vr)->s,
+ CHAR_CAST_BUG (char *, case_str_rw (*c, vr)),
var_get_width (vr));
}
goto fail;
/* Rvalue expression. */
- if (!lex_force_match (lexer, '='))
+ if (!lex_force_match (lexer, T_EQUALS))
goto fail;
compute->rvalue = parse_rvalue (lexer, lvalue, ds);
if (compute->rvalue == NULL)
if (!lex_force_id (lexer))
goto lossage;
- if (lex_look_ahead (lexer) == '(')
+ if (lex_look_ahead (lexer) == T_LPAREN)
{
/* Vector. */
- lvalue->vector = dict_lookup_vector (dict, lex_tokid (lexer));
+ lvalue->vector = dict_lookup_vector (dict, lex_tokcstr (lexer));
if (lvalue->vector == NULL)
{
- msg (SE, _("There is no vector named %s."), lex_tokid (lexer));
+ msg (SE, _("There is no vector named %s."), lex_tokcstr (lexer));
goto lossage;
}
/* Vector element. */
lex_get (lexer);
- if (!lex_force_match (lexer, '('))
+ if (!lex_force_match (lexer, T_LPAREN))
goto lossage;
lvalue->element = expr_parse (lexer, ds, EXPR_NUMBER);
if (lvalue->element == NULL)
goto lossage;
- if (!lex_force_match (lexer, ')'))
+ if (!lex_force_match (lexer, T_RPAREN))
goto lossage;
}
else
{
/* Variable name. */
- const char *var_name = lex_tokid (lexer);
+ const char *var_name = lex_tokcstr (lexer);
lvalue->variable = dict_lookup_var (dict, var_name);
if (lvalue->variable == NULL)
{