X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Focaml%2Fmathql_interpreter_galax%2Fuse.ml;h=ab4fa6c7331dc471164cf4403c124d3508af61bd;hb=1d2bd140d14561951f8214edf15abe4f40dcb649;hp=c2a716b2315219ad491aea9862352a54ca1173f5;hpb=eef875893d96b25d1b685fc9865b46c4267a31a6;p=helm.git diff --git a/helm/ocaml/mathql_interpreter_galax/use.ml b/helm/ocaml/mathql_interpreter_galax/use.ml index c2a716b23..ab4fa6c73 100644 --- a/helm/ocaml/mathql_interpreter_galax/use.ml +++ b/helm/ocaml/mathql_interpreter_galax/use.ml @@ -5,24 +5,23 @@ open Mathql_semantics;; let rec attl uril svar = match uril with | head::tail -> let suri = List.hd uril in - let len = String.length suri in - let scuri = String.sub suri 4 (len-4) in - if String.contains scuri '#' then - let pos = String.index scuri '#' in + let len = String.length suri in + let scuri = String.sub suri 4 (len-4) in + if String.contains scuri '#' then + let pos = String.index scuri '#' in let s1 = Str.string_before scuri pos in - let xp = Str.string_after scuri pos in - let xp = Str.global_replace (Str.regexp "#xpointer(1") "" xp in - let xp = Str.global_replace (Str.regexp "\/") "," xp in - let xp = Str.global_replace (Str.regexp ")") "" xp in - let scuri = (s1 ^ xp) in - - let uril_tl = List.tl uril in + let xp = Str.string_after scuri pos in + let xp = Str.global_replace (Str.regexp "#xpointer(1") "" xp in + let xp = Str.global_replace (Str.regexp "\/") "," xp in + let xp = Str.global_replace (Str.regexp ")") "" xp in + let scuri = (s1 ^ xp) in + let uril_tl = List.tl uril in {uri = scuri; attributes = [(svar, (List.hd uril_tl))]; extra = ""} :: (attl (List.tl uril_tl) svar) - else + else let uril_tl = List.tl uril in - {uri = scuri; attributes = [(svar, (List.hd - uril_tl))]; extra = ""} :: (attl (List.tl uril_tl) svar) + {uri = scuri; attributes = [(svar, (List.hd + uril_tl))]; extra = ""} :: (attl (List.tl uril_tl) svar) | [] -> []