1234567891011121314151617181920212223242526272829303132333435363738394041(* This file is free software, part of Zipperposition. See file "license" for more details. *)(** {1 Utils for Dedkuti} *)openLogtkmoduleE=CCResultmoduleA=UntypedASTmoduleT=STermtypeparser_res=(UntypedAST.statementIter.t,string)CCResult.ttype'aparser_='a->parser_resletparse_lexbuf_lex=Parse_dk.fileLex_dk.tokenlex|>Iter.of_listletparse_lexbuffile:parser_res=tryparse_lexbuf_file|>E.returnwithe->E.of_exneletparse_stdin():parser_res=letlexbuf=Lexing.from_channelstdininParseLocation.set_filelexbuf"stdin";parse_lexbuflexbufletparse_filefile:parser_res=iffile="stdin"thenparse_stdin()elsetryCCIO.with_infile(funic->letlexbuf=Lexing.from_channelicinParseLocation.set_filelexbuffile;parse_lexbuf_lexbuf)|>E.returnwith|Sys_errore->E.fail(Util.err_spf"sys_error when parsing `%s`:@ %s"filee)|e->E.of_exne