*/
switch (at_rules->prefix) {
case TMPL_ATTR_REF_PREFIX_YES:
- if (!fr_sbuff_next_if_char(&our_name, '&')) {
- fr_strerror_const("Invalid attribute reference, missing '&' prefix");
- if (err) *err = TMPL_ATTR_ERROR_BAD_PREFIX;
- FR_SBUFF_ERROR_RETURN(&our_name);
+ if (!tmpl_require_enum_prefix) {
+ if (!fr_sbuff_next_if_char(&our_name, '&')) {
+ fr_strerror_const("Invalid attribute reference, missing '&' prefix");
+ if (err) *err = TMPL_ATTR_ERROR_BAD_PREFIX;
+ FR_SBUFF_ERROR_RETURN(&our_name);
+ }
+ break;
}
+ FALL_THROUGH; /* if we do require enum prefixes, then the '&' is optional */
+ case TMPL_ATTR_REF_PREFIX_AUTO:
+ /*
+ * '&' prefix can be there, but doesn't have to be
+ */
+ (void) fr_sbuff_next_if_char(&our_name, '&');
break;
case TMPL_ATTR_REF_PREFIX_NO:
FR_SBUFF_ERROR_RETURN(&our_name);
}
break;
-
- case TMPL_ATTR_REF_PREFIX_AUTO:
- /*
- * '&' prefix can be there, but doesn't have to be
- */
- (void) fr_sbuff_next_if_char(&our_name, '&');
- break;
}
MEM(vpt = tmpl_alloc(ctx, TMPL_TYPE_ATTR, T_BARE_WORD, NULL, 0));
default:
bare_word:
*out = p;
- quote = '\0';
+
+ if (tmpl_require_enum_prefix) {
+ quote = '['; /* foo[1] is OK */
+ } else {
+ quote = '\0';
+ }
skip_word:
*type = T_BARE_WORD;
#
# (make -k test.keywords 2>&1) | grep 'KEYWORD=' | sed 's/KEYWORD=//;s/ .*$//'
#
+# @todo - set "-S require_enum_prefix=yes" here, so that the flag is set _before_ we read the config files.
+#
$(OUTPUT)/%: $(DIR)/% $(TEST_BIN_DIR)/unit_test_module | $(KEYWORD_RADDB) $(KEYWORD_LIBS) build.raddb rlm_test.la rlm_csv.la rlm_unpack.la
$(eval CMD:=KEYWORD=$(notdir $@) $(TEST_BIN)/unit_test_module $(NEW_COND) $(UNIT_TEST_KEYWORD_ARGS.$(subst -,_,$(notdir $@))) -D share/dictionary -d src/tests/keywords/ -i "$@.attrs" -f "$@.attrs" -r "$@" -xx)
@echo "KEYWORD-TEST $(notdir $@)"