Unable to use HCL identifiers with "`.`" in function call in block attribute
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 5.8k
- Forks
- 659
- Avg merge
- 20h 36m
- Merged PRs (30d)
- 6
Description
While investigating the following syntax:
example "something arbitrary" {
result = repository.file("main.go").example
}
I ran into the following error parsing it:
Error: Missing newline after argument
on issue.hcl line 2, in example "something arbitrary":
2: result = repository.file("main.go").example
An argument definition must end with a newline.
issue.hcl:2,28-29: Missing newline after argument; An argument definition must end with a newline.
Seems related to this line in (*hclsyntax.parser).finishParsingBodyAttribute:
Based on my reading of the spec's "function call" and "identifier" definitions, this seems like it could be possible, but currently ins't implemented? Or is this something that isn't allowed purposefully? It's not clear to me how traversals should work in this case.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in hclsyntax/parser.go at (*hclsyntax.parser).finishParsingBodyAttribute and inspect how function calls, identifiers, and traversals are parsed. Compare that behavior with the function call and identifier rules in the HCL specification, then establish whether the example syntax should parse and capture the expected result in parser coverage.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100