feat: or keyword (#315)

Add `or` operator to Rego languages. Available via `rego-extensions`
Cargo feature.

If the evaluated lhs value is not false, null or undefined it is returned.
Otherwise rhs is evaluated and returned.

or operator has least precedence, and is left-associative.

closes #314
This commit is contained in:
Anand Krishnamoorthi
2024-09-13 16:39:19 -07:00
committed by GitHub
parent 8498274356
commit 7565ec3ecf
11 changed files with 197 additions and 26 deletions
+6 -1
View File
@@ -67,7 +67,9 @@ full-opa = [
"time",
"uuid",
"urlquery",
"yaml"
"yaml",
#"rego-extensions"
]
# Features that can be used in no_std environments.
@@ -89,6 +91,9 @@ opa-no-std = [
"lazy_static/spin_no_std"
]
# Rego language extensions
rego-extensions = []
# This feature enables some testing utils for OPA tests.
opa-testutil = []
rand = ["dep:rand"]