(* Whelp *)
| WInstance (_, term) -> "whelp instance " ^ term_pp term
| WHint (_, t) -> "whelp hint " ^ term_pp t
- | WLocate (_, s) -> "whelp locate " ^ s
+ | WLocate (_, s) -> "whelp locate \"" ^ s ^ "\""
| WElim (_, t) -> "whelp elim " ^ term_pp t
| WMatch (_, term) -> "whelp match " ^ term_pp term
(* real macros *)
GrafiteAst.WMatch (loc,t)
| [ IDENT "whelp"; IDENT "instance" ] ; t = term ->
GrafiteAst.WInstance (loc,t)
- | [ IDENT "whelp"; IDENT "locate" ] ; id = IDENT ->
+ | [ IDENT "whelp"; IDENT "locate" ] ; id = QSTRING ->
GrafiteAst.WLocate (loc,id)
| [ IDENT "whelp"; IDENT "elim" ] ; t = term ->
GrafiteAst.WElim (loc, t)
"^cic:/([^/]+/)*[^/]+\\.(con|ind|var)(#xpointer\\(\\d+(/\\d+)+\\))?$"
in
let dir_RE = Pcre.regexp "^cic:((/([^/]+/)*[^/]+(/)?)|/|)$" in
- let whelp_query_RE = Pcre.regexp "^\\s*whelp\\s+([^\\s]+)\\s+(.*)$" in
+ let whelp_query_RE = Pcre.regexp
+ "^\\s*whelp\\s+([^\\s]+)\\s+(\"|\\()(.*)(\\)|\")$"
+ in
let do_not_execute_whelp_query = ref false in
let is_whelp txt = Pcre.pmatch ~rex:whelp_RE txt in
let is_uri txt = Pcre.pmatch ~rex:uri_RE txt in
let query, arg =
try
let q = Pcre.extract ~rex:whelp_query_RE txt in
- q.(1), q.(2)
+ q.(1), q.(3)
with Not_found -> failwith "Malformed Whelp query"
in
activate_combo_query arg query;
with Not_found -> assert false
in
let input = win#queryInputText#text in
- let statement = "whelp " ^ query ^ " (" ^ input ^ ")." in
+ let statement =
+ if query = "locate" then
+ "whelp " ^ query ^ " \"" ^ input ^ "\"."
+ else
+ "whelp " ^ query ^ " (" ^ input ^ ")."
+ in
(MatitaScript.current ())#advance ~statement ()
end
in