File tree 3 files changed +49
-2
lines changed
3 files changed +49
-2
lines changed Original file line number Diff line number Diff line change 1
1
---
2
- refs/heads/master: d92e30d773e5358d982e7514d2ed5b2bc1b9c43f
2
+ refs/heads/master: 9dac49bcd613213347e1a6beba25d64bea2596b7
Original file line number Diff line number Diff line change @@ -489,6 +489,7 @@ let type_resolving_visitor
489
489
in
490
490
491
491
let visit_pexp_post p =
492
+ inner.Walk. visit_pexp_post p;
492
493
let rebuild_plval pl =
493
494
match pl with
494
495
Ast. PLVAL_ident _ -> pl
@@ -626,6 +627,7 @@ let lval_base_resolving_visitor
626
627
lookup_lval base;
627
628
match ext with
628
629
Ast. COMP_atom (Ast. ATOM_lval lv' ) -> lookup_lval lv'
630
+
629
631
| _ -> ()
630
632
end
631
633
| Ast. LVAL_base nb ->
@@ -659,8 +661,42 @@ let lval_base_resolving_visitor
659
661
reference_any_name lv;
660
662
inner.Walk. visit_lval_pre lv
661
663
in
664
+
665
+ let visit_pexp_pre p =
666
+ begin
667
+ match p.node with
668
+ Ast. PEXP_lval pl ->
669
+ begin
670
+ match pl with
671
+ (Ast. PLVAL_ident ident )
672
+ | (Ast. PLVAL_app (ident , _ )) ->
673
+ let id = lookup_defn_by_ident p.id ident in
674
+
675
+ iflog cx
676
+ (fun _ ->
677
+ log cx " resolved plval %a = #%d to defn #%d"
678
+ Ast. sprintf_plval pl
679
+ (int_of_node p.id) (int_of_node id));
680
+
681
+ (* Record the pexp -> defn mapping. *)
682
+ htab_put cx.ctxt_lval_base_id_to_defn_base_id p.id id;
683
+
684
+ (* Tickle the referenced-ness table if it's an item. *)
685
+ if defn_id_is_item cx id
686
+ then ignore (lookup_by_name cx [] (! scopes)
687
+ (plval_to_name pl))
688
+ | _ -> ()
689
+ end
690
+
691
+ | _ -> ()
692
+ end ;
693
+ inner.Walk. visit_pexp_pre p
694
+ in
695
+
662
696
{ inner with
663
- Walk. visit_lval_pre = visit_lval_pre };
697
+ Walk. visit_lval_pre = visit_lval_pre;
698
+ Walk. visit_pexp_pre = visit_pexp_pre
699
+ };
664
700
;;
665
701
666
702
Original file line number Diff line number Diff line change @@ -577,6 +577,17 @@ let rec lval_to_name (lv:Ast.lval) : Ast.name =
577
577
Ast. NAME_ext (lval_to_name lv, comp)
578
578
;;
579
579
580
+ let rec plval_to_name (pl :Ast.plval ) : Ast.name =
581
+ match pl with
582
+ Ast. PLVAL_ident ident ->
583
+ Ast. NAME_base (Ast. BASE_ident ident)
584
+ | Ast. PLVAL_app (ident , tys ) ->
585
+ Ast. NAME_base (Ast. BASE_app (ident, tys))
586
+ | Ast. PLVAL_ext_name ({node = Ast. PEXP_lval pl } , nc ) ->
587
+ Ast. NAME_ext (plval_to_name pl, nc)
588
+ | _ -> bug () " plval_to_name with plval that contains non-name components"
589
+ ;;
590
+
580
591
581
592
(* Type extraction. *)
582
593
You can’t perform that action at this time.
0 commit comments