1234567891011121314151617181920212223242526272829303132333435363738394041424344openPpxlibmoduleFilename=Caml.Filenameletdirname=refNoneletset_dirnamedn=dirname:=dnlet()=Driver.add_arg"-dirname"(String(funs->dirname:=Somes))~doc:"<dir> Name of the current directory relative to the root of the project"letchop_dot_slash_prefix~fname=matchBase.String.chop_prefix~prefix:"./"fnamewith|Somefname->fname|None->fnameletexpand_filenamefname=matchFilename.is_relativefname,!dirnamewith|true,Somedirname->(* If [dirname] is given and [fname] is relative, then prepend [dirname]. *)Filename.concatdirname(chop_dot_slash_prefix~fname)|_->fnameletlift_position~loc=letloc={locwithloc_ghost=true}inlet(moduleBuilder)=Ast_builder.makelocinletopenBuilderinletpos=loc.Location.loc_startinletid=Located.lidentinpexp_record[id"Ppx_here_lib.pos_fname",estring(expand_filenamepos.Lexing.pos_fname);id"pos_lnum",eintpos.Lexing.pos_lnum;id"pos_cnum",eintpos.Lexing.pos_cnum;id"pos_bol",eintpos.Lexing.pos_bol]Noneletlift_position_as_string~(loc:Location.t)=let{Lexing.pos_fname;pos_lnum;pos_cnum;pos_bol}=loc.loc_startinAst_builder.Default.estring~loc(Printf.sprintf"%s:%d:%d"(expand_filenamepos_fname)pos_lnum(pos_cnum-pos_bol));;