Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Source file cpp_change.ml
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120(*
Copyright 2012-2025 Codinuum Software Lab <https://codinuum.com>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)(* cpp/change.ml *)moduleChange_base=Diffast_core.Change_basemoduleTriple=Diffast_core.TriplemoduleInfo=Diffast_core.InfomoduleEdit=Diffast_core.EditmoduleCpp_label=Cpp_base.Cpp_labelmoduleUID=Diffast_misc.UIDmoduleF(L:Cpp_label.T)=structmoduleI=InfomoduleE=Edit(*let sprintf = Printf.sprintf*)includeChange_basemoduleCB=F(L)(* predicates *)letgetlab=L.getlabletis_namednd=L.is_named(getlabnd)letis_translation_unitnd=L.is_translation_unit(getlab nd)(* *)letget_unittreend=tryletu=tree#get_nearest_containing_unitndinu#data#labelwithNot_found->""letids_to_strids=ifids=[]then""elsesprintf"{%s}"(String.concat","ids)letsubtree_to_strtreend=sprintf"[%s]"(tree#subtree_to_simple_stringnd#gindex)letget_desc1(*is_whole*)_treend=letids=tree#get_ident_use_listnd#gindexinletextra2=if(* is_whole *)truethensubtree_to_strtreendelse""innd#data#label^(ids_to_strids)^extra2letget_desc2tree1tree2nd1nd2=letids1=tree1#get_ident_use_listnd1#gindexinletids2=tree2#get_ident_use_listnd2#gindexinsprintf"%s%s%s -> %s%s%s"nd1#data#label(ids_to_strids1)(subtree_to_strtree1nd1)nd2#data#label(ids_to_strids2)(subtree_to_strtree2nd2)(* class Change.F.c *)classcoptionstree1tree2uidmappingeditsget_unitget_desc1get_desc2=object(self)inheritCB.coptionstree1tree2uidmappingeditsget_unitget_desc1get_desc2method!make_changes_list()=letmkt_del=self#mkt_deleted~category:Triple.ghostinletmkt_ins=self#mkt_inserted~category:Triple.ghostin(*let mkt_mod = self#mkt_modified ~category:Triple.ghost in*)letmkt_chgto=self#mkt_changed_to~category:Triple.ghostinletmkt_ren=self#mkt_renamed~category:Triple.ghostinletmkt_mov=self#mkt_moved_to~category:Triple.ghostinletmkt_odrchg=self#mkt_order_changed~category:Triple.ghostin(* let mkt_chgcard _ = [] in *)[(* others *)"(removed)",Slow,(self#make_delete_st(fun_->true)),mkt_del;"(added)",Slow,(self#make_insert_st(fun_->true)),mkt_ins;"(deleted)",Slow,(self#make_delete(fun_->true)),mkt_del;"(inserted)",Slow,(self#make_insert(fun_->true)),mkt_ins;"(moved)",Slow,(self#make_move(fun_->true)),mkt_mov;"(changed)",Slow,(self#make_changed_to(fun_->true)),mkt_chgto;"(renamed)",Slow,(self#make_renamingis_named),mkt_ren;"(order changed)",Slow,(self#make_order_change(fun_->true)),mkt_odrchg;](* end of method make_changes_list *)end(* of class Change.F.c *)letextractoptionstree1tree2uidmappingedits=letchg=newcoptionstree1tree2uidmappingeditsget_unitget_desc1get_desc2inletres=chg#extractinchg#recover_edits;resend(* of functor Change.F *)