Skip to content
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

Support assignment infix (:=) in additional locations at file level #4555

Closed
5 tasks done
johanfylling opened this issue Apr 6, 2022 · 1 comment · Fixed by #4583
Closed
5 tasks done

Support assignment infix (:=) in additional locations at file level #4555

johanfylling opened this issue Apr 6, 2022 · 1 comment · Fixed by #4583

Comments

@johanfylling
Copy link
Contributor

johanfylling commented Apr 6, 2022

The following locations should support := assignments:

package play

# default value assignment
default p := 1

# else keyword
p := 2 {
   false
} else := 3 {
   true
}

# partial rule
o[msg] := 5 {
   msg = [1, 2, 3][_]
}

# function return value
f(x) := "bar!" {
    x == "foo"
}
  • default value assignment
  • else keyword
  • partial rules
  • function return
  • REPL (?)
@anderseknert
Copy link
Member

anderseknert commented Apr 6, 2022

Can we add function return values too? 🙂

f(x) := "bar!" {
    x == "foo"
}

johanfylling added a commit to johanfylling/opa that referenced this issue Apr 14, 2022
Uppdated support for:
* default values
* rules with `else` keyword
* partial rules
* functions

Fixes: open-policy-agent#4555

Signed-off-by: Johan Fylling <johan.dev@fylling.se>
johanfylling added a commit that referenced this issue Apr 20, 2022
Updated support for:
* default values
* rules with `else` keyword
* partial rules
* functions

Fixes: #4555

Signed-off-by: Johan Fylling <johan.dev@fylling.se>
rokkiter pushed a commit to rokkiter/opa that referenced this issue Apr 26, 2022
…gent#4583)

Updated support for:
* default values
* rules with `else` keyword
* partial rules
* functions

Fixes: open-policy-agent#4555

Signed-off-by: Johan Fylling <johan.dev@fylling.se>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants