let get_stmt_annots asked_bh s =
let do_annot acc a = match a with
| Before ( User {annot_content = AStmtSpec spec }
| AI (_,{annot_content = AStmtSpec spec }) )
-> add_stmt_spec asked_bh acc s spec
| After ( User { annot_content = AStmtSpec _spec }
| AI (_,{annot_content = AStmtSpec _spec }) ) ->
Wp_parameters.warning ~once:true
"Ignoring statement contract rooted after statement";
acc
| Before a -> add_code_annot true s asked_bh a acc
| After (User ca | AI (_, ca)) ->
Wp_parameters.warning
"Ignoring code annotation rooted after statement : %a"
!Ast_printer.d_code_annotation ca;
acc
in
let acc_before_after = List.fold_left do_annot ([], []) (Annotations.get s) in
acc_before_after