Fix scope error in CPS application

This commit is contained in:
Théophile Bastian 2018-02-15 22:43:15 +01:00
parent 38148932f7
commit b00976d359

View file

@ -51,9 +51,13 @@ let rec cps_term_inner (t: S.term) (cont: T.variable) (nameHint: string option)
and fCont = freshBlockVar () in
let xVal = freshVarHinted nameHint
and fVal = freshVar () in
letCont fCont fVal (T.TailCall(T.vvar fVal, T.vvars [xVal; cont])) @@
letCont xCont xVal (cps_term_inner f fCont None) @@
letCont xCont xVal (
letCont fCont fVal
(T.TailCall(T.vvar fVal, T.vvars [xVal; cont])) @@
(cps_term_inner f fCont None)) @@
cps_term_inner x xCont None
| S.Print term ->
let curCont = freshBlockVar ()
and termVal = freshVar () in