parent
4d36effe85
commit
a009541b6e
1 changed files with 21 additions and 0 deletions
21
tests/lean/run/1089.lean
Normal file
21
tests/lean/run/1089.lean
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
import init.string
|
||||
import init.bool
|
||||
import system.io
|
||||
|
||||
inductive token
|
||||
| eof : token
|
||||
| plus : token
|
||||
| var : string -> token
|
||||
|
||||
open token
|
||||
open option
|
||||
|
||||
def to_token : string → option token
|
||||
| [] := none
|
||||
| (c :: cs) :=
|
||||
let t : option token := match c with
|
||||
| #"x" := some (var "x")
|
||||
| #"y" := some (var "y")
|
||||
| #"+" := some plus
|
||||
| _ := none
|
||||
end in t
|
||||
Loading…
Add table
Reference in a new issue