Closed jclem closed 1 year ago
Thanks for the issue! I pushed a potential fix:
foo {
bar = 1
}
foo {
bar = 2
}
%{"foo" => [%{"bar" => 1}, %{"bar" => 2}]}
foo {
bar {
baz = 1
}
}
foo {
bar {
baz = 2
}
}
%{"foo" => [%{"bar" => %{"baz" => 1}}, %{"bar" => %{"baz" => 2}}]}
foo {
bar {
baz = 1
}
bar {
baz = 2
}
}
foo {
bar {
baz = 2
}
}
%{
"foo" => [
%{"bar" => [%{"baz" => 1}, %{"baz" => 2}]},
%{"bar" => %{"baz" => 2}}
]
}
Looks ok?
Yup, looks right! Thanks—I'll leave the issue-closing to you 😄
😁
Given the following HCL:
HXL decodes it like so:
While the AST decoding is correct, the decoding-to-Elixir is not an accurate representation of the document. Instead, it should be:
In other words,
HXL.decode/2
is lossy, currently. Note thatHXL.decode_ast_ast/1
is fine: