123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960modulePI=Parse_info(*****************************************************************************)(* Helpers *)(*****************************************************************************)(*****************************************************************************)(* Subsystem testing, no db *)(*****************************************************************************)lettest_highlight_cppfile=let(ast2,_stat)=Parse_cpp.parsefileinleth=Hashtbl.create101inast2|>List.iter(fun(ast,toks)->(* computing the token attributes *)letprefs=Highlight_code.default_highlighter_preferencesinHighlight_cpp.visit_toplevel~tag_hook:(funinfocateg->Hashtbl.addhinfocateg)prefs(ast,toks);(* getting the text *)let_=toks|>Common.map_filter(funtok->letinfo=Token_helpers_cpp.info_of_toktokinlets=PI.str_of_infoinfoinifnot(PI.is_origintokinfo)thenNoneelseletcateg=Common2.hfind_optioninfohinletcateg=categ|>Common2.fmap(funcateg->(*
rewrite_categ_using_entities s categ file hentities
*)categ)inSome(s,categ,{Common2.l=PI.line_of_infoinfo;c=PI.col_of_infoinfo;}))in())(*****************************************************************************)(* Main entry for Arg *)(*****************************************************************************)letactions()=["-test_highlight_cpp"," <file>",Common.mk_action_1_argtest_highlight_cpp;]