lean4-htt/tests/lean/run/parser_ir1.lean
Leonardo de Moura d5fe509c36 chore(*): remove end after each match-expression
`end` is not optional anymore
2018-05-04 11:30:06 -07:00

17 lines
456 B
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import system.io
import init.lean.ir.parser init.lean.ir.format
open lean.parser
open lean.ir
def show_result {α} [lean.has_to_format α] (p : parser α) (s : string) : io unit :=
match parse p s with
| except.ok a := io.print_ln (lean.to_fmt a)
| except.error e := io.print_ln (e.to_string s)
def IR := "
def succ (x : uint32) : uint32 :=
main: one : uint32 := 1; x1 : uint32 := add x one; ret x1;
"
#eval show_result (whitespace >> parse_def) IR