Skip to content
GitLab
Menu
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
999cf81c
Commit
999cf81c
authored
Jul 10, 2007
by
Pietro Abate
Browse files
[r2003-05-20 21:22:39 by cvscast] Empty log message
Original author: cvscast Date: 2003-05-20 21:22:39+00:00
parent
09cbd06f
Changes
1
Hide whitespace changes
Inline
Side-by-side
runtime/load_xml.ml
View file @
999cf81c
...
...
@@ -12,7 +12,7 @@ open Encodings
let
is_ws
s
=
let
rec
check
i
=
(
i
<
0
)
||
(
match
s
.
[
i
]
with
(
match
(
String
.
unsafe_get
s
i
)
with
|
'
'
|
'\t'
|
'\n'
|
'\r'
->
check
(
i
-
1
)
|
_
->
false
)
in
check
(
String
.
length
s
-
1
)
...
...
@@ -70,17 +70,20 @@ let load_xml_aux s =
match
!
curr
with
|
E_start_tag
(
name
,
att
,_
)
->
get
()
;
dump_txt
(
fun
()
->
let
e1
=
parse_elt
name
att
in
let
rest
=
parse_seq
()
in
Pair
(
e1
,
rest
)
)
let
data
=
Buffer
.
contents
txt
in
Buffer
.
clear
txt
;
let
e1
=
parse_elt
name
att
in
let
rest
=
parse_seq
()
in
let
q
=
Pair
(
e1
,
rest
)
in
if
(
is_ws
data
)
then
q
else
string
data
q
|
E_char_data
data
->
get
()
;
Buffer
.
add_string
txt
data
;
parse_seq
()
|
E_end_tag
(
_
,_
)
->
dump_txt
(
fun
()
->
nil
)
let
data
=
Buffer
.
contents
txt
in
Buffer
.
clear
txt
;
if
(
is_ws
data
)
then
nil
else
string
data
nil
|
_
->
failwith
"Expect start_tag, char_data, or end_tag"
and
parse_doc
()
=
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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