1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253# 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.
*)letdefault_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# 17 "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;# 25 "reason_toploop.cppo.ml"r)(* this file's triggered by utop/rtop *)letmain()=ifList.exists((=)"camlp4o")!Topfind.predicates||List.exists((=)"camlp4r")!Topfind.predicatesthenprint_endline"Reason is incompatible with camlp4!"elsebegin# 35 "reason_toploop.cppo.ml"ifnot(Toploop.prepareFormat.err_formatter())thenraise(Compenv.Exit_with_status2);# 37 "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.mapReason_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