12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152(* Yoann Padioleau
*
* Copyright (C) 2019 Yoann Padioleau
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* version 2.1 as published by the Free Software Foundation, with the
* special exception on linking described in file license.txt.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the file
* license.txt for more details.
*)moduleV=Visitor_ast_jsmoduleM=Map_ast_js(*****************************************************************************)(* Prelude *)(*****************************************************************************)letextract_info_visitorrecursor=letglobals=ref[]inlethooks={V.default_visitorwithV.kinfo=(fun(_k,_)i->Common.pushiglobals)}inbeginletvout=V.mk_visitorhooksinrecursorvout;List.rev!globalsendletii_of_anyany=extract_info_visitor(funvisitor->visitorany)(*****************************************************************************)(* Abstract position *)(*****************************************************************************)letabstract_position_visitorrecursor=lethooks={(*M.default_visitor with *)M.kinfo=(fun(_k,_)i->{iwithParse_info.token=Parse_info.Ab})}inbeginletvout=M.mk_visitorhooksinrecursorvout;endletabstract_position_info_anyx=abstract_position_visitor(funvisitor->visitor.M.vanyx)