opened
igstan
username_0
What is it meant by **unbounded** lookahead? For example, the following snippet outputs `result: a,a,a`, instead of what I would have expected to be `result: a,b,c`:

```ocaml
open Angstrom

let parser =
  peek_char_fail >>= fun a ->
  peek_char_fail >>= fun b ->
  peek_char_fail >>= fun c ->
    [a; b; c] |> List.map Char.escaped |> String.concat "," |> return

let () =
  let result = parse_only parser (`String "abc") in
  match result with
  | Ok s -> print_endline ("success: " ^ s)
  | Error e -> print_endline ("failure: " ^ e)
```
Unbounded lookahead
issue
created
seliopou
username_1
Unbounded lookahead in the context of the library's documentation that there is no limit on the backtracking that a parser can utilize to arrive at a successful parse. In other words, the alternative operator `<|>` can be used without restriction, with the caveat that using it with parsers that don't consume any input may lead to an infinite loop.

Your use of `peek_char_fail` behaves like it does because that parser doesn't advance the input; sequential calls will produce the same result. If you'd like to get the next three characters then you could use the `take 3` parser and use bind to access the result. If the characters returned by the parse are not to your satisfaction then you can use the `fail` parser together with the `<|>` operator to define an alternative parse.
comment
created
igstan
username_0
Thank you. `take 3`, `fail` and `<|>` will probably work for my case.
comment
closed
igstan
username_0
issue