let outputhtml = (rendering_window#outputhtml : GHtml.xmhtml) in
let inputlen = inputt#length in
let input = inputt#get_chars 0 inputlen in
- try
- output_html outputhtml (Mquery.locate input) ;
- inputt#delete_text 0 inputlen
- with
- e ->
- output_html outputhtml
- ("<h1 color=\"red\">" ^ Printexc.to_string e ^ "</h1>")
+ output_html outputhtml (
+ try
+ match Str.split (Str.regexp "[ \t]+") input with
+ | [] -> ""
+ | head :: tail ->
+ inputt#delete_text 0 inputlen;
+ Mquery.locate head
+ with
+ e -> "<h1 color=\"red\">" ^ Printexc.to_string e ^ "</h1>"
+ )
;;
let backward rendering_window () =
let outputhtml = (rendering_window#outputhtml : GHtml.xmhtml) in
- let metasenv =
- match !ProofEngine.proof with
- None -> assert false
- | Some (_,metasenv,_,_) -> metasenv
- in
- let result =
- match !ProofEngine.goal with
- | None -> ""
- | Some metano ->
- let (_,_,ty) =
- List.find (function (m,_,_) -> m=metano) metasenv
- in
- Mquery.backward ty
- in
+ let inputt = (rendering_window#inputt : GEdit.text) in
+ let inputlen = inputt#length in
+ let input = inputt#get_chars 0 inputlen in
+ let level = int_of_string input in
+ let metasenv =
+ match !ProofEngine.proof with
+ None -> assert false
+ | Some (_,metasenv,_,_) -> metasenv
+ in
+ let result =
+ match !ProofEngine.goal with
+ | None -> ""
+ | Some metano ->
+ let (_,_,ty) =
+ List.find (function (m,_,_) -> m=metano) metasenv
+ in
+ Mquery.backward ty level
+ in
output_html outputhtml result
let choose_selection