Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This introduces a new syntax which allows function names to have namespace prefixes, with the different name parts separated by a double-colon
::
as is common in various other C-derived languages which need to distinguish between scope resolution and attribute/field traversal. (For example: C++, Rust, Ruby, and Perl.)Because HCL has separate namespaces for functions and variables, we need to use different punctuation for each to avoid creating parsing ambiguity that could be resolved only with infinite lookahead.
We cannot retroactively change the internal representation of function names to be a slice of names without breaking the existing API, and so we instead adopt a convention of packing the multi-part names into single strings which the parser guarantees will always be a series of valid identifiers separated by the literal
::
sequence. That means that applications will make namespaced functions available in theEvalContext
by naming them in a way that matches this convention.This addition should change nothing for any existing applications that only place single-identifier names in the
EvalContext
function table, but allows applications to begin defining such functions when they are ready, with whichever namespaces they deem appropriate.