-
Notifications
You must be signed in to change notification settings - Fork 55
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
Parsing a multi-line conditional expression causes exception - Unexpected token Token('QMARK', '?') #77
Comments
Also running into this. I wonder if its as simple as editing https://github.com/amplify-education/python-hcl2/blob/master/hcl2/hcl2.lark#L12 to be
|
Yeah this should do it
|
Seems like adding the first As another method I tried adding the Any ideas? @ianvonseggern1 @kartikp10 |
Yeah I noticed the same when I tried it :( Unfortunately I'm really not familiar with lark so I have very few ideas about what to try next |
Raised a PR to fix this - #128 |
The PR was merged. This issue can be closed now. |
I'm still able to reproduce this on 4.3.4: hcl2.loads("""\
locals {
v = (
true
? 1
: 0
)
}
""") produces
|
Hello!
I have observed that parsing a ternary expression fails if the expression is using multiple lines. For example:
Loading this file with
hcl2.load(file)
will result in this exception:If, however, the expression is in a single line, the parsing will work fine.
The text was updated successfully, but these errors were encountered: