-
Notifications
You must be signed in to change notification settings - Fork 8
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
Error parsing ternary operator assignment #20
Comments
@peterhuene would you mind taking a look at this one? |
The root cause of the issue is that the
This precludes
Then
The fix will need to be:
Where
Parsing a CST with |
@peterhuene You might already see this, but reading your fix for the situation I think that would introduce more problems. As I'm reading this, Maybe I'm not saying anything you didn't already realize, but this example is proving to me that we need to really fight with |
You're definitely correct! In the grammar we'd need the I also wouldn't call it I've updated the original suggestion to include the |
I can confirm that this is fixed with the new "experimental" parser implementation. With our intention to move away from the When we switch parser implementations, I'll resolve this as fixed. |
Hi folks, I think I found a subtle bug in parsing a particular type of ternary operator assignment. Here are the steps to reproduce:
MinimalParse.wdl
:wdl
crate. Here is a Rust snippet:if
in the original WDL, i.e.Int new_num=if (num>5) then 1 else 2
and rerun. It now parses successfully.I'm not defending the gross-looking syntax where there's no space after
if
, butwomtool validate
passes and cromwell does in fact run the original WDL, so this seems to be a parsing bug.Curiously enough, the bug doesn't seem to care about the other shifty looking lack of spaces. Adding a space before or after the
=
does nothing to fix this. It also doesn't seem to care if you use a space or not afterif
in normal blocks outside of a ternary assignment.The text was updated successfully, but these errors were encountered: