X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flanguage%2Fstats%2Fregression.q;h=1b35970366b0a1bd449b40d66913e20f03bb0bcc;hb=3816248a008a4af75aac6319d0c9929cb7ff679e;hp=cbb1031d1b6c7d0dfa634a5335ed792322cf996b;hpb=e070d7ddf78446b9852c61c9af84ad3659bac3b3;p=pspp diff --git a/src/language/stats/regression.q b/src/language/stats/regression.q index cbb1031d1b..1b35970366 100644 --- a/src/language/stats/regression.q +++ b/src/language/stats/regression.q @@ -916,31 +916,31 @@ subcommand_export (int export, pspp_linreg_cache * c) } static int -regression_custom_export (struct dataset *ds UNUSED, struct cmd_regression *cmd UNUSED, void *aux UNUSED) +regression_custom_export (struct lexer *lexer, struct dataset *ds UNUSED, struct cmd_regression *cmd UNUSED, void *aux UNUSED) { /* 0 on failure, 1 on success, 2 on failure that should result in syntax error */ - if (!lex_force_match ('(')) + if (!lex_force_match (lexer, '(')) return 0; - if (lex_match ('*')) + if (lex_match (lexer, '*')) model_file = NULL; else { - model_file = fh_parse (FH_REF_FILE); + model_file = fh_parse (lexer, FH_REF_FILE); if (model_file == NULL) return 0; } - if (!lex_force_match (')')) + if (!lex_force_match (lexer, ')')) return 0; return 1; } int -cmd_regression (struct dataset *ds) +cmd_regression (struct lexer *lexer, struct dataset *ds) { - if (!parse_regression (ds, &cmd, NULL)) + if (!parse_regression (lexer, ds, &cmd, NULL)) return CMD_FAILURE; models = xnmalloc (cmd.n_dependent, sizeof *models); @@ -980,7 +980,7 @@ mark_missing_cases (const struct casefile *cf, struct variable *v, size_t row; const union value *val; - for (r = casefile_get_reader (cf); + for (r = casefile_get_reader (cf, NULL); casereader_read (r, &c); case_destroy (&c)) { row = casereader_cnum (r) - 1; @@ -1004,20 +1004,20 @@ mark_missing_cases (const struct casefile *cf, struct variable *v, /* Parser for the variables sub command */ static int -regression_custom_variables (struct dataset *ds, +regression_custom_variables (struct lexer *lexer, struct dataset *ds, struct cmd_regression *cmd UNUSED, void *aux UNUSED) { const struct dictionary *dict = dataset_dict (ds); - lex_match ('='); + lex_match (lexer, '='); - if ((token != T_ID || dict_lookup_var (dict, tokid) == NULL) - && token != T_ALL) + if ((lex_token (lexer) != T_ID || dict_lookup_var (dict, lex_tokid (lexer)) == NULL) + && lex_token (lexer) != T_ALL) return 2; - if (!parse_variables (dict, &v_variables, &n_variables, PV_NONE)) + if (!parse_variables (lexer, dict, &v_variables, &n_variables, PV_NONE)) { free (v_variables); return 0; @@ -1186,7 +1186,7 @@ run_regression (const struct ccase *first, The second pass fills the design matrix. */ row = 0; - for (r = casefile_get_reader (cf); casereader_read (r, &c); + for (r = casefile_get_reader (cf, NULL); casereader_read (r, &c); case_destroy (&c)) /* Iterate over the cases. */ {