1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556(* This should be opened at the start of every file in Jane_syntax.
These module definitions shadow the compiler's AST with ppxlib's AST. We use this
module to manage interface differences between the two AST versions. It allows us to
import Jane_syntax from our extended compiler with minimal changes. If we instead used
[open Ppxlib_ast], we'd have to update more callsites. *)moduleParsetree=Ppxlib_ast.ParsetreemoduleAsttypes=Ppxlib_ast.AsttypesmodulePprintast=Ppxlib_ast.PprintastmoduleAst_helper=structincludePpxlib_ast.Ast_helpermoduleTe=structincludeTeletdecl~loc~vars~args?info:_?docs:_?resname=decl~loc~vars~args?resnameendmoduleType=structincludeTypeletmk~loc~docs:_?text:_~params~cstrs~kind~priv?manifestname=mk~loc~params~cstrs~kind~priv?manifestname;;letconstructor~loc~vars~info:_~args?resname=constructor~loc~vars~args?resname;;endendmodulePrintast=struct(* copied and simplified from [Pprintast]. This printing is
just used in a rarely-exercised (never-exercised?) error message
so can be ad-hoc.
*)letpayload_fmt(x:Parsetree.payload)=Format_doc.deprecated_printer(funfmt->match(x:Parsetree.payload)with|PStrx->Pprintast.structurefmtx|PTypx->Pprintast.core_typefmtx|PSigx->Pprintast.signaturefmtx|PPat(x,None)->Pprintast.patternfmtx|PPat(x,Somee)->Pprintast.patternfmtx;Format.pp_print_stringfmt" when ";Pprintast.expressionfmte)fmt;;letexpression_fmtx=Format_doc.deprecated_printer(funfmt->Astlib.Pprintast.expressionfmtx)fmtend