richardhundt/nyanga — pull request #23 by franko (2013-10-29 19:27:08+00:00)
Title: Fix bytecode generator to emit implicit return statement

Hi Richard,

now I beginning to understand the bytecode generator and it seems that I was even able to fix a bug. The Nyanga bytecode generator does not emit the instruction for the implicit return when required.

For example the following code raise an error:

```lua
i = 0
n = 10
function count()
if i < n then
i = i + 1
return i
end
end

for k in count do
print(k)
end
```

I propose a simple fix for this problem.

Francesco