12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455# 1 "reason_toploop.cppo.ml"(*
* Copyright (c) 2015-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*)openReasonletdefault_parse_toplevel_phrase=!Toploop.parse_toplevel_phraseletreason_parse_toplevel_phrase=Reason_util.correctly_catch_parse_errors(funx->letr=Reason_toolchain.To_current.copy_toplevel_phrase(Reason_toolchain.RE.toplevel_phrasex)in# 19 "reason_toploop.cppo.ml"(* NOTE(anmonteiro): after https://github.com/ocaml/ocaml/pull/12029, we get a
Fatal error: exception Invalid_argument("index out of bounds")
Raised by primitive operation at Toploop.ends_with_lf in file "toplevel/toploop.ml"
Setting `lex_eof_reached` seems to avoid whatever check upstream is doing. *)x.lex_eof_reached<-true;# 27 "reason_toploop.cppo.ml"r)(* this file's triggered by utop/rtop *)letmain()=ifList.exists~f:((=)"camlp4o")!Topfind.predicates||List.exists~f:((=)"camlp4r")!Topfind.predicatesthenprint_endline"Reason is incompatible with camlp4!"elsebegin# 37 "reason_toploop.cppo.ml"ifnot(Toploop.prepareFormat.err_formatter())thenraise(Compenv.Exit_with_status2);# 39 "reason_toploop.cppo.ml"Toploop.parse_toplevel_phrase:=(funt->if!Reason_utop.current_top=UTopthendefault_parse_toplevel_phrasetelsereason_parse_toplevel_phraset);Toploop.parse_use_file:=Reason_util.correctly_catch_parse_errors(funx->List.map~f:Reason_toolchain.To_current.copy_toplevel_phrase(Reason_toolchain.RE.use_filex));(* Toploop.print_out_sig_item := M17n_util.utf8_print_out_sig_item !Toploop.print_out_sig_item; *)(* Toploop.install_printer Predef.path_string Predef.type_string *)(* (fun fmt obj -> M17n_util.utf8_print_string fmt (Obj.magic obj)); *)end