unlang_xlat_push(state->ctx, &state->rhead, request, child, false);
return UNLANG_ACTION_PUSHED_CHILD;
- case XLAT_ACTION_PUSH_CHILD_GROUP:
- rad_assert(child);
-
- repeatable_set(frame);
-
- /*
- * Clear out the results of any previous expansions
- * at this level. A frame may be used to evaluate
- * multiple sibling nodes.
- */
- talloc_list_free(&state->rhead);
-
- /*
- * The called function can't pass us a value box,
- * so we have to create it ourselves.
- */
- state->rhead = fr_value_box_alloc(state->ctx, FR_TYPE_GROUP, NULL, false);
-
- unlang_xlat_push(state->ctx, &state->rhead->vb_group, request, child, false);
- return UNLANG_ACTION_PUSHED_CHILD;
-
case XLAT_ACTION_YIELD:
if (!state->resume) {
RWDEBUG("Missing call to unlang_xlat_yield()");
return UNLANG_ACTION_CALCULATE_RESULT;
case XLAT_ACTION_PUSH_CHILD:
- case XLAT_ACTION_PUSH_CHILD_GROUP:
rad_assert(0);
/* FALL-THROUGH */
*/
typedef enum {
XLAT_ACTION_PUSH_CHILD = 1, //!< A deeper level of nesting needs to be evaluated.
- XLAT_ACTION_PUSH_CHILD_GROUP, //!< same as above, and the child is a group
XLAT_ACTION_YIELD, //!< An xlat function pushed a resume frame onto the stack.
XLAT_ACTION_DONE, //!< We're done evaluating this level of nesting.
XLAT_ACTION_FAIL //!< An xlat function failed.
{ "done", XLAT_ACTION_DONE },
{ "fail", XLAT_ACTION_FAIL },
{ "push-child", XLAT_ACTION_PUSH_CHILD },
- { "push-child-group", XLAT_ACTION_PUSH_CHILD_GROUP },
{ "yield", XLAT_ACTION_YIELD }
};
size_t xlat_action_table_len = NUM_ELEMENTS(xlat_action_table);
RDEBUG2(" -- CHILD");
return xa;
-
- case XLAT_ACTION_PUSH_CHILD_GROUP:
- RDEBUG2(" -- CHILD-GROUP");
- return xa;
-
case XLAT_ACTION_YIELD:
RDEBUG2(" -- YIELD");
return xa;
case XLAT_CHILD:
{
fr_cursor_t from;
+ fr_value_box_t *box;
XLAT_DEBUG("** [%i] %s(child) - continuing %%{%s ...}", unlang_interpret_stack_depth(request), __FUNCTION__,
node->fmt);
rad_assert(*result != NULL);
+ (void) talloc_list_get_type_abort(*result, fr_value_box_t);
+
+ box = fr_value_box_alloc(ctx, FR_TYPE_GROUP, NULL, false);
+ box->vb_group = *result;
+ *result = NULL;
xlat_debug_log_expansion(request, *in, NULL);
- xlat_debug_log_result(request, *result);
+ xlat_debug_log_result(request, box);
- (void) talloc_list_get_type_abort(*result, fr_value_box_t);
- fr_cursor_init(&from, result);
+ fr_cursor_init(&from, &box);
fr_cursor_merge(out, &from);
- rad_assert(!*result);
+ rad_assert(!box);
}
break;
* for evaluation.
*/
*child = node->child;
- xa = XLAT_ACTION_PUSH_CHILD_GROUP;
+ xa = XLAT_ACTION_PUSH_CHILD;
goto finish;
}
}