Module Eager_just_positions.State
include Parsexp__.Parser_intf.State
val create : ?pos:Positions.pos -> unit -> tCreate a new parser state.
posis the initial position, it defaults to{line=1;col=0;offset=0}.
val reset : ?pos:Positions.pos -> t -> unitReset the given parsing state. The following always succeed:
reset t ?pos; assert (t = create ?pos ())
val offset : t -> intNumber of characters fed to the parser
val line : t -> intval column : t -> intval position : t -> Positions.posval stop : t -> unitPrevent the state from receiving any more characters. Trying to feed more characters will result in an exception, unless the state is reset.
module Read_only : sig ... endval create : ?pos:Positions.pos -> ?no_sexp_is_error:bool -> (Read_only.t -> parsed_value -> unit) -> tcreate ~fcreate a new eager parser state.fwill be called on each s-expression found. Iffraises, then the parser is made unusable (stop tis invoked).no_sexp_is_errorcontrols the behavior of the parse when the end of input is reached and no s-expression has been found. Whenno_sexp_is_errorisfalse(the default)feed_eoijust returns(), when it isfalsefeed_eoiraises. In any case, if the end of input is reached while parsing an incomplete s-expression such as(abc, error is raised.fmust not save the read-only parser state it receives to access it after returning. It is unspecified what values it will read if it does so.