Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion libpromises/cf3lex.l
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ promise promise

nakedvar [$@][(][a-zA-Z0-9_\[\]\200-\377.:]+[)]|[$@][{][a-zA-Z0-9_\[\]\200-\377.:]+[}]|[$@][(][a-zA-Z0-9_\200-\377.:]+[\[][a-zA-Z0-9_$(){}\200-\377.:]+[\]]+[)]|[$@][{][a-zA-Z0-9_\200-\377.:]+[\[][a-zA-Z0-9_$(){}\200-\377.:]+[\]]+[}]

identifier [a-zA-Z0-9_\200-\377]+
identifier ([a-zA-Z0-9_\200-\377]+:)?([a-zA-Z0-9_\200-\377]+\.)?[a-zA-Z0-9_\200-\377]+

symbol [a-zA-Z0-9_\200-\377]+[:][a-zA-Z0-9_\200-\377]+

Expand Down
100 changes: 100 additions & 0 deletions tests/acceptance/01_vars/01_basic/namespaces/unquoted_namespaces.cf
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
body common control
{
inputs => { "../../../default.cf.sub"};
bundlesequence => { "init", "new_namespace:check" };
Copy link
Contributor

@larsewi larsewi Jan 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
bundlesequence => { "init", "new_namespace:check" };
bundlesequence => { "init", "test", "new_namespace:check" };

version => "1.0";
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
}
}
bundle again main
{
meta:
"description" -> { "ENT-13304" }
string => "Test that quotes are not needed for a fully qualified variable name in a function call";
}


bundle agent init
{
vars:
"foo_list"
slist => { "1", "2", "3" };
}

body file control
{
namespace => "new_namespace";
}

bundle agent check
{
vars:
"bar_list"
slist => { "1", "2", "3" };

"unquoted_foo_list1"
string => join(", ", foo_list);

"unquoted_foo_list2"
string => join(", ", init.foo_list);

"unquoted_foo_list3"
string => join(", ", default:foo_list);

"unquoted_foo_list4"
string => join(", ", default:init.foo_list);

"unquoted_bar_list1"
string => join(", ", bar_list);

"unquoted_bar_list2"
string => join(", ", check.bar_list);

"unquoted_bar_list3"
string => join(", ", new_namespace:bar_list);

"unquoted_bar_list4"
string => join(", ", new_namespace:check.bar_list);

"quoted_foo_list1"
string => join(", ", foo_list);

"quoted_foo_list2"
string => join(", ", init.foo_list);

"quoted_foo_list3"
string => join(", ", default:foo_list);

"quoted_foo_list4"
string => join(", ", default:init.foo_list);

"quoted_bar_list1"
string => join(", ", bar_list);

"quoted_bar_list2"
string => join(", ", check.bar_list);

"quoted_bar_list3"
string => join(", ", new_namespace:bar_list);

"quoted_bar_list4"
string => join(", ", new_namespace:check.bar_list);

classes:
"undefined_vars"
expression => not(or(isvariable("unquoted_foo_list1"),
isvariable("unquoted_foo_list3"),
isvariable("unquoted_bar_list2"),
isvariable("quoted_foo_list1"),
isvariable("quoted_foo_list3"),
isvariable("quoted_bar_list2")));

"defined_vars"
expression => and(strcmp("1, 2, 3", "$(unquoted_foo_list2)"),
strcmp("1, 2, 3", "$(unquoted_foo_list4)"),
strcmp("1, 2, 3", "$(unquoted_bar_list1)"),
strcmp("1, 2, 3", "$(unquoted_bar_list3)"),
strcmp("1, 2, 3", "$(unquoted_bar_list4)"),
strcmp("1, 2, 3", "$(quoted_foo_list2)"),
strcmp("1, 2, 3", "$(quoted_foo_list4)"),
strcmp("1, 2, 3", "$(quoted_bar_list1)"),
strcmp("1, 2, 3", "$(quoted_bar_list3)"),
strcmp("1, 2, 3", "$(quoted_bar_list4)"));

reports:
defined_vars.undefined_vars::
"$(this.promise_filename) Pass";
!defined_vars|!undefined_vars::
"$(this.promise_filename) FAIL";
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
}
}

Loading