feat(frontends/lean/builtin_cmds): allow many namespaces in the same 'using' command
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
parent
d30f387e72
commit
b9d08ff28c
5 changed files with 48 additions and 48 deletions
|
@ -170,6 +170,7 @@ static void check_identifier(parser & p, environment const & env, name const & n
|
|||
// using [class] id (id ...) (renaming id->id id->id) (hiding id ... id)
|
||||
environment using_cmd(parser & p) {
|
||||
environment env = p.env();
|
||||
while (true) {
|
||||
name cls = parse_class(p);
|
||||
bool decls = cls.is_anonymous() || cls == g_decls || cls == g_declarations;
|
||||
name ns = p.check_id_next("invalid 'using' command, identifier expected");
|
||||
|
@ -217,6 +218,9 @@ environment using_cmd(parser & p) {
|
|||
if (!found_explicit)
|
||||
env = add_aliases(env, ns, name(), exceptions.size(), exceptions.data());
|
||||
}
|
||||
if (!p.curr_is_token(g_lbracket) && !p.curr_is_identifier())
|
||||
break;
|
||||
}
|
||||
return env;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import standard
|
||||
using num
|
||||
using pair
|
||||
using num pair
|
||||
|
||||
definition H : inhabited (Bool × num × (num → num)) := _
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import standard
|
||||
using num
|
||||
using pair
|
||||
using num pair
|
||||
|
||||
theorem H {A B : Type} (H1 : inhabited A) : inhabited (Bool × A × (B → num))
|
||||
:= _
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import standard
|
||||
using num
|
||||
using pair
|
||||
using num pair
|
||||
|
||||
section
|
||||
parameter {A : Type}
|
||||
|
|
|
@ -25,8 +25,7 @@ namespace nat
|
|||
end
|
||||
|
||||
section
|
||||
using algebra
|
||||
using nat
|
||||
using algebra nat
|
||||
variables a b c : nat
|
||||
check a * b * c
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue