hcl/hcl
Martin Atkins eea3a14a71 hcl/json: allow more flexible use of arrays when describing bodies
Previously we allowed arrays only at the "leaf" of a set of objects
describing a block and its labels. This is not sufficient because it is
therefore impossible to preserve the relative ordering of a sequence
of blocks that have different block types or labels.

The spec now allows arrays of objects to be used in place of single
objects when that value is representing either an HCL body or a set of
labels on a nested block. This relaxing does not apply to JSON objects
interpreted as expressions or bodies interpreted in dynamic attributes
mode, since there is no requirement to preserve attribute ordering or
support duplicate property names in those scenarios.

This new model imposes additional constraints on the underlying JSON
parser used to interpret JSON HCL: it must now be able to retain the
relative ordering of object keys and accept multiple definitions of the
same key. This requirement is not imposed on _producers_, which are free
to use the allowance for arrays of objects to force ordering and duplicate
keys with JSON-producing libraries that are unable to make these
distinctions.

Since we are now requiring a specialized parser anyway, we also require
that it be able to represent numbers at full precision, whereas before
we made some allowances for implementations to not support this.
2018-02-17 10:26:58 -08:00
..
hclsyntax hclsyntax: check for and report incorrect peeker stack discipline 2018-02-16 17:37:22 -08:00
integrationtest hcl/json: allow more flexible use of arrays when describing bodies 2018-02-17 10:26:58 -08:00
json hcl/json: allow more flexible use of arrays when describing bodies 2018-02-17 10:26:58 -08:00
diagnostic_text_test.go hcl: Simplify the text DiagnosticWriter using new Range functions 2018-01-14 12:07:33 -08:00
diagnostic_text.go hcl: highlight the subject when printing a diagnostic source snippet 2018-01-14 12:25:35 -08:00
diagnostic.go Move the zcl package and its two parsing subpackages to "hcl" names 2017-09-11 16:40:37 -07:00
didyoumean.go Move the zcl package and its two parsing subpackages to "hcl" names 2017-09-11 16:40:37 -07:00
doc.go Move the zcl package and its two parsing subpackages to "hcl" names 2017-09-11 16:40:37 -07:00
eval_context.go Move the zcl package and its two parsing subpackages to "hcl" names 2017-09-11 16:40:37 -07:00
expr_list.go hcl: UnwrapExpression and UnwrapExpressionUntil 2018-01-27 09:10:18 -08:00
expr_unwrap.go hcl: UnwrapExpression and UnwrapExpressionUntil 2018-01-27 09:10:18 -08:00
merged_test.go Move the zcl package and its two parsing subpackages to "hcl" names 2017-09-11 16:40:37 -07:00
merged.go Move the zcl package and its two parsing subpackages to "hcl" names 2017-09-11 16:40:37 -07:00
ops.go hcl: update stale references to "zcl" 2018-01-27 11:03:05 -08:00
pos_scanner_test.go hcl: RangeScanner helper 2018-01-14 11:24:19 -08:00
pos_scanner.go hcl: RangeScanner helper 2018-01-14 11:24:19 -08:00
pos_test.go hcl: SourceRange.PartitionAround 2018-01-14 11:51:05 -08:00
pos.go hcl: SourceRange.PartitionAround 2018-01-14 11:51:05 -08:00
schema.go Move the zcl package and its two parsing subpackages to "hcl" names 2017-09-11 16:40:37 -07:00
spec.md update zclsyntax to hclsyntax in various comments and strings 2018-01-23 21:54:38 -08:00
static_expr.go hcl: StaticExpr function for making synthetic expressions 2017-09-20 16:22:05 -07:00
structure.go More miscellaneous renaming of ZCL to HCL. 2017-09-11 18:36:56 -07:00
traversal_for_expr_test.go hcl: ExprAsKeyword function 2018-02-03 08:55:50 -08:00
traversal_for_expr.go hcl: ExprAsKeyword function 2018-02-03 08:55:50 -08:00
traversal.go hcl: Export the source range for a Traversal 2018-01-13 23:01:11 -08:00