X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flanguage%2Fstats%2Frank.q;h=f53ef2d01475a8c76040615898449e51f554f301;hb=136f39b107e427c984fa0d74dc11d1b4bc04e898;hp=ec3052c0acee616def219464aa7bf19edfec4550;hpb=d0b91eae59319ab2756d0d43b9cb15eb9cd3c234;p=pspp diff --git a/src/language/stats/rank.q b/src/language/stats/rank.q index ec3052c0ac..f53ef2d014 100644 --- a/src/language/stats/rank.q +++ b/src/language/stats/rank.q @@ -1,5 +1,5 @@ /* PSPP - a program for statistical analysis. - Copyright (C) 2005, 2006, 2007, 2009 Free Software Foundation, Inc. + Copyright (C) 2005, 2006, 2007, 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 @@ -796,9 +796,9 @@ cmd_rank (struct lexer *lexer, struct dataset *ds) static int rank_custom_variables (struct lexer *lexer, struct dataset *ds, struct cmd_rank *cmd UNUSED, void *aux UNUSED) { - lex_match (lexer, '='); + lex_match (lexer, T_EQUALS); - if ((lex_token (lexer) != T_ID || dict_lookup_var (dataset_dict (ds), lex_tokid (lexer)) == NULL) + if ((lex_token (lexer) != T_ID || dict_lookup_var (dataset_dict (ds), lex_tokcstr (lexer)) == NULL) && lex_token (lexer) != T_ALL) return 2; @@ -808,7 +808,7 @@ rank_custom_variables (struct lexer *lexer, struct dataset *ds, struct cmd_rank if ( lex_match (lexer, T_BY) ) { - if ((lex_token (lexer) != T_ID || dict_lookup_var (dataset_dict (ds), lex_tokid (lexer)) == NULL)) + if ((lex_token (lexer) != T_ID || dict_lookup_var (dataset_dict (ds), lex_tokcstr (lexer)) == NULL)) { return 2; } @@ -847,9 +847,9 @@ parse_rank_function (struct lexer *lexer, struct dictionary *dict, struct cmd_ra while( lex_token (lexer) == T_ID ) { - if ( dict_lookup_var (dict, lex_tokid (lexer)) != NULL ) + if ( dict_lookup_var (dict, lex_tokcstr (lexer)) != NULL ) { - msg(SE, _("Variable %s already exists."), lex_tokid (lexer)); + msg(SE, _("Variable %s already exists."), lex_tokcstr (lexer)); return 0; } if ( var_count >= subcase_get_n_fields (&sc) ) @@ -858,7 +858,7 @@ parse_rank_function (struct lexer *lexer, struct dictionary *dict, struct cmd_ra return 0; } - destvar = create_rank_variable (dict, f, src_vars[var_count], lex_tokid (lexer)); + destvar = create_rank_variable (dict, f, src_vars[var_count], lex_tokcstr (lexer)); rank_specs[n_rank_specs - 1].destvars[var_count] = destvar ; lex_get (lexer); @@ -932,13 +932,13 @@ rank_custom_ntiles (struct lexer *lexer, struct dataset *ds, struct cmd_rank *cm { struct dictionary *dict = dataset_dict (ds); - if ( lex_force_match (lexer, '(') ) + if ( lex_force_match (lexer, T_LPAREN) ) { if ( lex_force_int (lexer) ) { k_ntiles = lex_integer (lexer); lex_get (lexer); - lex_force_match (lexer, ')'); + lex_force_match (lexer, T_RPAREN); } else return 0;