X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fexpressions%2Fparse.c;h=b841953b7ea5125e3308975dab36efbda6d6d928;hb=ad01fea350354a7df11790a561e935a8bffd3636;hp=a7064e034c8728b05e3b1264367e7a8075379fe0;hpb=317e6b778833b5dcd5dd195c0b677835a8024b2a;p=pspp-builds.git diff --git a/src/expressions/parse.c b/src/expressions/parse.c index a7064e03..b841953b 100644 --- a/src/expressions/parse.c +++ b/src/expressions/parse.c @@ -86,6 +86,19 @@ expr_parse (struct dictionary *dict, enum expr_type type) } } +/* Parses and returns an expression of the given TYPE, as + expr_parse(), and sets up so that destroying POOL will free + the expression as well. */ +struct expression * +expr_parse_pool (struct pool *pool, + struct dictionary *dict, enum expr_type type) +{ + struct expression *e = expr_parse (dict, type); + if (e != NULL) + pool_add_subpool (pool, e->expr_pool); + return e; +} + /* Free expression E. */ void expr_free (struct expression *e) @@ -1033,7 +1046,7 @@ validate_function_args (const struct operation *f, int arg_cnt, int min_valid) { assert ((f->flags & OPF_MIN_VALID) == 0); msg (SE, _("%s function does not accept a minimum valid " - "argument count.")); + "argument count."), f->prototype); return false; } else @@ -1042,7 +1055,7 @@ validate_function_args (const struct operation *f, int arg_cnt, int min_valid) if (array_arg_cnt < f->array_min_elems) { msg (SE, _("%s requires at least %d valid arguments in list."), - f->prototype); + f->prototype, f->array_min_elems); return false; } else if (min_valid > array_arg_cnt) @@ -1158,8 +1171,8 @@ parse_function (struct expression *e) if (token == T_ID && lex_look_ahead () == 'T') { struct variable **vars; - int var_cnt; - int i; + size_t var_cnt; + size_t i; if (!parse_variables (default_dict, &vars, &var_cnt, PV_SINGLE)) goto fail;