2019-02-26 01:29:29 +04:00
|
|
|
type t is int * string
|
|
|
|
type u is t
|
|
|
|
type v is record foo: key; bar: mutez; baz: address end
|
2019-03-07 20:06:02 +04:00
|
|
|
type w is K of (U of int) (*v * u*)
|
2019-02-26 01:29:29 +04:00
|
|
|
|
2019-03-10 22:41:27 +04:00
|
|
|
storage s : w // Line comment
|
2019-03-14 12:59:26 +04:00
|
|
|
type i is int;
|
2019-03-10 22:41:27 +04:00
|
|
|
operations o : u;
|
2019-03-14 12:59:26 +04:00
|
|
|
const pi : int = 314159
|
2019-02-26 01:29:29 +04:00
|
|
|
|
2019-03-14 12:59:26 +04:00
|
|
|
const x : v =
|
|
|
|
record
|
|
|
|
foo = 4;
|
|
|
|
bar = 5;
|
|
|
|
baz = 0x3244
|
|
|
|
end
|
2019-03-11 15:51:50 +04:00
|
|
|
|
2019-02-28 18:46:34 +04:00
|
|
|
(* Block comment *)
|
2019-02-26 01:29:29 +04:00
|
|
|
|
2019-03-10 16:37:03 +04:00
|
|
|
entrypoint g (const l : list (int)) is
|
2019-03-14 12:59:26 +04:00
|
|
|
|
|
|
|
var y : v := copy x with record bar = 7 end;
|
|
|
|
|
|
|
|
function f (const x : int) : int is
|
2019-02-28 18:46:34 +04:00
|
|
|
var y : int := 5 - x
|
|
|
|
const z : int = 6
|
|
|
|
begin
|
|
|
|
y := x + y
|
|
|
|
end with y * 2
|
2019-03-14 12:59:26 +04:00
|
|
|
|
2019-02-26 01:29:29 +04:00
|
|
|
begin
|
|
|
|
match l with
|
2019-03-14 12:59:26 +04:00
|
|
|
[] -> null
|
2019-03-07 20:06:02 +04:00
|
|
|
| h#t -> q (h+2)
|
2019-03-11 15:51:50 +04:00
|
|
|
end;
|
|
|
|
begin
|
|
|
|
g (Unit);
|
|
|
|
fail "in extremis"
|
2019-02-26 01:29:29 +04:00
|
|
|
end
|
|
|
|
end
|