SquidDev-CC / Howl

A CC build system
http://www.computercraft.info/forums2/index.php?/topic/21254-
MIT License
16 stars 4 forks source link

AST Node #11

Closed SquidDev closed 9 years ago

SquidDev commented 9 years ago

Currently renaming variables is broken, especially for loop variables. The trouble lies where normal variables are renamed so they conflict with existing variables:

local something = "HELLO"
local a = "HELLO"
for t=1,10 do print(a) end

becomes:

local t = "HELLO"
for t=1,10 do print(t) end

The second loop is broken. We could fix this with a proper set of nodes maybe?

What is happening is something is converted to e. Then e is converted to t for some reason?

SquidDev commented 9 years ago

This was a very obvious solution. I've looked at everything and it seems to work. I don't think there would be any advantages of re-writing the nodes.