node->quote = quote;
node->fmt = vpt->name;
+ /*
+ * Quoted strings just get resolved now.
+ *
+ * @todo - this means that things like
+ *
+ * &Session-Timeout == '10'
+ *
+ * are run-time errors, instead of load-time parse errors.
+ *
+ * On the other hand, if people assign static strings to non-string
+ * attributes... they sort of deserve what they get.
+ */
+ if ((quote != T_BARE_WORD) && tmpl_is_unresolved(node->vpt)) {
+ fr_assert(quote != T_BACK_QUOTED_STRING);
+ if (tmpl_resolve(node->vpt, NULL) < 0) return -1;
+ }
+
node->flags.pure = tmpl_is_data(node->vpt);
node->flags.needs_resolving = tmpl_needs_resolving(node->vpt);
match Passed in 67 characters, but only parsed 66 characters
#
-# @todo - the first argument is truthy, so we should replace the
-# "&&" node with just the RHS.
+# Truthy strings get omitted.
#
xlat_purify ('handled' && (&Packet-Type == Access-Challenge))
-match ('handled' && (&Packet-Type == Access-Challenge))
+match (&Packet-Type == Access-Challenge)
xlat_purify (handled && (&Packet-Type == Access-Challenge))
match (%{rcode:'handled'} && (&Packet-Type == Access-Challenge))
# This is OK, without the braces
xlat_purify 'handled' && &Packet-Type == Access-Challenge
-match ('handled' && (&Packet-Type == Access-Challenge))
+match (&Packet-Type == Access-Challenge)
# and this, though it's not a good idea.
xlat_purify 'handled' &&&Packet-Type == Access-Challenge
-match ('handled' && (&Packet-Type == Access-Challenge))
+match (&Packet-Type == Access-Challenge)
xlat_purify &reply == &request
match ERROR offset 0: Cannot use list references in condition
match (&Session-Timeout == 10)
# Automatic type inference means this is fine
+
+#
+# @todo - in binary resolve, cast the RHS to the type of the LHS.
+#
xlat_purify &Session-Timeout == '10'
-match (&Session-Timeout == 10)
+match (&Session-Timeout == '10')
# Except for dates, which can be humanly readable!
# This one is be an expansion, so it's left as-is.
# The attribute/xlat_purify parser does not fall back to bare words
#
xlat_purify request.Foo == 'request.Foo'
-match ERROR offset 0: Invalid attribute reference, missing '&' prefix: Failed resolving attribute in expansion: request.Foo
+match ERROR offset 0: Failed resolving attribute in expansion: request.Foo
xlat_purify ¬-a-list.User-Name == ¬-a-list.User-Name
match ERROR offset 1: Attribute 'not' not found. Searched in: RADIUS, internal: Unresolved attributes are not allowed here