Allow assigning patterns to variables #827

Merged
ghallak merged 10 commits from ghallak/231 into master 2021-09-11 23:18:30 +09:00
Showing only changes of commit 34faf7bb57 - Show all commits

View File

@ -88,7 +88,7 @@ fold(Alg = #alg{zero = Zero, plus = Plus, scoped = Scoped}, Fun, K, X) ->
{map_get, _, A, B} -> Expr([A, B]); {map_get, _, A, B} -> Expr([A, B]);
{map_get, _, A, B, C} -> Expr([A, B, C]); {map_get, _, A, B, C} -> Expr([A, B, C]);
{block, _, Ss} -> Expr(Ss); {block, _, Ss} -> Expr(Ss);
{letpat, _, X, P} -> Scoped(BindExpr(X), Expr(P)); {letpat, _, X, P} -> Plus(BindExpr(X), Expr(P));
%% field() %% field()
{field, _, LV, E} -> Expr([LV, E]); {field, _, LV, E} -> Expr([LV, E]);
{field, _, LV, _, E} -> Expr([LV, E]); {field, _, LV, _, E} -> Expr([LV, E]);