mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2025-12-07 03:35:30 -05:00
fix bug in CCParse
This commit is contained in:
parent
10a8a7ce0f
commit
c7de9389b0
2 changed files with 10 additions and 1 deletions
|
|
@ -605,7 +605,7 @@ let take_until_success p : (slice * _) t =
|
||||||
let continue = ref true in
|
let continue = ref true in
|
||||||
let res = ref None in
|
let res = ref None in
|
||||||
|
|
||||||
while !continue && !i < st.j do
|
while !continue && !i <= st.j do
|
||||||
let st' = { st with i = !i } in
|
let st' = { st with i = !i } in
|
||||||
p.run st'
|
p.run st'
|
||||||
~ok:(fun new_st x ->
|
~ok:(fun new_st x ->
|
||||||
|
|
|
||||||
|
|
@ -188,6 +188,15 @@ eq
|
||||||
"hello world")
|
"hello world")
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
eq
|
||||||
|
~printer:(errpp Q.Print.(string))
|
||||||
|
(Ok "ahahahah")
|
||||||
|
(parse_string
|
||||||
|
(let+ slice, () = take_until_success eoi in
|
||||||
|
Slice.to_string slice)
|
||||||
|
"ahahahah")
|
||||||
|
;;
|
||||||
|
|
||||||
t @@ fun () ->
|
t @@ fun () ->
|
||||||
let p0 = skip_white *> U.int in
|
let p0 = skip_white *> U.int in
|
||||||
let p = skip_white *> char '(' *> many p0 <* (skip_white <* char ')') in
|
let p = skip_white *> char '(' *> many p0 <* (skip_white <* char ')') in
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue