From 24fdc2541e1ae5713ecc5a09e5a868422ded1460 Mon Sep 17 00:00:00 2001 From: Kamil Kozik Date: Fri, 11 Apr 2025 13:58:51 +0200 Subject: [PATCH] for_object_expr: allow ellipsis in separate line --- CHANGELOG.md | 1 + test/helpers/terraform-config-json/variables.json | 4 ++-- test/helpers/terraform-config/variables.tf | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 08a37db1..616578bb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Fixed +- Issue parsing ellipsis in a separate line within `for` expression ([#221](https://github.com/amplify-education/python-hcl2/pull/221)) - Issue parsing inline expression as an object key; **see Limitations in README.md** ([#222](https://github.com/amplify-education/python-hcl2/pull/222)) ## \[7.1.0\] - 2025-04-10 diff --git a/test/helpers/terraform-config-json/variables.json b/test/helpers/terraform-config-json/variables.json index 3346f201..156734b6 100644 --- a/test/helpers/terraform-config-json/variables.json +++ b/test/helpers/terraform-config-json/variables.json @@ -54,9 +54,9 @@ "empty_tuple": [] }, { - "route53_forwarding_rule_shares": "${{for forwarding_rule_key in keys(var.route53_resolver_forwarding_rule_shares) : \"${forwarding_rule_key}\" => {\"aws_account_ids\": \"${[for account_name in var.route53_resolver_forwarding_rule_shares[forwarding_rule_key].aws_account_names : module.remote_state_subaccounts.map[account_name].outputs[\"aws_account_id\"]]}\"}}}", + "route53_forwarding_rule_shares": "${{for forwarding_rule_key in keys(var.route53_resolver_forwarding_rule_shares) : \"${forwarding_rule_key}\" => {\"aws_account_ids\": \"${[for account_name in var.route53_resolver_forwarding_rule_shares[forwarding_rule_key].aws_account_names : module.remote_state_subaccounts.map[account_name].outputs[\"aws_account_id\"]]}\"} ...}}", "has_valid_forwarding_rules_template_inputs": "${(length(keys(var.forwarding_rules_template.copy_resolver_rules)) > 0 && length(var.forwarding_rules_template.replace_with_target_ips) > 0 && length(var.forwarding_rules_template.exclude_cidrs) > 0)}", - "for_whitespace": "${{for i in [1, 2, 3] : i => i}}" + "for_whitespace": "${{for i in [1, 2, 3] : i => i ...}}" }, { "nested_data": [ diff --git a/test/helpers/terraform-config/variables.tf b/test/helpers/terraform-config/variables.tf index d5c9a69b..f4ef2a82 100644 --- a/test/helpers/terraform-config/variables.tf +++ b/test/helpers/terraform-config/variables.tf @@ -65,6 +65,7 @@ locals { module.remote_state_subaccounts.map[account_name].outputs["aws_account_id"] ] } + ... } has_valid_forwarding_rules_template_inputs = ( length(keys(var.forwarding_rules_template.copy_resolver_rules)) > 0 @@ -74,7 +75,7 @@ locals { for_whitespace = { for i in [1, 2, 3] : i => - i + i ... } }