Skip to content

Commit

Permalink
hclsyntax: Correct spec to allow colons as object element delimiter
Browse files Browse the repository at this point in the history
To allow easir adaptation of data already serialized as JSON, HCL native
syntax allows both equals signs _and_ colons for object constructors.

This was already implemented, but not reflected in the pseudo-BNF in
the specification.
  • Loading branch information
apparentlymart committed Mar 5, 2020
1 parent 5200d8d commit 2cf95f2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion hclsyntax/spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ tuple = "[" (
object = "{" (
(objectelem ("," objectelem)* ","?)?
) "}";
objectelem = (Identifier | Expression) "=" Expression;
objectelem = (Identifier | Expression) ("=" | ":") Expression;
```

Only tuple and object values can be directly constructed via native syntax.
Expand Down

0 comments on commit 2cf95f2

Please sign in to comment.