let ic =
try open_in moopath with Sys_error _ ->
raise (IncludedFileNotCompiled moopath) in
- let stream = Stream.of_channel ic in
+ let stream = Ulexing.from_utf8_channel ic in
let status = ref status in
profiler_include.CicUtil.profile
(!eval_from_stream_ref status stream) (fun _ _ -> ());
let eval_string ?do_heavy_checks ?include_paths ?clean_baseuri status str =
eval_from_stream
- ?do_heavy_checks ?include_paths ?clean_baseuri status (Stream.of_string str) (fun _ _ ->())
+ ?do_heavy_checks ?include_paths ?clean_baseuri status
+ (Ulexing.from_utf8_string str) (fun _ _ ->())
let default_options () =
(*
?do_heavy_checks:bool ->
?include_paths:string list ->
?clean_baseuri:bool ->
- MatitaTypes.status ref -> char Stream.t ->
+ MatitaTypes.status ref -> Ulexing.lexbuf ->
(MatitaTypes.status -> statement -> unit) ->
unit
?do_heavy_checks:bool ->
?include_paths:string list ->
?clean_baseuri:bool ->
- MatitaTypes.status ref-> char Stream.t ->
+ MatitaTypes.status ref-> Ulexing.lexbuf ->
(MatitaTypes.status -> statement -> unit) ->
unit
let baseuri_of_file file =
let uri = ref None in
let ic = open_in file in
- let istream = Stream.of_channel ic in
+ let istream = Ulexing.from_utf8_channel ic in
(try
while true do
try
if Pcre.pmatch ~rex:only_dust_RE unparsed_text then raise Margin;
let st =
try
- GrafiteParser.parse_statement (Stream.of_string unparsed_text)
+ GrafiteParser.parse_statement (Ulexing.from_utf8_string unparsed_text)
with
CicNotationParser.Parse_error (floc,err) as exc ->
let (x, y) = CicNotationPt.loc_of_floc floc in
let s = self#getFuture in
let rec is_there_and_executable s =
if Pcre.pmatch ~rex:only_dust_RE s then raise Margin;
- let st = GrafiteParser.parse_statement (Stream.of_string s) in
+ let st = GrafiteParser.parse_statement (Ulexing.from_utf8_string s) in
match st with
| GrafiteAst.Comment (loc,_)->
let parsed_text_length = snd (CicNotationPt.loc_of_floc loc) in
opt_exit n
let rec interactive_loop () =
- let str = Stream.of_channel stdin in
+ let str = Ulexing.from_utf8_channel stdin in
try
run_script str
(MatitaEngine.eval_from_stream_greedy ~include_paths:!paths_to_search_in)
else
MatitaLog.message (sprintf "execution of %s started:" fname);
let is =
- Stream.of_channel
+ Ulexing.from_utf8_channel
(match fname with
| "stdin" -> stdin
| fname -> open_in fname)
List.iter
(fun file ->
let ic = open_in file in
- let istream = Stream.of_channel ic in
+ let istream = Ulexing.from_utf8_channel ic in
let dependencies = GrafiteParser.parse_dependencies istream in
close_in ic;
List.iter
let disambiguate_string ~dbd ?(context = []) ?(metasenv = []) ?initial_ugraph
?(aliases = DisambiguateTypes.Environment.empty) term
=
- let ast = CicNotationParser.parse_level2_ast (Stream.of_string term) in
+ let ast =
+ CicNotationParser.parse_level2_ast (Ulexing.from_utf8_string term)
+ in
try
fst (Disambiguator.disambiguate_term ~dbd ~context ~metasenv ast
?initial_ugraph ~aliases ~universe:None)
open DisambiguateTypes
let parse_environment str =
- let stream = Stream.of_string str in
+ let stream = Ulexing.from_utf8_string str in
let environment = ref Environment.empty in
let multiple_environment = ref Environment.empty in
try