Skip to content

Commit

Permalink
juggle some strings to detect module sub-types (see HaxeFoundation#2263)
Browse files Browse the repository at this point in the history
  • Loading branch information
Simn committed Feb 21, 2015
1 parent 9e790a1 commit 43b811d
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions main.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1686,10 +1686,14 @@ with
)
| Some (c,cur_package) ->
try
let sl_pack,s_module = match List.rev p with
| s :: sl when s.[0] >= 'A' && s.[0] <= 'Z' -> List.rev sl,s
| _ -> p,c
in
let ctx = Typer.create com in
let rec lookup p =
try
Typeload.load_module ctx (p,c) Ast.null_pos
Typeload.load_module ctx (p,s_module) Ast.null_pos
with e ->
if cur_package then
match List.rev p with
Expand All @@ -1698,19 +1702,20 @@ with
else
raise e
in
let m = lookup p in
let m = lookup sl_pack in
let statics = ref None in
let public_types = List.filter (fun t ->
let tinfos = t_infos t in
if is_import && snd tinfos.mt_path = c then begin match t with
let is_module_type = snd tinfos.mt_path = c in
if is_import && is_module_type then begin match t with
| TClassDecl c ->
ignore(c.cl_build());
statics := Some c.cl_ordered_statics
| _ -> ()
end;
not tinfos.mt_private
snd tinfos.mt_path <> s_module && not tinfos.mt_private
) m.m_types in
let types = List.map (fun t -> snd (t_path t),"",Some Typer.FKType,"") public_types in
let types = if c <> s_module then [] else List.map (fun t -> snd (t_path t),"",Some Typer.FKType,"") public_types in
let ctx = print_context() in
let make_field_doc cf =
cf.cf_name,
Expand Down

0 comments on commit 43b811d

Please sign in to comment.