Module Parsexp__.Cst

Concrete syntax tree of s-expressions

This module exposes a type that describe the full contents of a source file containing s-expressions.

One can use this type to do low-level rewriting of s-expression files.

type t =
| Atom of {
loc : Parsexp.Positions.range;
atom : Base.string;

(** Original unescaped atom, in case it is a double-quoted atom. The string includes the enclosing double quotes. *)

unescaped : Base.string Base.option;
}
| List of {
loc : Parsexp.Positions.range;
elements : t_or_comment Base.list;
}
type t_or_comment =
| Sexp of t
| Comment of comment
type comment =
| Plain_comment of {
loc : Parsexp.Positions.range;
comment : Base.string;
}

(** Line or block comment *)

| Sexp_comment of {
hash_semi_pos : Parsexp.Positions.pos;
comments : comment Base.list;
sexp : t;
}
include sig ... end
val compare : t ‑> t ‑> Base.int
val compare_t_or_comment : t_or_comment ‑> t_or_comment ‑> Base.int
val compare_comment : comment ‑> comment ‑> Base.int
val sexp_of_t : t ‑> Sexplib.Sexp.t
val sexp_of_t_or_comment : t_or_comment ‑> Sexplib.Sexp.t
val sexp_of_comment : comment ‑> Sexplib.Sexp.t
module Forget : sig ... end