The following `do` block
```lean
if c_1 then
action_1
else
if cond_2 then
action_2
action_3
```
was being being parsed as
```lean
if c_1 then
action_1
else if cond_2 then
action_2
action_3
```
cc @Kha
11 lines
187 B
Text
11 lines
187 B
Text
#lang lean4
|
|
|
|
def tst (x : Nat) : IO Unit := do
|
|
if x == 0 then
|
|
IO.println "x is zero"
|
|
else
|
|
if x == 1 then
|
|
IO.println "x is one"
|
|
throw $ IO.userError "x is not zero"
|
|
|
|
#eval tst 0
|