Commit 05dcb273 authored by Pietro Abate's avatar Pietro Abate
Browse files

[r2005-01-28 12:57:21 by afrisch] Remove dependencies from types/, misc/

Original author: afrisch
Date: 2005-01-28 12:57:22+00:00
parent 14d97b7f
...@@ -154,3 +154,4 @@ evaluator: $(EVALUATOR:.cmo=.$(EXTENSION)) ...@@ -154,3 +154,4 @@ evaluator: $(EVALUATOR:.cmo=.$(EXTENSION))
# Seems to be some problems with statically linking curl # Seems to be some problems with statically linking curl
# EXTRA_OPTS_WEBIFACE = -ccopt -static # EXTRA_OPTS_WEBIFACE = -ccopt -static
...@@ -128,6 +128,7 @@ CLEAN_DIRS = $(DIRS) cdo2cmo tools tests ...@@ -128,6 +128,7 @@ CLEAN_DIRS = $(DIRS) cdo2cmo tools tests
# Objects to build # Objects to build
SCHEMA_OBJS = \ SCHEMA_OBJS = \
schema/schema_pcre.cmo \
schema/schema_types.cmo \ schema/schema_types.cmo \
schema/schema_xml.cmo \ schema/schema_xml.cmo \
schema/schema_common.cmo \ schema/schema_common.cmo \
......
...@@ -86,46 +86,52 @@ runtime/value.cmo: types/atoms.cmi types/builtin_defs.cmi types/chars.cmi \ ...@@ -86,46 +86,52 @@ runtime/value.cmo: types/atoms.cmi types/builtin_defs.cmi types/chars.cmi \
runtime/value.cmx: types/atoms.cmx types/builtin_defs.cmx types/chars.cmx \ runtime/value.cmx: types/atoms.cmx types/builtin_defs.cmx types/chars.cmx \
misc/encodings.cmx types/ident.cmx types/intervals.cmx compile/lambda.cmx \ misc/encodings.cmx types/ident.cmx types/intervals.cmx compile/lambda.cmx \
misc/ns.cmx types/sequence.cmx types/types.cmx runtime/value.cmi misc/ns.cmx types/sequence.cmx types/types.cmx runtime/value.cmi
schema/schema_pcre.cmo: misc/encodings.cmi schema/schema_pcre.cmi
schema/schema_pcre.cmx: misc/encodings.cmx schema/schema_pcre.cmi
schema/schema_types.cmo: misc/encodings.cmi types/intervals.cmi misc/ns.cmi \ schema/schema_types.cmo: misc/encodings.cmi types/intervals.cmi misc/ns.cmi \
runtime/value.cmi schema/schema_types.cmi runtime/value.cmi schema/schema_types.cmi
schema/schema_types.cmx: misc/encodings.cmx types/intervals.cmx misc/ns.cmx \ schema/schema_types.cmx: misc/encodings.cmx types/intervals.cmx misc/ns.cmx \
runtime/value.cmx schema/schema_types.cmi runtime/value.cmx schema/schema_types.cmi
schema/schema_xml.cmo: misc/encodings.cmi misc/ns.cmi schema/schema_xml.cmi schema/schema_xml.cmo: misc/encodings.cmi misc/ns.cmi schema/schema_pcre.cmi \
schema/schema_xml.cmx: misc/encodings.cmx misc/ns.cmx schema/schema_xml.cmi schema/schema_xml.cmi
schema/schema_xml.cmx: misc/encodings.cmx misc/ns.cmx schema/schema_pcre.cmx \
schema/schema_xml.cmi
schema/schema_common.cmo: types/atoms.cmi misc/encodings.cmi \ schema/schema_common.cmo: types/atoms.cmi misc/encodings.cmi \
types/intervals.cmi misc/ns.cmi schema/schema_types.cmi \ types/intervals.cmi misc/ns.cmi schema/schema_pcre.cmi \
schema/schema_xml.cmi runtime/value.cmi schema/schema_common.cmi schema/schema_types.cmi schema/schema_xml.cmi runtime/value.cmi \
schema/schema_common.cmi
schema/schema_common.cmx: types/atoms.cmx misc/encodings.cmx \ schema/schema_common.cmx: types/atoms.cmx misc/encodings.cmx \
types/intervals.cmx misc/ns.cmx schema/schema_types.cmx \ types/intervals.cmx misc/ns.cmx schema/schema_pcre.cmx \
schema/schema_xml.cmx runtime/value.cmx schema/schema_common.cmi schema/schema_types.cmx schema/schema_xml.cmx runtime/value.cmx \
schema/schema_common.cmi
schema/schema_builtin.cmo: types/atoms.cmi types/builtin_defs.cmi \ schema/schema_builtin.cmo: types/atoms.cmi types/builtin_defs.cmi \
misc/encodings.cmi types/intervals.cmi misc/ns.cmi \ misc/encodings.cmi types/intervals.cmi misc/ns.cmi \
schema/schema_common.cmi schema/schema_types.cmi schema/schema_xml.cmi \ schema/schema_common.cmi schema/schema_pcre.cmi schema/schema_types.cmi \
types/sequence.cmi types/types.cmi runtime/value.cmi \ schema/schema_xml.cmi types/sequence.cmi types/types.cmi \
schema/schema_builtin.cmi runtime/value.cmi schema/schema_builtin.cmi
schema/schema_builtin.cmx: types/atoms.cmx types/builtin_defs.cmx \ schema/schema_builtin.cmx: types/atoms.cmx types/builtin_defs.cmx \
misc/encodings.cmx types/intervals.cmx misc/ns.cmx \ misc/encodings.cmx types/intervals.cmx misc/ns.cmx \
schema/schema_common.cmx schema/schema_types.cmx schema/schema_xml.cmx \ schema/schema_common.cmx schema/schema_pcre.cmx schema/schema_types.cmx \
types/sequence.cmx types/types.cmx runtime/value.cmx \ schema/schema_xml.cmx types/sequence.cmx types/types.cmx \
schema/schema_builtin.cmi runtime/value.cmx schema/schema_builtin.cmi
schema/schema_validator.cmo: types/atoms.cmi misc/encodings.cmi \ schema/schema_validator.cmo: types/atoms.cmi misc/encodings.cmi \
types/intervals.cmi misc/ns.cmi schema/schema_builtin.cmi \ types/intervals.cmi misc/ns.cmi schema/schema_builtin.cmi \
schema/schema_common.cmi schema/schema_types.cmi runtime/value.cmi \ schema/schema_common.cmi schema/schema_pcre.cmi schema/schema_types.cmi \
schema/schema_validator.cmi runtime/value.cmi schema/schema_validator.cmi
schema/schema_validator.cmx: types/atoms.cmx misc/encodings.cmx \ schema/schema_validator.cmx: types/atoms.cmx misc/encodings.cmx \
types/intervals.cmx misc/ns.cmx schema/schema_builtin.cmx \ types/intervals.cmx misc/ns.cmx schema/schema_builtin.cmx \
schema/schema_common.cmx schema/schema_types.cmx runtime/value.cmx \ schema/schema_common.cmx schema/schema_pcre.cmx schema/schema_types.cmx \
schema/schema_validator.cmi runtime/value.cmx schema/schema_validator.cmi
schema/schema_parser.cmo: misc/encodings.cmi types/intervals.cmi misc/ns.cmi \ schema/schema_parser.cmo: misc/encodings.cmi types/intervals.cmi misc/ns.cmi \
schema/schema_builtin.cmi schema/schema_common.cmi \ schema/schema_builtin.cmi schema/schema_common.cmi schema/schema_pcre.cmi \
schema/schema_types.cmi schema/schema_validator.cmi schema/schema_xml.cmi \ schema/schema_types.cmi schema/schema_validator.cmi schema/schema_xml.cmi \
runtime/value.cmi schema/schema_parser.cmi runtime/value.cmi schema/schema_parser.cmi
schema/schema_parser.cmx: misc/encodings.cmx types/intervals.cmx misc/ns.cmx \ schema/schema_parser.cmx: misc/encodings.cmx types/intervals.cmx misc/ns.cmx \
schema/schema_builtin.cmx schema/schema_common.cmx \ schema/schema_builtin.cmx schema/schema_common.cmx schema/schema_pcre.cmx \
schema/schema_types.cmx schema/schema_validator.cmx schema/schema_xml.cmx \ schema/schema_types.cmx schema/schema_validator.cmx schema/schema_xml.cmx \
runtime/value.cmx schema/schema_parser.cmi runtime/value.cmx schema/schema_parser.cmi
parser/location.cmo: parser/location.cmi parser/location.cmo: misc/html.cmi parser/location.cmi
parser/location.cmx: parser/location.cmi parser/location.cmx: misc/html.cmx parser/location.cmi
parser/url.cmo: parser/location.cmi parser/url.cmi parser/url.cmo: parser/location.cmi parser/url.cmi
parser/url.cmx: parser/location.cmx parser/url.cmi parser/url.cmx: parser/location.cmx parser/url.cmi
parser/ulexer.cmo: parser/ulexer.cmi parser/ulexer.cmo: parser/ulexer.cmi
...@@ -151,15 +157,15 @@ typing/typed.cmo: types/ident.cmo parser/location.cmi misc/ns.cmi \ ...@@ -151,15 +157,15 @@ typing/typed.cmo: types/ident.cmo parser/location.cmi misc/ns.cmi \
typing/typed.cmx: types/ident.cmx parser/location.cmx misc/ns.cmx \ typing/typed.cmx: types/ident.cmx parser/location.cmx misc/ns.cmx \
types/patterns.cmx schema/schema_types.cmx types/types.cmx types/patterns.cmx schema/schema_types.cmx types/types.cmx
typing/typer.cmo: parser/ast.cmo types/atoms.cmi types/builtin_defs.cmi \ typing/typer.cmo: parser/ast.cmo types/atoms.cmi types/builtin_defs.cmi \
types/chars.cmi types/externals.cmi types/ident.cmo types/intervals.cmi \ types/chars.cmi types/externals.cmi misc/html.cmi types/ident.cmo \
parser/location.cmi misc/ns.cmi types/patterns.cmi \ types/intervals.cmi parser/location.cmi misc/ns.cmi types/patterns.cmi \
schema/schema_builtin.cmi schema/schema_common.cmi \ schema/schema_builtin.cmi schema/schema_common.cmi \
schema/schema_parser.cmi schema/schema_types.cmi types/sequence.cmi \ schema/schema_parser.cmi schema/schema_types.cmi types/sequence.cmi \
misc/serialize.cmi misc/state.cmi misc/stats.cmi typing/typed.cmo \ misc/serialize.cmi misc/state.cmi misc/stats.cmi typing/typed.cmo \
types/types.cmi parser/url.cmi runtime/value.cmi typing/typer.cmi types/types.cmi parser/url.cmi runtime/value.cmi typing/typer.cmi
typing/typer.cmx: parser/ast.cmx types/atoms.cmx types/builtin_defs.cmx \ typing/typer.cmx: parser/ast.cmx types/atoms.cmx types/builtin_defs.cmx \
types/chars.cmx types/externals.cmx types/ident.cmx types/intervals.cmx \ types/chars.cmx types/externals.cmx misc/html.cmx types/ident.cmx \
parser/location.cmx misc/ns.cmx types/patterns.cmx \ types/intervals.cmx parser/location.cmx misc/ns.cmx types/patterns.cmx \
schema/schema_builtin.cmx schema/schema_common.cmx \ schema/schema_builtin.cmx schema/schema_common.cmx \
schema/schema_parser.cmx schema/schema_types.cmx types/sequence.cmx \ schema/schema_parser.cmx schema/schema_types.cmx types/sequence.cmx \
misc/serialize.cmx misc/state.cmx misc/stats.cmx typing/typed.cmx \ misc/serialize.cmx misc/state.cmx misc/stats.cmx typing/typed.cmx \
...@@ -246,17 +252,17 @@ driver/cduce.cmx: parser/ast.cmx types/builtin.cmx types/builtin_defs.cmx \ ...@@ -246,17 +252,17 @@ driver/cduce.cmx: parser/ast.cmx types/builtin.cmx types/builtin_defs.cmx \
types/patterns.cmx types/sample.cmx schema/schema_common.cmx \ types/patterns.cmx types/sample.cmx schema/schema_common.cmx \
misc/state.cmx typing/typer.cmx types/types.cmx parser/ulexer.cmx \ misc/state.cmx typing/typer.cmx types/types.cmx parser/ulexer.cmx \
runtime/value.cmx driver/cduce.cmi runtime/value.cmx driver/cduce.cmi
runtime/system.cmo: types/atoms.cmi types/builtin_defs.cmi types/ident.cmo \ runtime/system.cmo: types/atoms.cmi types/builtin.cmi types/builtin_defs.cmi \
parser/location.cmi compile/operators.cmi types/types.cmi \ types/ident.cmo parser/location.cmi compile/operators.cmi \
runtime/value.cmi types/sequence.cmi types/types.cmi runtime/value.cmi
runtime/system.cmx: types/atoms.cmx types/builtin_defs.cmx types/ident.cmx \ runtime/system.cmx: types/atoms.cmx types/builtin.cmx types/builtin_defs.cmx \
parser/location.cmx compile/operators.cmx types/types.cmx \ types/ident.cmx parser/location.cmx compile/operators.cmx \
runtime/value.cmx types/sequence.cmx types/types.cmx runtime/value.cmx
ocamliface/mltypes.cmo: ocamliface/asttypes.cmo driver/config.cmi \ ocamliface/mltypes.cmo: driver/config.cmi types/ident.cmo \
types/ident.cmo driver/librarian.cmi parser/location.cmi types/types.cmi \ driver/librarian.cmi parser/location.cmi types/types.cmi \
ocamliface/mltypes.cmi ocamliface/mltypes.cmi
ocamliface/mltypes.cmx: ocamliface/asttypes.cmx driver/config.cmx \ ocamliface/mltypes.cmx: driver/config.cmx types/ident.cmx \
types/ident.cmx driver/librarian.cmx parser/location.cmx types/types.cmx \ driver/librarian.cmx parser/location.cmx types/types.cmx \
ocamliface/mltypes.cmi ocamliface/mltypes.cmi
ocamliface/mlstub.cmo: types/atoms.cmi types/builtin_defs.cmi \ ocamliface/mlstub.cmo: types/atoms.cmi types/builtin_defs.cmi \
compile/compile.cmi driver/config.cmi types/externals.cmi types/ident.cmo \ compile/compile.cmi driver/config.cmi types/externals.cmi types/ident.cmo \
...@@ -297,26 +303,28 @@ schema/schema_import.cmo: misc/encodings.cmi misc/ns.cmi \ ...@@ -297,26 +303,28 @@ schema/schema_import.cmo: misc/encodings.cmi misc/ns.cmi \
schema/schema_import.cmx: misc/encodings.cmx misc/ns.cmx \ schema/schema_import.cmx: misc/encodings.cmx misc/ns.cmx \
schema/schema_components.cmx schema/schema_components.cmx
driver/run.cmo: types/builtin.cmi driver/cduce.cmi driver/config.cmi \ driver/run.cmo: types/builtin.cmi driver/cduce.cmi driver/config.cmi \
types/ident.cmo driver/librarian.cmi parser/location.cmi misc/state.cmi \ misc/html.cmi types/ident.cmo driver/librarian.cmi parser/location.cmi \
misc/stats.cmi parser/ulexer.cmi runtime/value.cmi misc/state.cmi misc/stats.cmi parser/ulexer.cmi runtime/value.cmi
driver/run.cmx: types/builtin.cmx driver/cduce.cmx driver/config.cmx \ driver/run.cmx: types/builtin.cmx driver/cduce.cmx driver/config.cmx \
types/ident.cmx driver/librarian.cmx parser/location.cmx misc/state.cmx \ misc/html.cmx types/ident.cmx driver/librarian.cmx parser/location.cmx \
misc/stats.cmx parser/ulexer.cmx runtime/value.cmx misc/state.cmx misc/stats.cmx parser/ulexer.cmx runtime/value.cmx
driver/webiface.cmo: driver/cduce.cmi driver/examples.cmo parser/location.cmi \ driver/webiface.cmo: driver/cduce.cmi driver/examples.cmo misc/html.cmi \
misc/state.cmi parser/location.cmi misc/state.cmi
driver/webiface.cmx: driver/cduce.cmx driver/examples.cmx parser/location.cmx \ driver/webiface.cmx: driver/cduce.cmx driver/examples.cmx misc/html.cmx \
misc/state.cmx parser/location.cmx misc/state.cmx
driver/evaluator.cmo: driver/cduce.cmi driver/config.cmi parser/location.cmi driver/evaluator.cmo: driver/cduce.cmi driver/config.cmi misc/html.cmi \
driver/evaluator.cmx: driver/cduce.cmx driver/config.cmx parser/location.cmx parser/location.cmi
driver/evaluator.cmx: driver/cduce.cmx driver/config.cmx misc/html.cmx \
parser/location.cmx
tools/validate.cmo: schema/schema_common.cmi schema/schema_parser.cmi \ tools/validate.cmo: schema/schema_common.cmi schema/schema_parser.cmi \
schema/schema_types.cmi schema/schema_types.cmi
tools/validate.cmx: schema/schema_common.cmx schema/schema_parser.cmx \ tools/validate.cmx: schema/schema_common.cmx schema/schema_parser.cmx \
schema/schema_types.cmx schema/schema_types.cmx
ocamliface/mltypes.cmo: ocamliface/asttypes.cmo driver/config.cmi \ ocamliface/mltypes.cmo: driver/config.cmi types/ident.cmo \
types/ident.cmo driver/librarian.cmi parser/location.cmi types/types.cmi \ driver/librarian.cmi parser/location.cmi types/types.cmi \
ocamliface/mltypes.cmi ocamliface/mltypes.cmi
ocamliface/mltypes.cmx: ocamliface/asttypes.cmx driver/config.cmx \ ocamliface/mltypes.cmx: driver/config.cmx types/ident.cmx \
types/ident.cmx driver/librarian.cmx parser/location.cmx types/types.cmx \ driver/librarian.cmx parser/location.cmx types/types.cmx \
ocamliface/mltypes.cmi ocamliface/mltypes.cmi
ocamliface/mlstub.cmo: types/atoms.cmi types/builtin_defs.cmi \ ocamliface/mlstub.cmo: types/atoms.cmi types/builtin_defs.cmi \
compile/compile.cmi driver/config.cmi types/externals.cmi types/ident.cmo \ compile/compile.cmi driver/config.cmi types/externals.cmi types/ident.cmo \
...@@ -361,6 +369,7 @@ compile/lambda.cmi: types/ident.cmo misc/ns.cmi types/patterns.cmi \ ...@@ -361,6 +369,7 @@ compile/lambda.cmi: types/ident.cmo misc/ns.cmi types/patterns.cmi \
runtime/value.cmi: types/atoms.cmi types/chars.cmi misc/encodings.cmi \ runtime/value.cmi: types/atoms.cmi types/chars.cmi misc/encodings.cmi \
types/ident.cmo types/intervals.cmi compile/lambda.cmi misc/ns.cmi \ types/ident.cmo types/intervals.cmi compile/lambda.cmi misc/ns.cmi \
types/types.cmi types/types.cmi
schema/schema_pcre.cmi: misc/encodings.cmi
schema/schema_types.cmi: misc/encodings.cmi types/intervals.cmi misc/ns.cmi \ schema/schema_types.cmi: misc/encodings.cmi types/intervals.cmi misc/ns.cmi \
runtime/value.cmi runtime/value.cmi
schema/schema_xml.cmi: misc/encodings.cmi misc/ns.cmi schema/schema_xml.cmi: misc/encodings.cmi misc/ns.cmi
...@@ -370,6 +379,7 @@ schema/schema_builtin.cmi: misc/encodings.cmi misc/ns.cmi \ ...@@ -370,6 +379,7 @@ schema/schema_builtin.cmi: misc/encodings.cmi misc/ns.cmi \
schema/schema_types.cmi types/types.cmi runtime/value.cmi schema/schema_types.cmi types/types.cmi runtime/value.cmi
schema/schema_validator.cmi: schema/schema_types.cmi runtime/value.cmi schema/schema_validator.cmi: schema/schema_types.cmi runtime/value.cmi
schema/schema_parser.cmi: schema/schema_types.cmi schema/schema_xml.cmi schema/schema_parser.cmi: schema/schema_types.cmi schema/schema_xml.cmi
parser/location.cmi: misc/html.cmi
parser/parser.cmi: parser/ast.cmo parser/parser.cmi: parser/ast.cmo
types/externals.cmi: types/types.cmi types/externals.cmi: types/types.cmi
typing/typer.cmi: parser/ast.cmo misc/custom.cmo types/ident.cmo \ typing/typer.cmi: parser/ast.cmo misc/custom.cmo types/ident.cmo \
...@@ -389,8 +399,8 @@ types/builtin.cmi: typing/typer.cmi runtime/value.cmi ...@@ -389,8 +399,8 @@ types/builtin.cmi: typing/typer.cmi runtime/value.cmi
driver/librarian.cmi: compile/compile.cmi types/ident.cmo typing/typer.cmi \ driver/librarian.cmi: compile/compile.cmi types/ident.cmo typing/typer.cmi \
types/types.cmi runtime/value.cmi types/types.cmi runtime/value.cmi
driver/cduce.cmi: misc/encodings.cmi runtime/value.cmi driver/cduce.cmi: misc/encodings.cmi runtime/value.cmi
ocamliface/mltypes.cmi: ocamliface/asttypes.cmo types/types.cmi ocamliface/mltypes.cmi: types/types.cmi
query/query.cmi: parser/ast.cmo query/query.cmi: parser/ast.cmo
ocamliface/mltypes.cmi: ocamliface/asttypes.cmo types/types.cmi ocamliface/mltypes.cmi: types/types.cmi
schema/schema_types.cmi: misc/encodings.cmi types/intervals.cmi misc/ns.cmi \ schema/schema_types.cmi: misc/encodings.cmi types/intervals.cmi misc/ns.cmi \
runtime/value.cmi runtime/value.cmi
...@@ -7,20 +7,11 @@ struct ...@@ -7,20 +7,11 @@ struct
let empty = "" let empty = ""
(* TODO: handle UTF-8 viewport *)
let to_string s =
Netconversion.recode_string
~subst:(fun i -> Printf.sprintf "\\%i;" i)
~out_enc:`Enc_iso88591
~in_enc:`Enc_utf8 s
let print ppf s =
Format.fprintf ppf "%s" (to_string s)
let start_index s = 0 let start_index s = 0
let end_index s = String.length s let end_index s = String.length s
let equal_index = (==) let equal_index = (==)
let mk s = s let mk s = s
let mk_latin1 s = Netconversion.recode_string ~in_enc:`Enc_iso88591 ~out_enc:`Enc_utf8 s
let mk_idx i = i let mk_idx i = i
let get_str s = s let get_str s = s
let get_idx i = i let get_idx i = i
...@@ -112,6 +103,25 @@ struct ...@@ -112,6 +103,25 @@ struct
((Char.code s.[i+3] land 0b111111)), i + 4 ((Char.code s.[i+3] land 0b111111)), i + 4
| _ -> failwith "Malformed UTF-8 bufffer" | _ -> failwith "Malformed UTF-8 bufffer"
(* TODO: handle UTF-8 viewport *)
let rec to_string_aux buf s i n =
if (i = n) then ()
else
let (c,i) = next s i in
if (c <= 255) then Buffer.add_char buf (Char.chr c)
else Printf.bprintf buf"\\%i;" c;
to_string_aux buf s i n
let to_string s =
let b = Buffer.create (String.length s) in
to_string_aux b s 0 (String.length s);
Buffer.contents b
let print ppf s =
Format.fprintf ppf "%s" (to_string s)
let advance s i = let advance s i =
match s.[i] with match s.[i] with
| '\000'..'\127' as c -> i + 1 | '\000'..'\127' as c -> i + 1
...@@ -156,6 +166,15 @@ struct ...@@ -156,6 +166,15 @@ struct
(* Higher code points are not possible in XML: *) (* Higher code points are not possible in XML: *)
failwith "Encodings.Utf8.store" failwith "Encodings.Utf8.store"
let rec mk_latin1_aux buf s i n =
if (i = n) then ()
else (store buf (Char.code s.[i]); mk_latin1_aux buf s (succ i) n)
let mk_latin1 s =
let b = Buffer.create (String.length s) in
mk_latin1_aux b s 0 (String.length s);
Buffer.contents b
let copy b s i j = let copy b s i j =
Buffer.add_substring b s i (j - i) Buffer.add_substring b s i (j - i)
...@@ -186,16 +205,4 @@ struct ...@@ -186,16 +205,4 @@ struct
let concat s1 s2 = s1 ^ s2 let concat s1 s2 = s1 ^ s2
module Pcre =
struct
let pcre_replace ~rex ?templ s =
match templ with
| None -> mk (Pcre.replace ~rex (get_str s))
| Some templ ->
mk (Pcre.replace ~rex ~templ:(get_str templ) (get_str s))
let pcre_extract ~rex s = Array.map mk (Pcre.extract ~rex (get_str s))
let pcre_regexp s = Pcre.regexp ~flags:[`UTF8] s
let pcre_split ~rex s = List.map mk (Pcre.split ~rex (get_str s))
end
end end
...@@ -32,16 +32,4 @@ sig ...@@ -32,16 +32,4 @@ sig
val serialize_sub: Serialize.Put.t -> t -> uindex -> uindex -> unit val serialize_sub: Serialize.Put.t -> t -> uindex -> uindex -> unit
module Pcre:
(* Wrappers for some Pcre functions working on Utf8.t values.
* Given Pcre.regexp regular expressions should be compiled with `UTF8 flag
* or with pcre_regexp below *)
sig
val pcre_regexp: string -> Pcre.regexp (* compile using `UTF8 flag *)
val pcre_replace: rex:Pcre.regexp -> ?templ:t -> t -> t
val pcre_extract: rex:Pcre.regexp -> t -> t array
val pcre_split: rex:Pcre.regexp -> t -> t list
end
end end
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
open Printf open Printf
open Encodings open Encodings
open Encodings.Utf8.Pcre open Schema_pcre
open Schema_common open Schema_common
open Schema_types open Schema_types
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
open Printf open Printf
open Encodings open Encodings
open Encodings.Utf8.Pcre open Schema_pcre
open Schema_types open Schema_types
let no_facets = { let no_facets = {
......
...@@ -2,7 +2,7 @@ open Printf ...@@ -2,7 +2,7 @@ open Printf
open Pxp_document open Pxp_document
open Encodings open Encodings
open Encodings.Utf8.Pcre open Schema_pcre
open Schema_common open Schema_common
open Schema_types open Schema_types
open Schema_validator open Schema_validator
......
...@@ -4,7 +4,7 @@ let debug = false ...@@ -4,7 +4,7 @@ let debug = false
open Printf open Printf
open Encodings open Encodings
open Encodings.Utf8.Pcre open Schema_pcre
open Schema_common open Schema_common
open Schema_types open Schema_types
open Value open Value
......
...@@ -5,7 +5,7 @@ open Pxp_tree_parser ...@@ -5,7 +5,7 @@ open Pxp_tree_parser
open Pxp_types open Pxp_types
open Encodings open Encodings
open Encodings.Utf8.Pcre open Schema_pcre
type pxp_node = type pxp_node =
('a Pxp_document.node Pxp_document.extension as 'a) Pxp_document.node ('a Pxp_document.node Pxp_document.extension as 'a) Pxp_document.node
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment