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

View File

@@ -385,6 +385,11 @@ fn yaml_test_impl(file: &str) -> Result<()> {
}
fn yaml_test(file: &str) -> Result<()> {
#[cfg(not(feature = "rego-extensions"))]
if file.contains("rego-extensions") {
return Ok(());
}
match yaml_test_impl(file) {
Ok(_) => Ok(()),
Err(e) => {