tylersmith34 / intellij-hashicorp-sentinel

This is a plugin for JetBrains IntelliJ to add language support for HashiCorp Sentinel.
Apache License 2.0
0 stars 1 forks source link

Boolean expressions without parentheses throws syntax error #1

Open tylersmith34 opened 4 years ago

tylersmith34 commented 4 years ago

I have been unable to express this statement in BNF syntax so that it parses without breaking other ways to express this logic.

if checkMyValue(x) and x < y {
    return x
}
tylersmith34 commented 4 years ago

There are two work arounds.

Reversing the order is parsing correctly

if x < y and checkMyValue(x) {
    return x
}

Or add parentheses around x < y

if checkMyValue(x) and (x < y) {
    return x
}