feat(frontends/lean/parser): allow the user to write (Type) without providing a level
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
parent
9fb3ccb4c0
commit
6bc1537e25
1 changed files with 5 additions and 1 deletions
|
@ -801,7 +801,11 @@ expr parser_imp::parse_type(bool level_expected) {
|
||||||
auto p = pos();
|
auto p = pos();
|
||||||
next();
|
next();
|
||||||
if (level_expected) {
|
if (level_expected) {
|
||||||
return save(mk_type(parse_level()), p);
|
if (curr() == scanner::token::RightParen) {
|
||||||
|
return save(Type(), p);
|
||||||
|
} else {
|
||||||
|
return save(mk_type(parse_level()), p);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
return save(Type(), p);
|
return save(Type(), p);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue