Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cduce
cduce
Commits
7a9989e4
Commit
7a9989e4
authored
Jul 10, 2007
by
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
50dfc2fc
Changes
10
Hide whitespace changes
Inline
Side-by-side
Makefile
View file @
7a9989e4
...
...
@@ -154,3 +154,4 @@ evaluator: $(EVALUATOR:.cmo=.$(EXTENSION))
# Seems to be some problems with statically linking curl
# EXTRA_OPTS_WEBIFACE = -ccopt -static
Makefile.distrib
View file @
7a9989e4
...
...
@@ -128,6 +128,7 @@ CLEAN_DIRS = $(DIRS) cdo2cmo tools tests
# Objects to build
SCHEMA_OBJS
=
\
schema/schema_pcre.cmo
\
schema/schema_types.cmo
\
schema/schema_xml.cmo
\
schema/schema_common.cmo
\
...
...
depend
View file @
7a9989e4
...
...
@@ -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 \
misc/encodings.cmx types/ident.cmx types/intervals.cmx compile/lambda.cmx \
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 \
runtime/value.cmi schema/schema_types.cmi
schema/schema_types.cmx: misc/encodings.cmx types/intervals.cmx misc/ns.cmx \
runtime/value.cmx schema/schema_types.cmi
schema/schema_xml.cmo: misc/encodings.cmi misc/ns.cmi schema/schema_xml.cmi
schema/schema_xml.cmx: misc/encodings.cmx misc/ns.cmx schema/schema_xml.cmi
schema/schema_xml.cmo: misc/encodings.cmi misc/ns.cmi schema/schema_pcre.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 \
types/intervals.cmi misc/ns.cmi schema/schema_types.cmi \
schema/schema_xml.cmi runtime/value.cmi schema/schema_common.cmi
types/intervals.cmi misc/ns.cmi schema/schema_pcre.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 \
types/intervals.cmx misc/ns.cmx schema/schema_types.cmx \
schema/schema_xml.cmx runtime/value.cmx schema/schema_common.cmi
types/intervals.cmx misc/ns.cmx schema/schema_pcre.cmx \
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 \
misc/encodings.cmi types/intervals.cmi misc/ns.cmi \
schema/schema_common.cmi schema/schema_
types
.cmi schema/schema_
xml
.cmi \
types/sequence.cmi types/types.cmi
runtime/value.cmi
\
schema/schema_builtin.cmi
schema/schema_common.cmi schema/schema_
pcre
.cmi schema/schema_
types
.cmi \
schema/schema_xml.cmi
types/sequence.cmi types/types.cmi \
runtime/value.cmi
schema/schema_builtin.cmi
schema/schema_builtin.cmx: types/atoms.cmx types/builtin_defs.cmx \
misc/encodings.cmx types/intervals.cmx misc/ns.cmx \
schema/schema_common.cmx schema/schema_
types
.cmx schema/schema_
xml
.cmx \
types/sequence.cmx types/types.cmx
runtime/value.cmx
\
schema/schema_builtin.cmi
schema/schema_common.cmx schema/schema_
pcre
.cmx schema/schema_
types
.cmx \
schema/schema_xml.cmx
types/sequence.cmx types/types.cmx \
runtime/value.cmx
schema/schema_builtin.cmi
schema/schema_validator.cmo: types/atoms.cmi misc/encodings.cmi \
types/intervals.cmi misc/ns.cmi schema/schema_builtin.cmi \
schema/schema_common.cmi schema/schema_
types.cmi runtime/value
.cmi \
schema/schema_validator.cmi
schema/schema_common.cmi schema/schema_
pcre.cmi schema/schema_types
.cmi \
runtime/value.cmi
schema/schema_validator.cmi
schema/schema_validator.cmx: types/atoms.cmx misc/encodings.cmx \
types/intervals.cmx misc/ns.cmx schema/schema_builtin.cmx \
schema/schema_common.cmx schema/schema_
types.cmx runtime/value
.cmx \
schema/schema_validator.cmi
schema/schema_common.cmx schema/schema_
pcre.cmx schema/schema_types
.cmx \
runtime/value.cmx
schema/schema_validator.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 \
runtime/value.cmi schema/schema_parser.cmi
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 \
runtime/value.cmx schema/schema_parser.cmi
parser/location.cmo: parser/location.cmi
parser/location.cmx: parser/location.cmi
parser/location.cmo:
misc/html.cmi
parser/location.cmi
parser/location.cmx:
misc/html.cmx
parser/location.cmi
parser/url.cmo: parser/location.cmi parser/url.cmi
parser/url.cmx: parser/location.cmx parser/url.cmi
parser/ulexer.cmo: parser/ulexer.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 \
types/patterns.cmx schema/schema_types.cmx types/types.cmx
typing/typer.cmo: parser/ast.cmo types/atoms.cmi types/builtin_defs.cmi \
types/chars.cmi types/externals.cmi
types/ident
.cm
o
types/int
ervals
.cm
i
\
parser/location.cmi misc/ns.cmi types/patterns.cmi \
types/chars.cmi types/externals.cmi
misc/html
.cm
i
types/i
de
nt.cm
o
\
types/intervals.cmi
parser/location.cmi misc/ns.cmi types/patterns.cmi \
schema/schema_builtin.cmi schema/schema_common.cmi \
schema/schema_parser.cmi schema/schema_types.cmi types/sequence.cmi \
misc/serialize.cmi misc/state.cmi misc/stats.cmi typing/typed.cmo \
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 \
types/chars.cmx types/externals.cmx
types/ident
.cmx types/int
ervals
.cmx \
parser/location.cmx misc/ns.cmx types/patterns.cmx \
types/chars.cmx types/externals.cmx
misc/html
.cmx types/i
de
nt.cmx \
types/intervals.cmx
parser/location.cmx misc/ns.cmx types/patterns.cmx \
schema/schema_builtin.cmx schema/schema_common.cmx \
schema/schema_parser.cmx schema/schema_types.cmx types/sequence.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 \
types/patterns.cmx types/sample.cmx schema/schema_common.cmx \
misc/state.cmx typing/typer.cmx types/types.cmx parser/ulexer.cmx \
runtime/value.cmx driver/cduce.cmi
runtime/system.cmo: types/atoms.cmi types/builtin
_defs
.cmi types/
ident
.cm
o
\
parser/location.cmi compile/operators.cmi
types/types.cmi
\
runtime/value.cmi
runtime/system.cmx: types/atoms.cmx types/builtin
_defs
.cmx types/
ident
.cmx \
parser/location.cmx compile/operators.cmx
types/types.cmx
\
runtime/value.cmx
ocamliface/mltypes.cmo:
ocamliface/asttypes.cmo
driver/config.cmi \
types/ident.cmo
driver/librarian.cmi parser/location.cmi types/types.cmi \
runtime/system.cmo: types/atoms.cmi types/builtin.cmi types/
builtin_defs
.cm
i
\
types/ident.cmo
parser/location.cmi compile/operators.cmi \
types/sequence.cmi types/types.cmi
runtime/value.cmi
runtime/system.cmx: types/atoms.cmx types/builtin.cmx types/
builtin_defs
.cmx \
types/ident.cmx
parser/location.cmx compile/operators.cmx \
types/sequence.cmx types/types.cmx
runtime/value.cmx
ocamliface/mltypes.cmo: driver/config.cmi
types/ident.cmo
\
driver/librarian.cmi parser/location.cmi types/types.cmi \
ocamliface/mltypes.cmi
ocamliface/mltypes.cmx:
ocamliface/asttypes.cmx driver/config
.cmx \
types/ident.cmx
driver/librarian.cmx parser/location.cmx types/types.cmx \
ocamliface/mltypes.cmx:
driver/config.cmx types/ident
.cmx \
driver/librarian.cmx parser/location.cmx types/types.cmx \
ocamliface/mltypes.cmi
ocamliface/mlstub.cmo: types/atoms.cmi types/builtin_defs.cmi \
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 \
schema/schema_import.cmx: misc/encodings.cmx misc/ns.cmx \
schema/schema_components.cmx
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/stats.cmi parser/ulexer.cmi runtime/value.cmi
misc/html.cmi
types/ident.cmo driver/librarian.cmi parser/location.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 \
types/ident.cmx driver/librarian.cmx parser/location.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 \
misc/state.cmi
driver/webiface.cmx: driver/cduce.cmx driver/examples.cmx parser/location.cmx \
misc/state.cmx
driver/evaluator.cmo: driver/cduce.cmi driver/config.cmi parser/location.cmi
driver/evaluator.cmx: driver/cduce.cmx driver/config.cmx parser/location.cmx
misc/html.cmx types/ident.cmx driver/librarian.cmx parser/location.cmx \
misc/state.cmx misc/stats.cmx parser/ulexer.cmx runtime/value.cmx
driver/webiface.cmo: driver/cduce.cmi driver/examples.cmo misc/html.cmi \
parser/location.cmi misc/state.cmi
driver/webiface.cmx: driver/cduce.cmx driver/examples.cmx misc/html.cmx \
parser/location.cmx misc/state.cmx
driver/evaluator.cmo: driver/cduce.cmi driver/config.cmi misc/html.cmi \
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 \
schema/schema_types.cmi
tools/validate.cmx: schema/schema_common.cmx schema/schema_parser.cmx \
schema/schema_types.cmx
ocamliface/mltypes.cmo:
ocamliface/asttypes.cmo
driver/config.cmi \
types/ident.cmo
driver/librarian.cmi parser/location.cmi types/types.cmi \
ocamliface/mltypes.cmo: driver/config.cmi
types/ident.cmo
\
driver/librarian.cmi parser/location.cmi types/types.cmi \
ocamliface/mltypes.cmi
ocamliface/mltypes.cmx:
ocamliface/asttypes.cmx driver/config
.cmx \
types/ident.cmx
driver/librarian.cmx parser/location.cmx types/types.cmx \
ocamliface/mltypes.cmx:
driver/config.cmx types/ident
.cmx \
driver/librarian.cmx parser/location.cmx types/types.cmx \
ocamliface/mltypes.cmi
ocamliface/mlstub.cmo: types/atoms.cmi types/builtin_defs.cmi \
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 \
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/types.cmi
schema/schema_pcre.cmi: misc/encodings.cmi
schema/schema_types.cmi: misc/encodings.cmi types/intervals.cmi misc/ns.cmi \
runtime/value.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 \
schema/schema_types.cmi types/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
parser/location.cmi: misc/html.cmi
parser/parser.cmi: parser/ast.cmo
types/externals.cmi: types/types.cmi
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
driver/librarian.cmi: compile/compile.cmi types/ident.cmo typing/typer.cmi \
types/types.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
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 \
runtime/value.cmi
misc/encodings.ml
View file @
7a9989e4
...
...
@@ -7,20 +7,11 @@ struct
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
end_index
s
=
String
.
length
s
let
equal_index
=
(
==
)
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
get_str
s
=
s
let
get_idx
i
=
i
...
...
@@ -112,6 +103,25 @@ struct
((
Char
.
code
s
.
[
i
+
3
]
land
0b111111
))
,
i
+
4
|
_
->
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
=
match
s
.
[
i
]
with
|
'\000'
..
'\127'
as
c
->
i
+
1
...
...
@@ -156,6 +166,15 @@ struct
(* Higher code points are not possible in XML: *)
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
=
Buffer
.
add_substring
b
s
i
(
j
-
i
)
...
...
@@ -186,16 +205,4 @@ struct
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
misc/encodings.mli
View file @
7a9989e4
...
...
@@ -32,16 +32,4 @@ sig
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
schema/schema_builtin.ml
View file @
7a9989e4
...
...
@@ -2,7 +2,7 @@
open
Printf
open
Encodings
open
Encodings
.
Utf8
.
P
cre
open
Schema_p
cre
open
Schema_common
open
Schema_types
...
...
schema/schema_common.ml
View file @
7a9989e4
...
...
@@ -2,7 +2,7 @@
open
Printf
open
Encodings
open
Encodings
.
Utf8
.
P
cre
open
Schema_p
cre
open
Schema_types
let
no_facets
=
{
...
...
schema/schema_parser.ml
View file @
7a9989e4
...
...
@@ -2,7 +2,7 @@ open Printf
open
Pxp_document
open
Encodings
open
Encodings
.
Utf8
.
P
cre
open
Schema_p
cre
open
Schema_common
open
Schema_types
open
Schema_validator
...
...
schema/schema_validator.ml
View file @
7a9989e4
...
...
@@ -4,7 +4,7 @@ let debug = false
open
Printf
open
Encodings
open
Encodings
.
Utf8
.
P
cre
open
Schema_p
cre
open
Schema_common
open
Schema_types
open
Value
...
...
schema/schema_xml.ml
View file @
7a9989e4
...
...
@@ -5,7 +5,7 @@ open Pxp_tree_parser
open
Pxp_types
open
Encodings
open
Encodings
.
Utf8
.
P
cre
open
Schema_p
cre
type
pxp_node
=
(
'
a
Pxp_document
.
node
Pxp_document
.
extension
as
'
a
)
Pxp_document
.
node
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment