-
Notifications
You must be signed in to change notification settings - Fork 499
Allow 'if' as HCL attribute name #6473
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Aman Gautam <[email protected]>
|
Thanks for looking into this @Gautam-aman ; are you sure you pushed all the changes you were after? As I'm seeing no reference that |
Signed-off-by: Aman Gautam <[email protected]>
|
This PR is now ready for review. The grammar and visitor changes allow Local build and tests pass:
Happy to address any feedback. |
rewrite-hcl/src/main/java/org/openrewrite/hcl/internal/grammar/JsonPathParserVisitor.java
Outdated
Show resolved
Hide resolved
rewrite-hcl/src/main/java/org/openrewrite/hcl/internal/HclParserVisitor.java
Outdated
Show resolved
Hide resolved
…/JsonPathParserVisitor.java Co-authored-by: Tim te Beek <[email protected]>
…erVisitor.java Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
|
All review feedback has been addressed and the PR is ready. |
|
Thanks for the review and merge , appreciate it! |
|
Thanks! There's one open question that I'd like @greg-at-moderne to weigh in on; please don't resolve that comment before then: Mostly I'm wondering if the fix here is too specific for the problem that was reported, whereas I think there might be similar cases that we'd want to tackle here as well. |
|
I agree it’s worth considering whether this should be generalized beyond the reported case. I’m happy to wait for @greg-at-moderne’s input and adjust the approach if needed. Let me know how you’d like to proceed. |
…/hcl-if-as-property
Fixes parsing failure when if is used as an attribute name in HCL.
Terraform allows keywords as attribute names, but the current grammar only accepts Identifier, causing valid HCL to fail parsing.
This change allows if in attribute position only and adds a regression test.
ifas property name #6446