Dan Korostelev 7 rokov pred
rodič
commit
6a966a4778

+ 2 - 2
src/compiler/displayOutput.ml

@@ -72,9 +72,9 @@ let print_toplevel il =
 	List.iter (fun id -> match id with
 		| IdentifierType.ITLocal v ->
 			if check_ident v.v_name then Buffer.add_string b (Printf.sprintf "<i k=\"local\" t=\"%s\">%s</i>\n" (s_type v.v_type) v.v_name);
-		| IdentifierType.ITMember(c,cf) ->
+		| IdentifierType.ITMember cf ->
 			if check_ident cf.cf_name then Buffer.add_string b (Printf.sprintf "<i k=\"member\" t=\"%s\"%s>%s</i>\n" (s_type cf.cf_type) (s_doc cf.cf_doc) cf.cf_name);
-		| IdentifierType.ITStatic(c,cf) ->
+		| IdentifierType.ITStatic cf ->
 			if check_ident cf.cf_name then Buffer.add_string b (Printf.sprintf "<i k=\"static\" t=\"%s\"%s>%s</i>\n" (s_type cf.cf_type) (s_doc cf.cf_doc) cf.cf_name);
 		| IdentifierType.ITEnum(en,ef) ->
 			if check_ident ef.ef_name then Buffer.add_string b (Printf.sprintf "<i k=\"enum\" t=\"%s\"%s>%s</i>\n" (s_type ef.ef_type) (s_doc ef.ef_doc) ef.ef_name);

+ 3 - 3
src/context/common.ml

@@ -219,8 +219,8 @@ type compiler_callback = {
 module IdentifierType = struct
 	type t =
 		| ITLocal of tvar
-		| ITMember of tclass * tclass_field
-		| ITStatic of tclass * tclass_field
+		| ITMember of tclass_field
+		| ITStatic of tclass_field
 		| ITEnum of tenum * tenum_field
 		| ITEnumAbstract of tabstract * tclass_field
 		| ITGlobal of module_type * string * Type.t
@@ -231,7 +231,7 @@ module IdentifierType = struct
 
 	let get_name = function
 		| ITLocal v -> v.v_name
-		| ITMember(_,cf) | ITStatic(_,cf) | ITEnumAbstract(_,cf) -> cf.cf_name
+		| ITMember cf | ITStatic cf | ITEnumAbstract(_,cf) -> cf.cf_name
 		| ITEnum(_,ef) -> ef.ef_name
 		| ITGlobal(_,s,_) -> s
 		| ITType mt -> snd (t_infos mt).mt_path

+ 4 - 6
src/context/displayFields.ml

@@ -35,12 +35,10 @@ let collect ctx e_ast e with_type p =
 	let merge_core_doc = !merge_core_doc_ref in
 	let opt_args args ret = TFun(List.map(fun (n,o,t) -> n,true,t) args,ret) in
 	let e = match e.eexpr with
-		| TField (e1,fa) ->
-			if field_name fa = "bind" then (match follow e1.etype with
-				| TFun(args,ret) -> {e1 with etype = opt_args args ret}
-				| _ -> e)
-			else
-				e
+		| TField (e1,fa) when field_name fa = "bind" ->
+			(match follow e1.etype with
+			| TFun(args,ret) -> {e1 with etype = opt_args args ret}
+			| _ -> e)
 		| _ ->
 			e
 	in

+ 2 - 2
src/context/displayToplevel.ml

@@ -65,7 +65,7 @@ let collect ctx only_types =
 		if ctx.curfun <> FunStatic then begin
 			let rec loop c =
 				List.iter (fun cf ->
-					if not (Meta.has Meta.NoCompletion cf.cf_meta) then add (ITMember(ctx.curclass,cf))
+					if not (Meta.has Meta.NoCompletion cf.cf_meta) then add (ITMember cf)
 				) c.cl_ordered_fields;
 				match c.cl_super with
 					| None ->
@@ -79,7 +79,7 @@ let collect ctx only_types =
 
 		(* statics *)
 		List.iter (fun cf ->
-			if not (Meta.has Meta.NoCompletion cf.cf_meta) then add (ITStatic(ctx.curclass,cf))
+			if not (Meta.has Meta.NoCompletion cf.cf_meta) then add (ITStatic cf)
 		) ctx.curclass.cl_ordered_statics;
 
 		(* enum constructors *)