open-policy-agent / opa-idea-plugin

Open Policy Agent plugin for IntelliJ
MIT License
56 stars 23 forks source link

`:=` not allowed after `else` keyword #151

Closed brohacz closed 10 months ago

brohacz commented 1 year ago

Actual Behavior

image

Plugin reports an error for := assignment after else keyword.

Expected Behavior

No error reported as shown here: https://play.openpolicyagent.org/p/AfCBX28GQh

How To Reproduce

package play

test := "allow" {
    false
} else := "deny"

Environment

Additional context

opa-idea-plugin uses grammar for OPA from version older than v0.40.0. In version v0.40.0 the grammar was changed to allow := assignment operator after else keyword: https://www.openpolicyagent.org/docs/v0.40.0/policy-reference/#grammar

Suggested labels

bug #area/grammar