Skip to content
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

HCL Parser Fails with Valid Object Declarations and Heredoc Strings #7736

Open
1 task done
BrentSouza opened this issue Aug 26, 2022 · 0 comments
Open
1 task done
Labels
kind/bug This issue represents a verified problem we are committed to solving

Comments

@BrentSouza
Copy link

Team

  • I've assigned a team label to this issue

Severity

High

Version

1.0.4

Latest Version

No response

What happened?

Two problems with the HCLParser that cause failures in valid HCL:

  1. Comments in object type declarations:
variable "foo" {
  type = object({
    # this prop is really important for reasons
    bar = string
    # this one...who knows
    baz = string
}
  1. Heredoc delimiters match in the middle of a string:
variable "bar" {
  default = <<-EOF
  Here we have some text. And for valid reasons,
  I need to have EOF in the text I'm writing.
  EOF

The parser currently matches the EOF in the middle of the sentence and then fails with invalid syntax for the remainder.

Reproduction

See above.

Error and Stacktrace

No response

More Information

No response

Workaround

I've submitted a PR that seems to resolve both issues: OctopusDeploy/HCLParser#11

@BrentSouza BrentSouza added kind/bug This issue represents a verified problem we are committed to solving state/triage labels Aug 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug This issue represents a verified problem we are committed to solving
Projects
None yet
Development

No branches or pull requests

2 participants