node->call.args = _xlat_exp_head_alloc(NDEBUG_LOCATION_VALS node);
break;
+ case XLAT_BOX:
+ node->flags.constant = node->flags.pure = node->flags.can_purify = true;
+ break;
+
default:
break;
}
inlen + extra);
_xlat_exp_set_type(NDEBUG_LOCATION_VALS node, type);
+ if (type == XLAT_BOX) {
+ node->flags.constant = node->flags.pure = node->flags.can_purify = true;
+ }
+
if (!in) return node;
node->fmt = talloc_bstrndup(node, in, inlen);
return;
case XLAT_FUNC:
+ xlat_exp_foreach(node->call.args, arg) {
+ fr_assert(arg->type == XLAT_GROUP);
+
+ /*
+ * We can't do this yet, because the old function argument parser doesn't do the
+ * right thing.
+ */
+// fr_assert(arg->quote == T_BARE_WORD);
+ }
+
xlat_exp_head_verify(node->call.args);
(void)talloc_get_type_abort_const(node->fmt, char);
return;
return;
}
+ case XLAT_BOX:
+ fr_assert(node->flags.constant);
+ fr_assert(node->flags.pure);
+// fr_assert(node->flags.can_purify);
+ break;
+
default:
break;
}
* number.
*/
MEM(node = xlat_exp_alloc(cast, XLAT_BOX, NULL, 0));
- node->flags.constant = true;
{
char const *type_name = fr_table_str_by_value(fr_type_table, type, "<INVALID>");
xlat_exp_set_name(node, type_name, strlen(type_name));
MEM(arg = xlat_exp_alloc(node, XLAT_BOX, fr_sbuff_start(&our_in), slen));
- /*
- * Doesn't need resolving, isn't pure, doesn't need anything else.
- */
- arg->flags = (xlat_flags_t) { };
-
/*
* We need a string for unit tests, but this should really be just a number.
*/
xlat_exp_set_name_shallow(child, str);
fr_value_box_strdup(child, &child->data, NULL, str, false);
fr_value_box_mark_safe_for(&child->data, t_rules->literals_safe_for); /* Literal values are treated as implicitly safe */
- child->flags.constant = true;
fr_assert(child->flags.pure);
xlat_exp_insert_tail(node->group, child);
}