riolet / rix

Rix language combines the power of C language and the convenience of a high level language
GNU General Public License v3.0
729 stars 27 forks source link

for loop variable #16

Closed JoePelz closed 9 years ago

JoePelz commented 9 years ago

Question. Should this work?

i = 3
i for 5, 10
  echo i + " "

Right now the for loop fails because i is already defined.

JoePelz commented 9 years ago

It should work. Needs a fix now to allow it

JoePelz commented 9 years ago

As of c65cbabf9f6ca03d46dd2f975821586452a3e64b, the above code compiles. However, this is still an issue because the following code now compiles (to uncompilable C code):

3 for 5, 10
  doStuff

//compiles into:
// for (3=5;3<(10);3 ++)
JoePelz commented 9 years ago

Fixed the above issue with commit 796e9876d17a27547e9cb42a353c1698aa79e3e3

This is still a band-aid on the bigger problem of differentiating between the integer i and the integer 3.