diff options
| author | Hugo Herbelin | 2019-11-14 07:31:37 +0100 |
|---|---|---|
| committer | Hugo Herbelin | 2020-02-22 22:34:37 +0100 |
| commit | 556e9dde62b6822db20bd5c7e6e6a67bc717c408 (patch) | |
| tree | 65d0d09683a896d4aecba98139e45edd608a19a7 /interp | |
| parent | 67e16fdeef26455d0afa357e31de8f7b3f772034 (diff) | |
Deactivate implicit arguments in printing notations bound to "@f".
This is to match the parsing policy (see #11091).
In particular, we deactivate also argument scopes, consistently with
what is done at parsing time.
Diffstat (limited to 'interp')
| -rw-r--r-- | interp/constrextern.ml | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/interp/constrextern.ml b/interp/constrextern.ml index 681d6ba541..362fe83ffa 100644 --- a/interp/constrextern.ml +++ b/interp/constrextern.ml @@ -1211,9 +1211,14 @@ and extern_notation (custom,scopes as allscopes) vars t rules = let (t,args,argsscopes,argsimpls) = match n with | Some n when nallargs >= n -> let args1, args2 = List.chop n args in - let args2scopes = try List.skipn n argsscopes with Failure _ -> [] in - let args2impls = try List.skipn n argsimpls with Failure _ -> [] in - (* Note: NApp(NRef f,[]), hence n=0, encodes @f *) + let args2scopes = + if n = 0 then [] else try List.skipn n argsscopes with Failure _ -> [] in + let args2impls = + if n = 0 then + (* Note: NApp(NRef f,[]), hence n=0, encodes @f and + conventionally deactivates implicit arguments *) + [] + else try List.skipn n argsimpls with Failure _ -> [] in DAst.make @@ GApp (f,args1), args2, args2scopes, args2impls | None -> begin match DAst.get f with |
