X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flanguage%2Fdata-io%2Ftrim.c;h=be637c403365be64ff788d3df6ae6fcc4b4ac698;hb=691c25e36fd1ee722dd35419d6110e3876b99f9c;hp=7a14c996b8c6ea7cd1cc90ab0ec2399477a9b4da;hpb=b5c82cc9aabe7e641011130240ae1b2e84348e23;p=pspp-builds.git diff --git a/src/language/data-io/trim.c b/src/language/data-io/trim.c index 7a14c996..be637c40 100644 --- a/src/language/data-io/trim.c +++ b/src/language/data-io/trim.c @@ -1,5 +1,5 @@ /* PSPP - a program for statistical analysis. - Copyright (C) 1997-9, 2000, 2006, 2007, 2008 Free Software Foundation, Inc. + Copyright (C) 1997-9, 2000, 2006, 2007, 2008, 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 @@ -72,15 +72,15 @@ parse_dict_rename (struct lexer *lexer, struct dictionary *dict) int group; - lex_match (lexer, '='); - if (lex_token (lexer) != '(') + lex_match (lexer, T_EQUALS); + if (lex_token (lexer) != T_LPAREN) { struct variable *v; v = parse_variable (lexer, dict); if (v == NULL) return 0; - if (!lex_force_match (lexer, '=') + if (!lex_force_match (lexer, T_EQUALS) || !lex_force_id (lexer)) return 0; if (dict_lookup_var (dict, lex_tokid (lexer)) != NULL) @@ -88,8 +88,8 @@ parse_dict_rename (struct lexer *lexer, struct dictionary *dict) msg (SE, _("Cannot rename %s as %s because there already exists " "a variable named %s. To rename variables with " "overlapping names, use a single RENAME subcommand " - "such as \"/RENAME (A=B)(B=C)(C=A)\", or equivalently, " - "\"/RENAME (A B C=B C A)\"."), + "such as `/RENAME (A=B)(B=C)(C=A)', or equivalently, " + "`/RENAME (A B C=B C A)'."), var_get_name (v), lex_tokid (lexer), lex_tokid (lexer)); return 0; } @@ -103,18 +103,19 @@ parse_dict_rename (struct lexer *lexer, struct dictionary *dict) v = NULL; new_names = 0; group = 1; - while (lex_match (lexer, '(')) + while (lex_match (lexer, T_LPAREN)) { size_t old_nv = nv; if (!parse_variables (lexer, dict, &v, &nv, PV_NO_DUPLICATE | PV_APPEND)) goto done; - if (!lex_match (lexer, '=')) + if (!lex_match (lexer, T_EQUALS)) { msg (SE, _("`=' expected after variable list.")); goto done; } - if (!parse_DATA_LIST_vars (lexer, &new_names, &nn, PV_APPEND | PV_NO_SCRATCH)) + if (!parse_DATA_LIST_vars (lexer, &new_names, &nn, + PV_APPEND | PV_NO_SCRATCH | PV_NO_DUPLICATE)) goto done; if (nn != nv) { @@ -124,7 +125,7 @@ parse_dict_rename (struct lexer *lexer, struct dictionary *dict) nv - old_nv, nn - old_nv, group); goto done; } - if (!lex_force_match (lexer, ')')) + if (!lex_force_match (lexer, T_RPAREN)) goto done; group++; } @@ -154,7 +155,7 @@ parse_dict_drop (struct lexer *lexer, struct dictionary *dict) struct variable **v; size_t nv; - lex_match (lexer, '='); + lex_match (lexer, T_EQUALS); if (!parse_variables (lexer, dict, &v, &nv, PV_NONE)) return false; dict_delete_vars (dict, v, nv); @@ -178,7 +179,7 @@ parse_dict_keep (struct lexer *lexer, struct dictionary *dict) size_t nv; size_t i; - lex_match (lexer, '='); + lex_match (lexer, T_EQUALS); if (!parse_variables (lexer, dict, &v, &nv, PV_NONE)) return false;