fix(frontends/lean/pp): bug in pretty printer notation match procedure
This commit is contained in:
parent
2e9141b7e1
commit
8a44dfc1df
3 changed files with 16 additions and 0 deletions
|
@ -612,6 +612,8 @@ bool pretty_fn::match(expr const & p, expr const & e, buffer<optional<expr>> & a
|
|||
} else if (is_placeholder(p)) {
|
||||
return true;
|
||||
} else if (is_constant(p) && is_constant(e)) {
|
||||
if (const_name(p) != const_name(e))
|
||||
return false;
|
||||
levels p_ls = const_levels(p);
|
||||
levels e_ls = const_levels(p);
|
||||
while (!is_nil(p_ls)) {
|
||||
|
|
9
tests/lean/notation6.lean
Normal file
9
tests/lean/notation6.lean
Normal file
|
@ -0,0 +1,9 @@
|
|||
import logic data.num
|
||||
open num
|
||||
notation `o` := 10
|
||||
check 11
|
||||
constant f : num → num
|
||||
check o + 1
|
||||
check f o + o + o
|
||||
eval 9 + 1
|
||||
eval o+4
|
5
tests/lean/notation6.lean.expected.out
Normal file
5
tests/lean/notation6.lean.expected.out
Normal file
|
@ -0,0 +1,5 @@
|
|||
11 : num
|
||||
o + 1 : num
|
||||
f o + o + o : num
|
||||
o
|
||||
14
|
Loading…
Reference in a new issue