hcl/hclsyntax
Martin Atkins d8ae04bc78 ext/customdecode: Custom expression decoding extension
Most of the time, the standard expression decoding built in to HCL is
sufficient. Sometimes though, it's useful to be able to customize the
decoding of certain arguments where the application intends to use them
in a very specific way, such as in static analysis.

This extension is an approximate analog of gohcl's support for decoding
into an hcl.Expression, allowing hcldec-based applications and
applications with custom functions to similarly capture and manipulate
the physical expressions used in arguments, rather than their values.

This includes one example use-case: the typeexpr extension now includes
a cty.Function called ConvertFunc that takes a type expression as its
second argument. A type expression is not evaluatable in the usual sense,
but thanks to cty capsule types we _can_ produce a cty.Value from one
and then make use of it inside the function implementation, without
exposing this custom type to the broader language:

    convert(["foo"], set(string))

This mechanism is intentionally restricted only to "argument-like"
locations where there is a specific type we are attempting to decode into.
For now, that's hcldec AttrSpec/BlockAttrsSpec -- analogous to gohcl
decoding into hcl.Expression -- and in arguments to functions.
2019-12-17 07:51:07 -08:00
..
fuzz Unfold the "hcl" directory up into the root 2019-09-09 16:08:19 -07:00
diagnostics.go Unfold the "hcl" directory up into the root 2019-09-09 16:08:19 -07:00
didyoumean_test.go Unfold the "hcl" directory up into the root 2019-09-09 16:08:19 -07:00
didyoumean.go Unfold the "hcl" directory up into the root 2019-09-09 16:08:19 -07:00
doc.go Unfold the "hcl" directory up into the root 2019-09-09 16:08:19 -07:00
expression_ops.go Unfold the "hcl" directory up into the root 2019-09-09 16:08:19 -07:00
expression_static_test.go Unfold the "hcl" directory up into the root 2019-09-09 16:08:19 -07:00
expression_template_test.go hclsyntax: Additional tests for template sequence escapes 2019-10-01 15:59:10 -07:00
expression_template.go Unfold the "hcl" directory up into the root 2019-09-09 16:08:19 -07:00
expression_test.go hclsyntax: Allow parens to force mapping key to be expression 2019-10-01 15:59:10 -07:00
expression_vars_gen.go Unfold the "hcl" directory up into the root 2019-09-09 16:08:19 -07:00
expression_vars.go Unfold the "hcl" directory up into the root 2019-09-09 16:08:19 -07:00
expression.go ext/customdecode: Custom expression decoding extension 2019-12-17 07:51:07 -08:00
file.go Unfold the "hcl" directory up into the root 2019-09-09 16:08:19 -07:00
generate.go Unfold the "hcl" directory up into the root 2019-09-09 16:08:19 -07:00
keywords.go Unfold the "hcl" directory up into the root 2019-09-09 16:08:19 -07:00
navigation_test.go Unfold the "hcl" directory up into the root 2019-09-09 16:08:19 -07:00
navigation.go Unfold the "hcl" directory up into the root 2019-09-09 16:08:19 -07:00
node.go Unfold the "hcl" directory up into the root 2019-09-09 16:08:19 -07:00
parse_traversal_test.go Unfold the "hcl" directory up into the root 2019-09-09 16:08:19 -07:00
parser_template.go hclwrite: Allow selecting blocks for updating 2019-10-01 15:59:10 -07:00
parser_test.go hclsyntax: Source range of IndexExpr must cover whole expression 2019-12-06 09:09:18 -08:00
parser_traversal.go Unfold the "hcl" directory up into the root 2019-09-09 16:08:19 -07:00
parser.go hclsyntax: Source range of IndexExpr must cover whole expression 2019-12-06 09:09:18 -08:00
peeker_test.go Unfold the "hcl" directory up into the root 2019-09-09 16:08:19 -07:00
peeker.go Unfold the "hcl" directory up into the root 2019-09-09 16:08:19 -07:00
public_test.go Unfold the "hcl" directory up into the root 2019-09-09 16:08:19 -07:00
public.go Unfold the "hcl" directory up into the root 2019-09-09 16:08:19 -07:00
scan_string_lit_test.go Unfold the "hcl" directory up into the root 2019-09-09 16:08:19 -07:00
scan_string_lit.go Unfold the "hcl" directory up into the root 2019-09-09 16:08:19 -07:00
scan_string_lit.rl Unfold the "hcl" directory up into the root 2019-09-09 16:08:19 -07:00
scan_tokens_test.go Unfold the "hcl" directory up into the root 2019-09-09 16:08:19 -07:00
scan_tokens.go Unfold the "hcl" directory up into the root 2019-09-09 16:08:19 -07:00
scan_tokens.rl Unfold the "hcl" directory up into the root 2019-09-09 16:08:19 -07:00
spec.md hclsyntax: Include legacy index syntax in the specification 2019-10-01 15:59:10 -07:00
structure_at_pos_test.go Unfold the "hcl" directory up into the root 2019-09-09 16:08:19 -07:00
structure_at_pos.go Unfold the "hcl" directory up into the root 2019-09-09 16:08:19 -07:00
structure_test.go Unfold the "hcl" directory up into the root 2019-09-09 16:08:19 -07:00
structure.go Unfold the "hcl" directory up into the root 2019-09-09 16:08:19 -07:00
token_type_string.go Unfold the "hcl" directory up into the root 2019-09-09 16:08:19 -07:00
token.go Unfold the "hcl" directory up into the root 2019-09-09 16:08:19 -07:00
unicode2ragel.rb Unfold the "hcl" directory up into the root 2019-09-09 16:08:19 -07:00
unicode_derived.rl Unfold the "hcl" directory up into the root 2019-09-09 16:08:19 -07:00
variables_test.go Unfold the "hcl" directory up into the root 2019-09-09 16:08:19 -07:00
variables.go Unfold the "hcl" directory up into the root 2019-09-09 16:08:19 -07:00
walk_test.go Unfold the "hcl" directory up into the root 2019-09-09 16:08:19 -07:00
walk.go Unfold the "hcl" directory up into the root 2019-09-09 16:08:19 -07:00