1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253openCommon(*****************************************************************************)(* Simple AST *)(*****************************************************************************)lettest_parse_simplexs=letfullxs=Lib_parsing_js.find_source_files_of_dir_or_filesxsinfullxs|>List.iter(funfile->tryletcst=Parse_js.parse_programfileinlet_ast=Ast_js_build.programcstin()withexn->(matchexnwith|Ast_js_build.TodoConstruct(s,tok)|Ast_js_build.UnhandledConstruct(s,tok)->pr2s;pr2(Parse_info.error_message_infotok);|_->raiseexn))lettest_dump_astfile=tryletcst=Parse_js.parse_programfileinletast=Ast_js_build.programcstinletv=Meta_ast_js.vof_programastinlets=Ocaml.string_of_vvinprswithexn->(matchexnwith|Parse_info.Lexical_error(s,tok)|Ast_js_build.TodoConstruct(s,tok)|Ast_js_build.UnhandledConstruct(s,tok)->pr2s;pr2(Parse_info.error_message_infotok);raiseexn|_->raiseexn)(*****************************************************************************)(* Main entry for Arg *)(*****************************************************************************)letactions()=["-parse_js_simple"," <files or dirs>",Common.mk_action_n_argtest_parse_simple;"-dump_ast_js"," <file>",Common.mk_action_1_argtest_dump_ast;]