12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061openCommonmodulePI=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;]