-
Notifications
You must be signed in to change notification settings - Fork 56
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
Unexpected Token parsing HCL/Terraform files with conditional statements. #149
Comments
I have this issue too, it seems like it's expecting parentheses. |
Hello, thanks for the report |
Hi @kkozik-amplify , I just hit the same and have managed to update the test case to show the failure (see this branch). I have been unable to find a solution so far as I am not that familiar with lark. |
@grahamhar Hi, thanks for the test case. |
It does appear that the files parse OK when we downgrade to I have been doing a little more testing and we have some conditionals that have embedded conditionals too.
|
Hi there, We could only reproduce this error this way in our unit test:
and (basically the same)
which would fail with other conditionals wouldn't cause issues. The workaround with parentheses also worked, but is not a viable option for us These didn't fail:
some other conditionals we tested (we also tested the failing one with parentheses, which passes)
(this module syntax is of course not correct, but it doesn't matter for the parser) |
Here is another file where this happens: |
here is also an example:
parsing fails only if it is nested and we have two with the ? : syntax |
Error:
When parsing a file that has a conditional assignment in it.
key = value == null ? "" : someothervalue
Any idea how I might fix or work around this? Or if a library fix is needed (or can even address this?)
The text was updated successfully, but these errors were encountered: