ligo/super-counter.pp.ligo

66 lines
559 B
Plaintext
Raw Normal View History

2019-09-20 20:56:55 +04:00
# 1 "./src/test/contracts/super-counter.ligo"
# 1 "<built-in>"
# 1 "<command-line>"
# 31 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 17 "/usr/include/stdc-predef.h" 3 4
# 32 "<command-line>" 2
# 1 "./src/test/contracts/super-counter.ligo"
type action is
| Increment of int
| Decrement of int
function main (const p : action ; const s : int) : (list(operation) * int) is
block {skip} with ((nil : list(operation)),
case p of
| Increment (n) -> s + n
| Decrement (n) -> s - n
end)