Fix a bug in the fresh var names generation.
cf test/should_work/NONREG/fresh_name.lus where the local variable _n1e1_1 was defined twice ! The fix contist the following idea : prefix fresh var name by "_", except if at least one user ident begins by "_". In that case, we try to prefix them by "_1", and then "_2", and so on. We take the first possible one. nb : this won't work if the user defined idents from "_1" to "_1073741823" (on 32-bits machine), but I bet that this compiler would die before anyway...
Showing
- src/main.ml 7 additions, 7 deletionssrc/main.ml
- src/name.ml 86 additions, 5 deletionssrc/name.ml
- src/name.mli 6 additions, 7 deletionssrc/name.mli
- src/parserUtils.ml 14 additions, 5 deletionssrc/parserUtils.ml
- src/syntaxTree.ml 2 additions, 2 deletionssrc/syntaxTree.ml
- src/test/test.res.exp 272 additions, 265 deletionssrc/test/test.res.exp
Loading
Please register or sign in to comment