Module type Parsexp__.Parsexp_intf.Parser_state

type t

State of the parser

val create : ?pos:Parsexp.Positions.pos ‑> Base.unit ‑> t

Create a new parser state. pos is the initial position, it defaults to {line=1;col=0;offset=0}.

val reset : ?pos:Parsexp.Positions.pos ‑> t ‑> Base.unit

Reset the given parsing state. The following always succeed:


        reset t ?pos;
        assert (t = create ?pos ())
      
val offset : t ‑> Base.int

Number of characters fed to the parser

val line : t ‑> Base.int

Position in the text

val column : t ‑> Base.int
val position : t ‑> Parsexp.Positions.pos
val stop : t ‑> Base.unit

Prevent the state from receiving any more characters. Trying to feed more characters will result in an exception, unless the state is reset.