1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768(*
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/cpp_lib.ml *)[%%prepare_logger]moduleComparison=Diffast_core.ComparisonmoduleEdit=Diffast_core.EditmoduleLang=Diffast_core.LangmoduleCpp_lib_base=Cpp_base.Cpp_lib_baseincludeCpp_lib_basemoduleAnalyzing=Diffast_core.Analyzing.F(Label)moduleChange=Cpp_change.F(Label)[%%capture_pathletelaborate_editsoptions(cenv:(Tree.node_t,Tree.c)Comparison.c)uidmappingedits=ifoptions#rename_rectification_level>0thenbeginletmkfilt=Edit.mkfiltFact.getlabin(*let is_type_decl_stmt = mkfilt Label.is_type_decl_stmt in*)letis_named=mkfiltLabel.is_namedinletfilters=[|is_named;|]inletmax_count=2inlethandle_weak=notoptions#dump_delta_flaginletcount=ref0inletmodified=reftrueinwhile!modified&&!count<max_countdoincrcount;[%debug_log"%d-th execution of rename rectification"!count];modified:=Edit.rectify_renames_u~handle_weakoptionscenvuidmappingeditsfiltersdoneend]let_=Lang.registerScpp.parser_name(newLang.c~make_tree_comparator:(newAnalyzing.tree_comparator)~make_tree_builder:(newtree_builder)~extract_change:Change.extract~extract_fact:Fact.extract~node_filter:Fact.node_filter~node_pair_filter:Fact.node_pair_filter~elaborate_edits:(Someelaborate_edits))