Commit 6379ff57 authored by POGODALLA Sylvain's avatar POGODALLA Sylvain

Fixes to feature request #7

parent 4e9d4711
......@@ -326,8 +326,9 @@ struct
let ending_parse_time = Sys.time () in
let parse_forest = Datalog.Program.build_forest ~query:query derivations temp_prog in
let ending_building_forest_time = Sys.time () in
let () = Logs.app (fun m -> m "Parsing time: %.3f seconds%!" (ending_parse_time -. starting_parse_time)) in
let () = Logs.app (fun m -> m "Building forest time: %.3f seconds%!" (ending_building_forest_time -. ending_parse_time)) in
let () = Logs.app (fun m -> m "") in
let () = Logs.app (fun m -> m "Parsing time: %.3f seconds" (ending_parse_time -. starting_parse_time)) in
let () = Logs.app (fun m -> m "@[<v>Building forest time: %.3f seconds@,@]" (ending_building_forest_time -. ending_parse_time)) in
let resume =
match parse_forest with
| [] -> SharedForest.SharedForest.empty
......@@ -345,7 +346,7 @@ struct
let get_analysis resume lex =
Log.debug (fun m -> m "Trying to get some analysis");
match lex.datalog_prog with
| None -> let () = Logs.warn (fun m -> m "Parsing is not yet implemented for non atomic distinguished type%!") in None,resume
| None -> let () = Logs.warn (fun m -> m "Parsing is not yet implemented for non atomic distinguished type") in None,resume
| Some {rule_to_cst=rule_id_to_cst} ->
match SharedForest.SharedForest.resumption resume with
| None,resume -> None,resume
......
......@@ -651,14 +651,14 @@ module Functions =
let rec ask_for_next_parse f param =
let rec no_interaction f p =
match f p with
| None -> Logs.app (fun m -> m "No other solution")
| None -> Logs.app (fun m -> m "@[<v>@,No other solution@]")
| Some new_param -> no_interaction f new_param in
let msg = Printf.sprintf "Do you want to look for another solution?\n\ty/yes\n\tn/no\n\ta/all\n(Default: yes):" in
match interact msg return_input with
| Next ->
(match f param with
| None -> Logs.app (fun m -> m "No other solution")
| Some new_param when Env.Lexicon.is_empty new_param -> Logs.app (fun m -> m "No other solution")
| None -> Logs.app (fun m -> m "@[<v>@,No other solution@]")
| Some new_param when Env.Lexicon.is_empty new_param -> Logs.app (fun m -> m "@[<v>@,No other solution@]")
| Some new_param-> ask_for_next_parse f new_param)
| All -> no_interaction f param
| Stop -> ()
......@@ -688,7 +688,7 @@ module Functions =
let resume = get_parse_tree (Env.Lexicon.parse obj_t abs_ty lex) abs_ty lex in
match resume with
| None -> Logs.app (fun m -> m "No solution.")
| Some resume when Env.Lexicon.is_empty resume -> Logs.app (fun m -> m "No other solution.")
| Some resume when Env.Lexicon.is_empty resume -> Logs.app (fun m -> m "@[<v>@,No other solution.@]")
| Some resume -> ask_for_next_parse (fun res -> get_parse_tree res abs_ty lex) resume
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment