.
This commit is contained in:
parent
0f5daafc29
commit
ed934019db
@ -654,17 +654,13 @@ expr_to_fcode(Env, _Type, {list, _, Es}) ->
|
||||
nil, Es);
|
||||
|
||||
expr_to_fcode(Env, _Type, {app, _, {'..', _}, [A, B]}) ->
|
||||
AV = fresh_name(),
|
||||
BV = fresh_name(),
|
||||
WithA = fun(X) -> {'let', AV, expr_to_fcode(Env, A), X} end,
|
||||
WithB = fun(X) -> {'let', BV, expr_to_fcode(Env, B), X} end,
|
||||
St = fresh_name(),
|
||||
Init = {var, AV},
|
||||
Loop = {loop, Init, St, make_if({op, '<', [{var, St}, {var, BV}]},
|
||||
Init = expr_to_fcode(Env, A),
|
||||
Loop = {loop, Init, St, make_if({op, '<', [{var, St}, expr_to_fcode(Env, B)]},
|
||||
{continue, {op, '+', [{var, St}, {lit, {int, 1}}]}},
|
||||
{break, nil}
|
||||
)},
|
||||
WithA(WithB(Loop));
|
||||
Loop;
|
||||
expr_to_fcode(Env, _Type, {app, _, {'..', _}, [A, B]}) ->
|
||||
AV = fresh_name(),
|
||||
BV = fresh_name(),
|
||||
|
Loading…
x
Reference in New Issue
Block a user