Skip to content

Commit

Permalink
change js backend to prefix constants (free variables) with vc$ inste…
Browse files Browse the repository at this point in the history
…ad of just v #80
  • Loading branch information
shinnar committed Jan 11, 2018
1 parent 01619fd commit 97e51e4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions coq/Translation/NNRCtoJavaScript.v
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ Section NNRCtoJavaScript.
* string (* JavaScript expression holding result *)
* nat (* next available unused temporary *)
:= match n with
| NNRCGetConstant v => ("", "v" ++ v, t)
| NNRCGetConstant v => ("", "vc$" ++ v, t)
| NNRCVar v =>
match assoc_lookupr equiv_dec ivs v with
| Some v_string => ("", v_string, t)
Expand Down Expand Up @@ -398,7 +398,9 @@ Section NNRCtoJavaScript.
if (in_dec string_dec fv params)
then e'
else
(NNRCLet fv (NNRCUnop (OpDot fv) (NNRCVar input)) e')
(* note that this is a bit hacky, and relies on the NNRCLet translation to turn this into "vc$",
matching up with the translation of NNRCGetConstant *)
(NNRCLet ("c$" ++ fv) (NNRCUnop (OpDot fv) (NNRCVar input)) e')
in
fold_left wrap_one_free_var all_free_vars e.

Expand Down

0 comments on commit 97e51e4

Please sign in to comment.