Oneway: Use lex_get_num instead of lex_parse_value.
authorJohn Darrington <john@darrington.wattle.id.au>
Thu, 12 Aug 2010 16:13:26 +0000 (18:13 +0200)
committerJohn Darrington <john@darrington.wattle.id.au>
Tue, 24 Aug 2010 14:37:14 +0000 (16:37 +0200)
Contrast coefficients can only be numeric, so parse_value
is an unnecessary generalisation.

src/language/stats/oneway.c

index 968e3e096119947fb41704fbb7082c481c39e0b1..ce4f016d99063acabf0dd71abab6d36245229aa3 100644 (file)
@@ -181,13 +181,13 @@ cmd_oneway (struct lexer *lexer, struct dataset *ds)
 
           while (lex_token (lexer) != '.' && lex_token (lexer) != '/')
            {
-             union value val;
-             if ( parse_value (lexer, &val, 0))
+             if ( lex_is_number (lexer))
                {
                  struct coeff_node *cc = xmalloc (sizeof *cc);
-                 cc->coeff = val.f;
+                 cc->coeff = lex_number (lexer);
 
                  ll_push_tail (coefficient_list, &cc->ll);
+                 lex_get (lexer);
                }
              else
                {
@@ -928,8 +928,7 @@ show_contrast_coeffs (const struct oneway_spec *cmd, struct oneway_workspace *ws
          group_value.f = *group_value_p;
          var_append_value_name (cmd->indep_var, &group_value, &vstr);
 
-         tab_text (t, count + 2, 1, TAB_CENTER | TAT_TITLE,
-                   ds_cstr (&vstr));
+         tab_text (t, count + 2, 1, TAB_CENTER | TAT_TITLE, ds_cstr (&vstr));
 
          ds_destroy (&vstr);