X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flanguage%2Fdictionary%2Fmodify-variables.c;h=e23d6a418dea7c34ae61d08532d681fc94aada67;hb=0499030ee8e638a481e6cb8d91646b7a88292da7;hp=e022586dac71102ef4244505264f8c88eeba8a17;hpb=339f1956cc727eda788638644ef93ab7852b31cd;p=pspp diff --git a/src/language/dictionary/modify-variables.c b/src/language/dictionary/modify-variables.c index e022586dac..e23d6a418d 100644 --- a/src/language/dictionary/modify-variables.c +++ b/src/language/dictionary/modify-variables.c @@ -76,9 +76,10 @@ int cmd_modify_vars (struct lexer *lexer, struct dataset *ds) { if (proc_make_temporary_transformations_permanent (ds)) - msg (SE, _("%s may not be used after %s. " - "Temporary transformations will be made permanent."), - "MODIFY VARS", "TEMPORARY"); + lex_ofs_error (lexer, 0, lex_ofs (lexer) - 1, + _("%s may not be used after %s. " + "Temporary transformations will be made permanent."), + "MODIFY VARS", "TEMPORARY"); /* Bits indicated whether we've already encountered a subcommand of this type. */ @@ -107,7 +108,7 @@ cmd_modify_vars (struct lexer *lexer, struct dataset *ds) { if (already_encountered & 1) { - lex_sbc_only_once ("REORDER"); + lex_sbc_only_once (lexer, "REORDER"); goto done; } already_encountered |= 1; @@ -187,7 +188,7 @@ cmd_modify_vars (struct lexer *lexer, struct dataset *ds) { if (already_encountered & 2) { - lex_sbc_only_once ("RENAME"); + lex_sbc_only_once (lexer, "RENAME"); goto done; } already_encountered |= 2; @@ -240,10 +241,11 @@ cmd_modify_vars (struct lexer *lexer, struct dataset *ds) { if (already_encountered & 4) { - msg (SE, - _("%s subcommand may be given at most once. It may " - "not be given in conjunction with the %s subcommand."), - "KEEP", "DROP"); + lex_next_error (lexer, -1, -1, + _("%s subcommand may be given at most once. " + "It may not be given in conjunction with the " + "%s subcommand."), + "KEEP", "DROP"); goto done; } already_encountered |= 4; @@ -291,27 +293,31 @@ cmd_modify_vars (struct lexer *lexer, struct dataset *ds) if (already_encountered & 4) { - msg (SE, _("%s subcommand may be given at most once. It may " - "not be given in conjunction with the %s " - "subcommand."), + lex_next_error (lexer, -1, -1, + _("%s subcommand may be given at most once. " + "It may not be given in conjunction with the " + "%s subcommand."), "DROP", "KEEP" ); goto done; } already_encountered |= 4; + int start_ofs = lex_ofs (lexer) - 1; lex_match (lexer, T_EQUALS); if (!parse_variables (lexer, dataset_dict (ds), &drop_vars, &n_drop, PV_NONE)) goto done; + int end_ofs = lex_ofs (lexer) - 1; vm.drop_vars = drop_vars; vm.n_drop = n_drop; if (n_drop == dict_get_n_vars (dataset_dict (ds))) { - msg (SE, _("%s may not be used to delete all variables " - "from the active dataset dictionary. " - "Use %s instead."), "MODIFY VARS", "NEW FILE"); + lex_ofs_error (lexer, start_ofs, end_ofs, + _("%s may not be used to delete all variables " + "from the active dataset dictionary. " + "Use %s instead."), "MODIFY VARS", "NEW FILE"); goto done; } } @@ -327,11 +333,8 @@ cmd_modify_vars (struct lexer *lexer, struct dataset *ds) } else { - if (lex_token (lexer) == T_ID) - msg (SE, _("Unrecognized subcommand name `%s'."), - lex_tokcstr (lexer)); - else - msg (SE, _("Subcommand name expected.")); + lex_error_expecting (lexer, "REORDER", "RENAME", "KEEP", + "DROP", "MAP"); goto done; }