ligo/test/contracts/map_iter.tz

8 lines
244 B
Plaintext
Raw Normal View History

parameter (map int int);
return (pair int int);
storage unit;
code { CAR; PUSH int 0; DUP; PAIR; SWAP;
ITER { DIP {DUP; CAR; DIP{CDR}}; DUP; # Last instr
DIP{CAR; ADD}; SWAP; DIP{CDR; ADD}; PAIR };
UNIT; SWAP; PAIR}