Do not evaluate an untaken ELIF's condition

Fixes #764
This commit is contained in:
Rangi
2021-03-22 00:25:22 -04:00
committed by Eldred Habert
parent 46d6652df1
commit aa99ed056c
6 changed files with 38 additions and 2 deletions

View File

@@ -0,0 +1,23 @@
if 1
println "taken if"
elif 2 / 0 ; avoided fatal "Division by zero" error
println "untaken elif"
elif 3 / 0 ; avoided fatal "Division by zero" error
println "untaken after untaken"
endc
if 0
println "untaken if"
elif 1
println "taken elif"
elif !@#$ ; avoided fatal syntax error
println "untaken elif"
elif %^&* ; avoided fatal syntax error
println "untaken after untaken"
endc
if 0
println "untaken if"
elif 1 / 0 ; fatal "Division by zero" error
println "unreached elif"
endc