|
@@ -840,27 +840,25 @@ and parse_class_field tdecl s =
|
|
|
| [< f = parse_function_field doc meta al >] ->
|
|
|
f
|
|
|
| [< >] ->
|
|
|
- let check_override_completion po =
|
|
|
- (* If there's an identifier in the stream, it must be a unfinished filter for
|
|
|
- an override completion, e.g. `override toStr|`. In that case we simply ignore
|
|
|
- the identifier. *)
|
|
|
- begin match Stream.peek s with
|
|
|
- | Some (Const (Ident _),_) -> Stream.junk s
|
|
|
- | _ -> ()
|
|
|
- end;
|
|
|
- would_skip_display_position po s
|
|
|
- in
|
|
|
begin match List.rev al with
|
|
|
| [] -> raise Stream.Failure
|
|
|
- | (AOverride,po) :: _ when check_override_completion po ->
|
|
|
- let f = {
|
|
|
- f_params = [];
|
|
|
- f_args = [];
|
|
|
- f_type = None;
|
|
|
- f_expr = None
|
|
|
- } in
|
|
|
- let _,p2 = next_token s in
|
|
|
- (magic_display_field_name,p2),punion po p2,FFun f,al,meta
|
|
|
+ | (AOverride,po) :: _ ->
|
|
|
+ begin match check_completion po s with
|
|
|
+ | None ->
|
|
|
+ serror()
|
|
|
+ | Some(so,p) ->
|
|
|
+ let f = {
|
|
|
+ f_params = [];
|
|
|
+ f_args = [];
|
|
|
+ f_type = None;
|
|
|
+ f_expr = None
|
|
|
+ } in
|
|
|
+ let name = match so with
|
|
|
+ | None -> ""
|
|
|
+ | Some s -> s
|
|
|
+ in
|
|
|
+ (name,p),punion po p,FFun f,al,(Meta.DisplayOverride,[],null_pos) :: meta
|
|
|
+ end
|
|
|
| _ -> serror()
|
|
|
end
|
|
|
) in
|