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

Missing newline at the end of a file causes error #18

Closed apparentlymart closed 6 years ago

apparentlymart commented 6 years ago

Due to some details of how the attribute and block parsers terminate, an error is currently produced if a file does not end with a newline character:

Error: Missing newline after block definition

  on .terraform/init-from-module/root/alibaba-terraform-alicloud-ecs-instance-063c382/variables.tf line 156:
 153: variable "number_of_instances" {
 154:   description = "The number of launching instances one time."
 155:   default = 1
 156: }

A newline is required after a block definition at the end of a file.

This was a stopgap solution made during the prototyping phase, but we need to accommodate files with missing trailing newlines now in order to read real Terraform configurations in the wild.

apparentlymart commented 6 years ago

Fixed in 386ab3257c9e58789d47de9d0de70f44988c5519.