-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
fabf8d7
commit a5b6102
Showing
24 changed files
with
1,311 additions
and
448 deletions.
There are no files selected for viewing
File renamed without changes.
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,40 @@ | ||
aqua Bool | ||
|
||
export main, Effector | ||
|
||
service Effector("effector"): | ||
effect(name: string) -> bool | ||
|
||
func foo(x: i8) -> bool: | ||
y = x + 1 | ||
<- y < 5 | ||
|
||
func bar(x: i8) -> i8: | ||
y = x - 1 | ||
<- y | ||
|
||
func main(peer: string) -> []bool: | ||
res: *bool | ||
|
||
on peer: | ||
a = 1 + 2 | ||
b = 2 - 1 | ||
res <<- true || false && true -- true | ||
res <<- (true || false) && true -- true | ||
res <<- foo(3) && b > 0 || a > 4 -- true | ||
res <<- bar(a) > 2 || true -- true | ||
res <<- foo(4) && bar(2) < 2 -- false | ||
res <<- !foo(10) && !!true -- true | ||
res <<- !(bar(2) < 1) || !!(a < 2) -- true | ||
|
||
-- Effector is only registered on init_peer | ||
res <<- true || Effector.effect("impossible") -- true | ||
res <<- !!false && Effector.effect("impossible") -- false | ||
res <<- foo(0) || Effector.effect("impossible") -- true | ||
res <<- foo(10) && Effector.effect("impossible") -- false | ||
res <<- Effector.effect("true") || true -- true | ||
res <<- Effector.effect("true") && false -- false | ||
res <<- !foo(10) || Effector.effect("impossible") -- true | ||
res <<- !(1 < 2) && !Effector.effect("impossible") -- false | ||
|
||
<- res |
Oops, something went wrong.