type ('u, 's) mode =
| Single | Parse a single s-expression | |||
| Many | Parse a list of s-expressions | |||
| Eager of {
} | Gives back s-expressions as soon as they are found. |
val empty_stack : stack
val empty_stack_cst : stack_cst
type ('u, 's) kind =
| Positions : (Positions.Builder.t, unit) kind |
| Sexp : (unit, stack) kind |
| Sexp_with_positions : (Positions.Builder.t, stack) kind |
| Cst : (state_cst, stack_cst) kind |
val new_state : ?initial_pos:Positions.pos -> ('u, 's) mode -> ('u, 's) kind -> ('u, 's) state
val reset : ?pos:Positions.pos -> (_, _) state -> unit
val positions : (Positions.Builder.t, _) state -> Positions.t
val offset : (_, _) state -> int
Number of characters fed to the parser
val line : (_, _) state -> int
Position in the text
val column : (_, _) state -> int
val has_unclosed_paren : ('u, 's) state -> bool
Whether there are some unclosed parentheses
val set_error_state : (_, _) state -> unit
val sexp_of_stack : stack -> Sexplib0.Sexp.t
val sexps_of_stack : stack -> Sexplib0.Sexp.t list
val sexps_cst_of_stack : stack_cst -> Cst.t_or_comment list
module Error : sig ... end
exception Parse_error of Error.t
val feed : ('u, 's) state -> char -> 's -> 's
val feed_eoi : ('u, 's) state -> 's -> 's