hashicorp / hcl2

Former temporary home for experimental new version of HCL
https://github.com/hashicorp/hcl
Mozilla Public License 2.0
373 stars 66 forks source link

Incorrect parsing of modulo operator #16

Closed apparentlymart closed 6 years ago

apparentlymart commented 6 years ago

In an expression in the alibaba/ecs-instance/alicloud Terraform Registry module there is a modulo operator that is not parsing correctly:

Error: Missing argument separator

  on .terraform/init-from-module/root/alibaba-terraform-alicloud-ecs-instance-063c382/main.tf line 79:
  79:   instance_id = "${element(alicloud_instance.instances.*.id, count.index%var.number_of_instances)}"

A comma is required to separate each function argument from the next.

It seems like % is not being recognized as an operator here and instead the parser thinks it has found the end of the expression.

apparentlymart commented 6 years ago

This is fixed in 440debc6d49e2436c8bd7e356fdafd17aca9677f.