bafa0c5ace
This relaxes our previous spec to include a special form from HCL 1: foo { bar = baz } Although we normally require each argument to be on a line of its own, as a special case we allow a block to be defined with a single nested argument all on one line. Only one nested argument definition is allowed, and a nested block definition like "foo { bar {} }" is also disallowed in order to force the more-readable split of bar {} onto a line of its own. This is a pragmatic addition for broader compatibility with HCL 1-oriented input. This single-line usage is not considered idiomatic HCL 2 and may in future be undone by the formatter, though for now it is left as-is aside from the spacing around the braces. This also changes the behavior of the source code formatter to include spaces on both sides of braces. This mimicks the formatting behavior of HCL 1 for this situation, and (subjectively) reads better even for other one-line braced expressions like object constructors and object for expressions. |
||
---|---|---|
.. | ||
ast_attribute.go | ||
ast_block.go | ||
ast_body_test.go | ||
ast_body.go | ||
ast_expression.go | ||
ast_test.go | ||
ast.go | ||
doc.go | ||
examples_test.go | ||
format_test.go | ||
format.go | ||
generate_test.go | ||
generate.go | ||
native_node_sorter.go | ||
node.go | ||
parser_test.go | ||
parser.go | ||
public.go | ||
round_trip_test.go | ||
tokens.go |