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

? operator using the wrong previous value #20

Closed JoePelz closed 8 years ago

JoePelz commented 8 years ago

Nested if-statements can give incorrect results because of variable reuse. This issue will be fixed by implementing CodeBlock objects. Example:

1 < 2 if
  3 > 2 if
    echo "endpoint A "
  ? else
    echo "endpoint B "
? else
  echo "endpoint C "

Expected output is endpoint A Actual output is endpoint A, endpoint C do to the ? reusing boolean variables.

JoePelz commented 8 years ago

This issue has also been fixed, as of commit ab7b343825ff7dc5aa1074eb365e6143603d6dee