MEM(node = xlat_exp_alloc_null(head));
if (tmpl_afrom_attr_substr(node, &err, &vpt, in, p_rules, &our_t_rules) < 0) {
/*
- * If the parse error occurred before the ':'
+ * If the parse error occurred before a terminator,
* then the error is changed to 'Unknown module',
* as it was more likely to be a bad module name,
* than a request qualifier.
char hint;
fr_sbuff_term_t hint_tokens = FR_SBUFF_TERMS(
L(" "), /* First special token is a ' ' - Likely a syntax error */
- L(":"), /* First special token is a ':' i.e. '%{func:' */
L("["), /* First special token is a '[' i.e. '%{attr[<idx>]}' */
L("}") /* First special token is a '}' i.e. '%{<attrref>}' */
);
#endif /* HAVE_REGEX */
- /*
- * See if it's an old-style function name.
- */
- fr_sbuff_marker(&s_m, in);
- len = fr_sbuff_adv_past_allowed(in, SIZE_MAX, xlat_func_chars, NULL);
- if (fr_sbuff_is_char(in, ':')) {
- if (!len) goto missing_function;
- goto check_for_attr;
- }
-
/*
* See if it's an attribute reference, with possible array stuff.
*/
- len += fr_sbuff_adv_past_allowed(in, SIZE_MAX, tmpl_attr_allowed_chars, NULL);
+ len = fr_sbuff_adv_past_allowed(in, SIZE_MAX, tmpl_attr_allowed_chars, NULL);
if (fr_sbuff_is_char(in, '}')) {
if (!len) goto empty_disallowed;
goto check_for_attr;
fr_strerror_const("Empty expression is invalid");
return -1;
- case ':':
- missing_function:
- fr_strerror_const("Missing expansion function");
- return -1;
-
case '[':
fr_strerror_const("Missing attribute name");
return -1;
match ERROR offset 3: Empty expression is invalid
xlat %{:}
-match ERROR offset 3: Missing expansion function
+match ERROR offset 3: No operand found. Expected &ref, literal, 'quoted literal', "%{expansion}", or enum value
xlat %{:bar}
-match ERROR offset 3: Missing expansion function
+match ERROR offset 3: No operand found. Expected &ref, literal, 'quoted literal', "%{expansion}", or enum value
xlat %foo(' bar')
match ERROR offset 2: Unresolved expansion functions are not allowed here