2021-11-17 05:25:06 +00:00
|
|
|
module Restrict
|
|
|
|
|
|
|
|
export withLoop, buildOptUsage, checkKeepReturn, checkKeepArg, retrieve_records
|
|
|
|
|
|
|
|
|
|
|
|
func withLoop(xs: []string):
|
|
|
|
for x <- xs:
|
|
|
|
s: *string
|
|
|
|
s <<- x
|
|
|
|
|
|
|
|
func buildOpt() -> ?string:
|
|
|
|
s: *string
|
|
|
|
s <<- "none"
|
|
|
|
<- s
|
|
|
|
|
|
|
|
func buildOptUsage():
|
|
|
|
a <- buildOpt()
|
|
|
|
b <- buildOpt()
|
|
|
|
for x <- b:
|
|
|
|
z <- buildOpt()
|
|
|
|
|
|
|
|
func keepReturn() -> *string:
|
|
|
|
s: *string
|
|
|
|
s <<- "should be not restricted"
|
|
|
|
<- s
|
|
|
|
|
|
|
|
func checkKeepReturn() -> []string:
|
|
|
|
s <- keepReturn()
|
|
|
|
s <<- "and more"
|
|
|
|
<- s
|
|
|
|
|
|
|
|
func keepArg(arg: *string) -> []string:
|
|
|
|
arg <<- "push more"
|
|
|
|
<- arg
|
|
|
|
|
|
|
|
func checkKeepArg() -> []string, []string:
|
|
|
|
a: *string
|
|
|
|
keepArg(a)
|
|
|
|
y <- keepArg(a)
|
|
|
|
a <<- "more"
|
|
|
|
<- a, y
|
|
|
|
|
|
|
|
-- failing Aqua code:
|
2024-03-28 11:10:13 +00:00
|
|
|
service TestServiceRestrict("test-service"):
|
2021-11-17 05:25:06 +00:00
|
|
|
get_records(key: string) -> []string
|
|
|
|
|
|
|
|
func append_records(peer: string, srum: *[]string):
|
2024-03-28 11:10:13 +00:00
|
|
|
srum <- TestServiceRestrict.get_records(peer)
|
2021-11-17 05:25:06 +00:00
|
|
|
|
|
|
|
func retrieve_records(peer: string) -> [][]string:
|
|
|
|
records: *[]string
|
|
|
|
append_records(peer, records)
|
|
|
|
<- records
|