2018-02-02 20:00:33 +04:00
|
|
|
parameter (or string (option int));
|
2018-04-05 19:17:27 +04:00
|
|
|
storage string;
|
2018-02-02 20:00:33 +04:00
|
|
|
code { CAR; # Access the storage
|
|
|
|
IF_LEFT {} # The string is on top of the stack, nothing to do
|
|
|
|
{ IF_NONE { FAIL} # Fail if None
|
|
|
|
{ PUSH int 0; CMPGT; # Check for negative number
|
|
|
|
IF {FAIL} # Fail if negative
|
|
|
|
{PUSH string ""}}}; # Push the empty string
|
2018-04-05 19:17:27 +04:00
|
|
|
NIL operation; PAIR} # Calling convention
|