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: Support provider scoped functions #5078

Open
knutwannheden opened this issue Feb 21, 2025 · 0 comments
Open

HCL: Support provider scoped functions #5078

knutwannheden opened this issue Feb 21, 2025 · 0 comments
Labels
enhancement New feature or request parser-hcl

Comments

@knutwannheden
Copy link
Contributor

As of version 1.8 Terraform supports provider scoped functions as in this example:

terraform {
	required_providers {
		test = {
			source = "hashicorp/test"
		}
	}
}
locals {
	result = provider::test::count_e("cheese")
}

The OpenRewrite HCL parser currently fails to parse this:

Caused by: org.openrewrite.hcl.HclParsingException: Syntax error in file.tf at line 9:18 mismatched input ':' expecting {'}', Identifier, '[', '?', '.'}.
	at org.openrewrite.hcl.HclParser$ForwardingErrorListener.syntaxError(HclParser.java:105)
	... 26 more
Caused by: org.antlr.v4.runtime.InputMismatchException
	at org.antlr.v4.runtime.DefaultErrorStrategy.recoverInline(DefaultErrorStrategy.java:485)
	at org.antlr.v4.runtime.Parser.match(Parser.java:208)
	at org.openrewrite.hcl.internal.grammar.HCLParser.blockExpr(HCLParser.java:1104)
	... 21 more
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request parser-hcl
Projects
Status: No status
Development

No branches or pull requests

1 participant