X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=src%2Flanguage%2Fdata-io%2Ftrim.c;h=9f76b10516b1b8d88dc2eba668b919020c784d58;hb=848c950e47bf9912c91edf9aae9b3b6be21a2c01;hp=5817fd02ccb4db835416fd8182b2d469219375a5;hpb=173d1687aea88e0e5e1b1d8615ed68ebefb15d08;p=pspp diff --git a/src/language/data-io/trim.c b/src/language/data-io/trim.c index 5817fd02cc..9f76b10516 100644 --- a/src/language/data-io/trim.c +++ b/src/language/data-io/trim.c @@ -72,29 +72,29 @@ 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) + if (dict_lookup_var (dict, lex_tokcstr (lexer)) != NULL) { 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)'."), - var_get_name (v), lex_tokid (lexer), lex_tokid (lexer)); + var_get_name (v), lex_tokcstr (lexer), lex_tokcstr (lexer)); return 0; } - dict_rename_var (dict, v, lex_tokid (lexer)); + dict_rename_var (dict, v, lex_tokcstr (lexer)); lex_get (lexer); return 1; } @@ -103,13 +103,13 @@ 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; @@ -125,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++; } @@ -155,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); @@ -179,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;