char *fmt;
xlat_exp_t *node;
xlat_exp_head_t *child;
+ tmpl_rules_t my_rules = *t_rules;
fr_sbuff_set(in, &s_m); /* backtrack to the start of the expression */
MEM(node = xlat_exp_alloc(head, XLAT_TMPL, NULL, 0));
MEM(node->vpt = tmpl_alloc(node, TMPL_TYPE_XLAT, T_BARE_WORD, "", 1));
- ret = xlat_tokenize_expression(node->vpt, &child, in, &attr_p_rules, t_rules);
+ my_rules.enumv = NULL;
+ my_rules.cast = FR_TYPE_NULL;
+
+ ret = xlat_tokenize_expression(node->vpt, &child, in, &attr_p_rules, &my_rules);
if (ret <= 0) {
talloc_free(node);
return ret;
#
# Casts and such
#
-xlat_purify (string)(%{expr:1})
-match "1"
+# @todo - xlat_tokenize() does not call purify
+#
+xlat_purify (string)(%{1 + 2})
+match %(cast:string (1 + 2))
#
# This is a different code path than the above.
#
-xlat_purify (string)%{expr:1}
-match "1"
+xlat_purify (string)%{1 + 2}
+match %(cast:string (1 + 2))
xlat_purify "hello"
match "hello"
#
# String concatenation
#
-xlat_purify "hello " + (string)%{expr:1}
-match "hello 1"
+xlat_purify "hello " + (string)%{1 + 2}
+match "hello 3"
-xlat_purify "hello " + (string)%{expr:1} + " bob"
-match "hello 1 bob"
+xlat_purify "hello " + (string)%{1 + 2} + " bob"
+match "hello 3 bob"
#
# This should be the same as above, but it isn't!