Open dbalucas opened 8 months ago
I have the same issue, it fails to parse a code like this:
service = {
high_memory_seconds = 60 * 10
high_memory_percentage = 95
}
Logs:
lark.exceptions.UnexpectedToken: Unexpected token Token('__ANON_3', 'high_memory_percentage') at line 3, column 7.
@alpinweis Thanks for bringing it up again. Have you tried the workaround with the comma mentioned in the last line?
@alpinweis Thanks for bringing it up again. Have you tried the workaround with the comma mentioned in the last line?
the comma workaround does work, but updating all the files at my job I need to parse is not realistic. also, using commas looks kind of ugly :)
In my case the alternative workaround was to convert that tf
file to json using a tool like hcl2json
used with the -simplify
flag that runs all the basic calculations like add/multiply etc before saving the json file.
Current behaviour fails to parse following hcl code:
Logs:
Expected behaviour is that the parsing should succeed.
Workaround: place a comma after the multiplication