More ReasonLIGO pretty printer improvements.
This commit is contained in:
parent
db0fdf4abd
commit
63086db0f1
@ -46,8 +46,11 @@ and pp_let_binding let_ (binding : let_binding) =
|
||||
| Some (_,e) ->
|
||||
patterns ^^ group (break 0 ^^ string ": " ^^ pp_type_expr e ^^ string " = ")
|
||||
in
|
||||
let rhs = pp_expr let_rhs
|
||||
in prefix 2 0 lhs rhs
|
||||
let rhs = pp_expr let_rhs in
|
||||
match let_rhs with
|
||||
| ESeq _
|
||||
| ERecord _ -> lhs ^^ rhs
|
||||
| _ -> prefix 2 0 lhs rhs
|
||||
|
||||
and pp_pattern = function
|
||||
PConstr p -> pp_pconstr p
|
||||
|
@ -2,8 +2,7 @@ type storage = (int, int);
|
||||
|
||||
let main =
|
||||
(n: (int, storage)): (list(operation), storage) => {
|
||||
let x: (int, int) =
|
||||
{
|
||||
let x: (int, int) = {
|
||||
let x: int = 7;
|
||||
(x + n[0], n[1][0] + n[1][1])
|
||||
};
|
||||
|
@ -12,7 +12,10 @@ type sum_aggregator = {counter: int, sum: int };
|
||||
|
||||
let counter =
|
||||
(n: int): int => {
|
||||
let initial: sum_aggregator = {counter: 0, sum: 0 };
|
||||
let initial: sum_aggregator = {
|
||||
counter: 0,
|
||||
sum: 0
|
||||
};
|
||||
let rec aggregate =
|
||||
(prev: sum_aggregator): int =>
|
||||
if(prev.counter <= n) {
|
||||
@ -40,7 +43,10 @@ let rec aux_nest =
|
||||
|
||||
let counter_nest =
|
||||
(n: int): int => {
|
||||
let initial: sum_aggregator = {counter: 0, sum: 0 };
|
||||
let initial: sum_aggregator = {
|
||||
counter: 0,
|
||||
sum: 0
|
||||
};
|
||||
let out: sum_aggregator = aux_nest(initial);
|
||||
out.sum
|
||||
};
|
||||
|
@ -18,11 +18,10 @@ let i = (a: int, b: int) => a + b;
|
||||
|
||||
let j = (a: int, b: int) => a - b;
|
||||
|
||||
let m =
|
||||
{
|
||||
let m = {
|
||||
let z = 3;
|
||||
z
|
||||
};
|
||||
};
|
||||
|
||||
let n = (a: int): int => a + 1;
|
||||
|
||||
@ -32,28 +31,25 @@ let n = (a: int, b: int): int => a + 1;
|
||||
|
||||
let o = (a: int, b: int): int => a + 1;
|
||||
|
||||
let p =
|
||||
{
|
||||
let p = {
|
||||
{
|
||||
3
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
let q =
|
||||
{
|
||||
let q = {
|
||||
f: 3,
|
||||
g: 6,
|
||||
h: {i: "bla", j: 1 + 2, k: {l: 1, z: 2 } }
|
||||
};
|
||||
};
|
||||
|
||||
let s =
|
||||
{
|
||||
let s = {
|
||||
let a = 2;
|
||||
{
|
||||
z: a,
|
||||
a: a
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
let t = (((((((2)))))));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user