Skip to content

Releases: hashicorp/hcl

v2.8.1

17 Dec 17:53
56e58b6
Compare
Choose a tag to compare

Bugs Fixed

  • hclsyntax: Fix panic when expanding marked function arguments. (#429)
  • hclsyntax: Error when attempting to use a marked value as an object key. (#434)
  • hclsyntax: Error when attempting to use a marked value as an object key in expressions. (#433)

v2.8.0

07 Dec 19:37
3231752
Compare
Choose a tag to compare

Enhancements

  • hclsyntax: Expression grouping parentheses will now be reflected by an explicit node in the AST, whereas before they were only considered during parsing. (#426)

Bugs Fixed

  • hclwrite: The parser will now correctly include the ( and ) tokens when an expression is surrounded by parentheses. Previously it would incorrectly recognize those tokens as being extraneous tokens outside of the expression. (#426)
  • hclwrite: The formatter will now remove (rather than insert) spaces between the ! (unary boolean "not") operator and its subsequent operand. (#403)
  • hclsyntax: Unmark conditional values in expressions before checking their truthfulness (#427)

v2.7.2

30 Nov 16:23
f10222b
Compare
Choose a tag to compare

Bugs Fixed

  • gohcl: Fix panic when decoding into type containing value slices. (#335)
  • hclsyntax: The unusual expression null[*] was previously always returning an unknown value, even though the rules for [*] normally call for it to return an empty tuple when applied to a null. As well as being a surprising result, it was particularly problematic because it violated the rule that a calling application may assume that an expression result will always be known unless the application itself introduces unknown values via the evaluation context. null[*] will now produce an empty tuple. (#416)
  • hclsyntax: Fix panic when traversing a list, tuple, or map with cty "marks" (#424)

v2.7.1

18 Nov 16:53
eadfd40
Compare
Choose a tag to compare

Bugs Fixed

  • hclwrite: Correctly handle blank quoted string block labels, instead of dropping them (#422)

v2.7.0

14 Oct 14:13
d56ed51
Compare
Choose a tag to compare

Enhancements

  • json: There is a new function ParseWithStartPos, which allows overriding the starting position for parsing in case the given JSON bytes are a fragment of a larger document, such as might happen when decoding with encoding/json into a json.RawMessage. (#389)
  • json: There is a new function ParseExpression, which allows parsing a JSON string directly in expression mode, whereas previously it was only possible to parse a JSON string in body mode. (#381)
  • hclwrite: Block type now supports SetType and SetLabels, allowing surgical changes to the type and labels of an existing block without having to reconstruct the entire block. (#340)

Bugs Fixed

  • hclsyntax: Fix confusing error message for bitwise OR operator (#380)
  • hclsyntax: Several bug fixes for using HCL with values containing cty "marks" (#404, #406, #407)

v2.6.0

04 Jun 21:40
350d663
Compare
Choose a tag to compare

Enhancements

  • hcldec: Add a new Spec, ValidateSpec, which allows custom validation of values at decode-time. (#387)

Bugs Fixed

  • hclsyntax: Fix panic with combination of sequences and null arguments (#386)
  • hclsyntax: Fix handling of unknown values and sequences (#386)

v2.5.1

14 May 13:34
148b442
Compare
Choose a tag to compare

Bugs Fixed

  • hclwrite: handle legacy dot access of numeric indexes. (#369)
  • hclwrite: Fix panic for dotted full splat (foo.*) (#374)

v2.5.0

06 May 17:32
b35ebdc
Compare
Choose a tag to compare

Enhancements

  • hclwrite: Generate multi-line objects and maps. (#372)

v2.4.0

13 Apr 14:38
70cdf59
Compare
Choose a tag to compare

v2.4.0 (Apr 13, 2020)

Enhancements

  • The Unicode data tables that HCL uses to produce user-perceived "column" positions in diagnostics and other source ranges are now updated to Unicode 12.0.0, which will cause HCL to produce more accurate column numbers for combining characters introduced to Unicode since Unicode 9.0.0.

Bugs Fixed

  • json: Fix panic when parsing malformed JSON. (#358)

v2.3.0

03 Jan 19:21
Compare
Choose a tag to compare

Enhancements

  • ext/tryfunc: Optional functions try and can to include in your hcl.EvalContext when evaluating expressions, which allow users to make decisions based on the success of expressions. (#330)
  • ext/typeexpr: Now has an optional function convert which you can include in your hcl.EvalContext when evaluating expressions, allowing users to convert values to specific type constraints using the type constraint expression syntax. (#330)
  • ext/typeexpr: A new cty capsule type typeexpr.TypeConstraintType which, when used as either a type constraint for a function parameter or as a type constraint for a hcldec attribute specification will cause the given expression to be interpreted as a type constraint expression rather than a value expression. (#330)
  • ext/customdecode: An optional extension that allows overriding the static decoding behavior for expressions either in function arguments or hcldec attribute specifications. (#330)
  • ext/customdecode: New cty capsuletypes customdecode.ExpressionType and customdecode.ExpressionClosureType which, when used as either a type constraint for a function parameter or as a type constraint for a hcldec attribute specification will cause the given expression (and, for the closure type, also the hcl.EvalContext it was evaluated in) to be captured for later analysis, rather than immediately evaluated. (#330)