}
/* An interaction is a variable followed by {*, BY} followed by an interaction */
-bool
-parse_design_interaction (struct lexer *lexer, const struct dictionary *dict, struct interaction **iact)
+static bool
+parse_internal_interaction (struct lexer *lexer, const struct dictionary *dict, struct interaction **iact, struct interaction **it)
{
const struct variable *v = NULL;
assert (iact);
if (! lex_match_variable (lexer, dict, &v))
{
- interaction_destroy (*iact);
+ if (it)
+ interaction_destroy (*it);
*iact = NULL;
return false;
}
if ( lex_match (lexer, T_ASTERISK) || lex_match (lexer, T_BY))
{
- return parse_design_interaction (lexer, dict, iact);
+ return parse_internal_interaction (lexer, dict, iact, iact);
}
return true;
}
+bool
+parse_design_interaction (struct lexer *lexer, const struct dictionary *dict, struct interaction **iact)
+{
+ return parse_internal_interaction (lexer, dict, iact, NULL);
+}
+