lean4-htt/tests/lean/run/elseIfConfusion.lean
Leonardo de Moura c7efb1d37d fix: do notation else if
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
2020-10-19 14:29:31 -07:00

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