X-Git-Url: http://matita.cs.unibo.it/gitweb/?p=helm.git;a=blobdiff_plain;f=helm%2FDEVEL%2Fpxp%2Fpxp%2Fdoc%2Fmanual%2Fsrc%2Fgetcode.ml;fp=helm%2FDEVEL%2Fpxp%2Fpxp%2Fdoc%2Fmanual%2Fsrc%2Fgetcode.ml;h=0000000000000000000000000000000000000000;hp=4db669036a0b474d31bb2a37750c190628db296f;hb=3ef089a4c58fbe429dd539af6215991ecbe11ee2;hpb=1c7fb836e2af4f2f3d18afd0396701f2094265ff diff --git a/helm/DEVEL/pxp/pxp/doc/manual/src/getcode.ml b/helm/DEVEL/pxp/pxp/doc/manual/src/getcode.ml deleted file mode 100755 index 4db669036..000000000 --- a/helm/DEVEL/pxp/pxp/doc/manual/src/getcode.ml +++ /dev/null @@ -1,56 +0,0 @@ -#! /bin/sh -# (* -exec ocamlfattop "$0" -*) directory ".";; - -open Str;; - -let name_re = regexp "(\\*\\$[ \t]*\\([a-zA-Z0-9.-]*\\)[ \t]*\\*)";; -let subst_re = regexp "[<>&'%]";; - -let begin_entity name = - "\n" -;; - - -let text = ref "" in -let within_entity = ref false in -try - while true do - let line = read_line() in - if string_match name_re line 0 then begin - let name = matched_group 1 line in - if !within_entity then - text := !text ^ "\n" ^ end_entity(); - within_entity := false; - if name <> "-" then begin - text := !text ^ begin_entity name; - within_entity := true - end - end - else - if !within_entity then begin - let line' = - global_substitute subst_re - (fun s -> - let s' = matched_group 0 s in - match s' with - "<" -> "<" - | ">" -> ">" - | "&" -> "&" - | "'" -> "'" - | "%" -> "&percent;" - | _ -> assert false) - line - in - text := !text ^ "\n" ^ line' - end - done; -with End_of_file -> - if !within_entity then - text := !text ^ "\n" ^ end_entity(); - print_string !text -;;