forked from open-policy-agent/opa
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
These changes add basic support for ir.Loop in the compiler. To handle the loop condition, the WASM library has been extended with a function to set the value of a local boolean. This allows the compiler to terminate the loop when a match is found. Signed-off-by: Torin Sandall <torinsandall@gmail.com>
- Loading branch information
Showing
9 changed files
with
114 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
cases: | ||
- note: iteration | ||
query: input.x[i] = 1 | ||
input: {"x": [3,2,1]} | ||
return_code: 1 | ||
- note: iteration (negative) | ||
query: input.x[i] = 1 | ||
input: {"x": [3,2,0]} | ||
return_code: 0 | ||
- note: iteration nested | ||
query: input.x[i] = 1; input.y[j] = "world" | ||
input: {"x": [3,2,1], "y": ["hello", "world"]} | ||
return_code: 1 | ||
- note: iteration nested (negative) | ||
query: input.x[i] = 1; input.y[j] = "world" | ||
input: {"x": [3,2,0], "y": ["hello", "universe"]} | ||
return_code: 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters