Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

An ELIF condition right after a taken IF/ELIF block is still evaluated #764

Closed
Rangi42 opened this issue Feb 25, 2021 · 1 comment · Fixed by #798
Closed

An ELIF condition right after a taken IF/ELIF block is still evaluated #764

Rangi42 opened this issue Feb 25, 2021 · 1 comment · Fixed by #798
Labels
bug Unexpected behavior / crashes; to be fixed ASAP! rgbasm This affects RGBASM

Comments

@Rangi42
Copy link
Contributor

Rangi42 commented Feb 25, 2021

In this example:

if 1
    println "one"
elif 2
    println "two"
elif 3 / 0
    println "oops"
endc

it prints one without an error. However, change if 1 to if 0, and it prints two but then evaluates the 3 / 0 and has a fatal "Division by zero" error.

pret pokecrystal works around this by turning an elif into a nested else if in its dict macro.

@Rangi42 Rangi42 added bug Unexpected behavior / crashes; to be fixed ASAP! rgbasm This affects RGBASM labels Feb 25, 2021
@Rangi42
Copy link
Contributor Author

Rangi42 commented Feb 25, 2021

This might have to wait for lazy-evaluated expressions.

Rangi42 added a commit to Rangi42/rgbds that referenced this issue Mar 22, 2021
Rangi42 added a commit to Rangi42/rgbds that referenced this issue Mar 22, 2021
Rangi42 added a commit to Rangi42/rgbds that referenced this issue Mar 22, 2021
ISSOtm pushed a commit that referenced this issue Mar 23, 2021
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Unexpected behavior / crashes; to be fixed ASAP! rgbasm This affects RGBASM
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant