+static int
+npar_runs (struct lexer *lexer, struct dataset *ds,
+ struct npar_specs *specs)
+{
+ struct runs_test *rt = pool_alloc (specs->pool, sizeof (*rt));
+ struct one_sample_test *tp = &rt->parent;
+ struct npar_test *nt = &tp->parent;
+
+ nt->execute = runs_execute;
+ nt->insert_variables = one_sample_insert_variables;
+
+ if ( lex_force_match (lexer, '(') )
+ {
+ if ( lex_match_id (lexer, "MEAN"))
+ {
+ rt->cp_mode = CP_MEAN;
+ }
+ else if (lex_match_id (lexer, "MEDIAN"))
+ {
+ rt->cp_mode = CP_MEDIAN;
+ }
+ else if (lex_match_id (lexer, "MODE"))
+ {
+ rt->cp_mode = CP_MODE;
+ }
+ else if (lex_is_number (lexer))
+ {
+ rt->cutpoint = lex_number (lexer);
+ rt->cp_mode = CP_CUSTOM;
+ lex_get (lexer);
+ }
+ else
+ {
+ lex_error (lexer, _("Expecting MEAN, MEDIAN, MODE or number"));
+ return 0;
+ }
+
+ lex_force_match (lexer, ')');
+ lex_force_match (lexer, '=');
+ if (!parse_variables_const_pool (lexer, specs->pool, dataset_dict (ds),
+ &tp->vars, &tp->n_vars,
+ PV_NO_SCRATCH | PV_NO_DUPLICATE | PV_NUMERIC))
+ {
+ return 2;
+ }
+ }
+
+ specs->n_tests++;
+ specs->test = pool_realloc (specs->pool,
+ specs->test,
+ sizeof (*specs->test) * specs->n_tests);
+
+ specs->test[specs->n_tests - 1] = nt;
+
+ return 1;
+}
+
+