]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/ocaml/mathql/mQueryUtil.ml
textual parser fixed
[helm.git] / helm / ocaml / mathql / mQueryUtil.ml
index 0cf8ebe087653b2d4365c0e33628fafa7a1049eb..8943e5675652f23f2b60c64b92c902575a8d4652 100644 (file)
@@ -34,8 +34,9 @@
 (******************************************************************************)
 
 open MathQL
+open MQueryHTML
 
-(* string linearization of a reference *)
+(* string linearization of a reference **************************************)
 
 let str_btoken = function
    | MQBC s -> s
@@ -75,29 +76,7 @@ let str_uref (u, i) =
 let xp_str_uref (u, i) =
    UriManager.string_of_uri u ^ str_frag true string_of_int i
 
-(* raw HTML representation *)
-
-let key s = "<font color=\"blue\">" ^ s ^ " </font>"
-
-let sub s = "<font color=\"blue\"> " ^ s ^ " </font>"
-
-let sub2 s = "<font color=\"blue\">" ^ s ^ "</font>"
-
-let sym s = s
-
-let sep s = s
-
-let str s = "<font color=\"red\">'" ^ s ^ "'</font>"
-
-let pat s = "<font color=\"red\">\"" ^ s ^ "\"</font>"
-
-let res s = "<font color=\"brown\">\"" ^ s ^ "\"</font>"
-
-let nl () = "<br>"
-
-let par () = "<p>"
-
-(* HTML representation of a query *)
+(* HTML representation of a query ********************************************)
 
 let out_rvar s = sym s
 
@@ -110,7 +89,7 @@ let out_tref r = pat (str_tref r)
 let rec out_sequence f = function
   | []        -> sep "."
   | [s]       -> f s
-  | s :: tail -> f s ^ sep "," ^ out_sequence f tail
+  | s :: tail -> f s ^ sep ", " ^ out_sequence f tail
 
 let out_order = function
    | MQAsc  -> sub2 "asc"
@@ -175,7 +154,7 @@ and out_list = function
 let out_query = function
    | MQList l -> out_list l
 
-(* HTML representation of a query result *)
+(* HTML representation of a query result ************************************)
 
 let rec out_res_list = function 
    | []     -> ""
@@ -186,7 +165,7 @@ let out_result qr =
    match qr with
       | MQRefs l -> out_res_list l
 
-(* Converting functions *)
+(* Converting functions *****************************************************)
 
 let tref_uref u =
    let s = str_uref u in