12345678910111213141516171819202122232425262728293031323334353637383940(**************************************************************************)(* *)(* SPDX-License-Identifier LGPL-2.1 *)(* Copyright (C) *)(* CEA (Commissariat à l'énergie atomique et aux énergies alternatives) *)(* *)(**************************************************************************)openServerletpackage=Package.package~plugin:"impact"~name:"impact"~title:"Impact"()(* Convert the result of the impact analysis into a list of localizables. *)letimpact_to_localizable_listimpact=letadd_kf_nodeskfnodesacc=letstmts=Compute_impact.nodes_to_stmtsnodesinletto_localizablestmt=Printer_tag.PStmtStart(kf,stmt)in(* Try to list statements in their order in the source code, as it is
more natural for the user. *)List.mapto_localizablestmts@accinKernel_function.Map.foldadd_kf_nodesimpact[]letimpact_statementstmt=letkf=Kernel_function.find_englobing_kfstmtinletskip=Compute_impact.skip()inletreason=Options.Reason.get()inletrestrict=Locations.Zone.topinletimpact,_initial,_reason=Compute_impact.nodes_impacted_by_stmts~skip~restrict~reasonkf[stmt]inimpact_to_localizable_listimpactlet()=Request.register~package~kind:`GET~name:"impactStatement"~descr:(Markdown.plain"Compute the impact of a statement")~input:(moduleKernel_ast.Stmt)~output:(moduleData.Jlist(Kernel_ast.Marker))impact_statement