12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061openCommonmoduleFlag=Flag_parsing(*****************************************************************************)(* Subsystem testing *)(*****************************************************************************)lettest_tokens_pythonfile=ifnot(file=~".*\\.py")thenpr2"warning: seems not a python file";Flag.verbose_lexing:=true;Flag.verbose_parsing:=true;Flag.exn_when_lexical_error:=true;lettoks=Parse_python.tokensfileintoks|>List.iter(funx->pr2_genx);()lettest_parse_pythonxs=letxs=List.mapCommon.fullpathxsinletfullxs=Lib_parsing_python.find_source_files_of_dir_or_filesxs|>Skip_code.filter_files_if_skip_listinletstat_list=ref[]infullxs|>Console.progress(funk->List.iter(funfile->k();let(_xs,stat)=Common.save_excursionFlag.error_recoverytrue(fun()->Parse_python.parsefile)inCommon.pushstatstat_list;));Parse_info.print_parsing_stat_list!stat_list;()lettest_dump_pythonfile=letast=Parse_python.parse_programfileinletv=Meta_ast_python.vof_programastinlets=Ocaml.string_of_vvinprs(*****************************************************************************)(* Main entry for Arg *)(*****************************************************************************)letactions()=["-tokens_python"," <file>",Common.mk_action_1_argtest_tokens_python;"-parse_python"," <files or dirs>",Common.mk_action_n_argtest_parse_python;"-dump_python"," <file>",Common.mk_action_1_argtest_dump_python;]