-
Notifications
You must be signed in to change notification settings - Fork 496
Open
Labels
bugSomething isn't workingSomething isn't workinghclparsertest providedAlready replicated with a unit test, using JUnit pioneer's ExpectedToFailAlready replicated with a unit test, using JUnit pioneer's ExpectedToFail
Description
What version of OpenRewrite are you using?
Current main = 9e52e99
What is the smallest, simplest way to reproduce the problem?
The following test when added to HclParserTest:
@Test
void usingIf() {
rewriteRun(
hcl(
"""
resource "not_a_real_one_for_sure" deny {
if = "a"
}
"""
)
);
}fails with:
Caused by: org.openrewrite.hcl.HclParsingException: Syntax error in file.tf at line 2:2 mismatched input 'if' expecting {'null', '}', Identifier}.
at org.openrewrite.hcl.HclParser$ForwardingErrorListener.syntaxError(HclParser.java:108)
... 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:1111)
... 21 more
while I think this is a valid HCL source.
Terraform doesn't seem to have a problem with it.
OSS Repro
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinghclparsertest providedAlready replicated with a unit test, using JUnit pioneer's ExpectedToFailAlready replicated with a unit test, using JUnit pioneer's ExpectedToFail
Type
Projects
Status
Backlog