+Mon May 1 15:11:48 2006 Ben Pfaff <blp@gnu.org>
+
+ Prohibit LAG following TEMPORARY. This both matches SPSS behavior
+ and fixes a bug: we saved the cases for LAG before TEMPORARY but
+ allowed access to variables created afterward anyhow (which could
+ cause a segfault).
+
+ * generate.pl: Parse "perm_only" flag on operations.
+
+ * operations.def: Add "perm_only" flag to LAG operations.
+
+ * parse.c: Disallow OPF_PERM_ONLY operations after TEMPORARY.
+
+ * parse.inc.pl: Output OPF_PERM_ONLY flag for "perm_only"
+ operations.
+
+ * private.h: Add OPF_PERM_ONLY flag.
+
Sun Apr 23 22:06:45 2006 Ben Pfaff <blp@gnu.org>
Continue reforming error message support. In this phase, get rid
$op{OPTIMIZABLE} = 1;
$op{UNIMPLEMENTED} = 0;
$op{EXTENSION} = 0;
+ $op{PERM_ONLY} = 0;
for (;;) {
if (match ('extension')) {
$op{EXTENSION} = 1;
$op{OPTIMIZABLE} = 0;
} elsif (match ('absorb_miss')) {
$op{ABSORB_MISS} = 1;
+ } elsif (match ('perm_only')) {
+ $op{PERM_ONLY} = 1;
} else {
last;
}
return s;
}
-no_opt function LAG (num_var v, pos_int n_before)
+no_opt perm_only function LAG (num_var v, pos_int n_before)
{
struct ccase *c = lagged_case (n_before);
if (c != NULL)
return SYSMIS;
}
-no_opt function LAG (num_var v)
+no_opt perm_only function LAG (num_var v)
{
struct ccase *c = lagged_case (1);
if (c != NULL)
return SYSMIS;
}
-no_opt string function LAG (str_var v, pos_int n_before)
+no_opt perm_only string function LAG (str_var v, pos_int n_before)
expression e;
{
struct ccase *c = lagged_case (n_before);
return empty_string;
}
-no_opt string function LAG (str_var v)
+no_opt perm_only string function LAG (str_var v)
expression e;
{
struct ccase *c = lagged_case (1);
msg (SE, _("%s is not yet implemented."), f->prototype);
goto fail;
}
+ if ((f->flags & OPF_PERM_ONLY) && in_temporary_transformations ())
+ {
+ msg (SE, _("%s may not appear after TEMPORARY."), f->prototype);
+ goto fail;
+ }
n = expr_allocate_composite (e, f - operations, args, arg_cnt);
n->composite.min_valid = min_valid != -1 ? min_valid : f->array_min_elems;
push (@flags, "OPF_NONOPTIMIZABLE") if !$op->{OPTIMIZABLE};
push (@flags, "OPF_EXTENSION") if $op->{EXTENSION};
push (@flags, "OPF_UNIMPLEMENTED") if $op->{UNIMPLEMENTED};
+ push (@flags, "OPF_PERM_ONLY") if $op->{PERM_ONLY};
push (@members, @flags ? join (' | ', @flags) : 0);
push (@members, "OP_$op->{RETURNS}{NAME}");
OPF_UNIMPLEMENTED = 020,
/* If set, this operation is a PSPP extension. */
- OPF_EXTENSION = 040
+ OPF_EXTENSION = 040,
+
+ /* If set, this operation may not occur after TEMPORARY.
+ (Currently this applies only to LAG.) */
+ OPF_PERM_ONLY = 0100
};
#define EXPR_ARG_MAX 4