amplify-education / python-hcl2

MIT License
255 stars 56 forks source link

Allow expressions in string interpolation #143

Open zabacad opened 1 year ago

zabacad commented 1 year ago

HCL allows for any expression in a string interpolation. This updates the grammar and transformer to match, allowing for arbitrarily-deep nesting.

piotrb commented 3 months ago

I just want to throw my 2c here, I used this patch as part of an internal tool that parses terragrunt hcl files to generate stack information for setting up spacelift stacks :) and this patch definitely works :) .. it does of course change the internal structure of the lark nodes being returned, but it works great to solve the issue at hand around supporting expressions inside interpolations.

Qantas94Heavy commented 2 months ago

Is there anything blocking this from being merged? This is impeding our use of python-hcl2 in our internal tooling and patching/forking this would be a lot of overhead for us.

weaversam8 commented 1 month ago

Hey @zabacad - I wanted to let you know that I missed this PR and accidentally duplicated your changes in my PR #177. Sorry about that! Hopefully that PR should be merged soon, fixing this issue.