package parsexp

  1. Overview
  2. Docs

Module Parsexp.CstSource

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.

Sourcetype t =
  1. | Atom of {
    1. loc : Positions.range;
    2. atom : string;
      (*

      Source syntax of atom. The parser only fills this for atoms that are quoted in the source, but it makes sense for unquoted atoms too (to ensure they get printed unquoted).

      *)
    3. unescaped : string option;
    }
  2. | List of {
    1. loc : Positions.range;
    2. elements : t_or_comment list;
    }
Sourceand t_or_comment =
  1. | Sexp of t
  2. | Comment of comment
Sourceand comment =
  1. | Plain_comment of {
    1. loc : Positions.range;
    2. comment : string;
    }
    (*

    Line or block comment

    *)
  2. | Sexp_comment of {
    1. hash_semi_pos : Positions.pos;
    2. comments : comment list;
    3. sexp : t;
    }
Sourceval sexp_of_t : t -> Sexplib0.Sexp.t
Sourceval sexp_of_t_or_comment : t_or_comment -> Sexplib0.Sexp.t
Sourceval sexp_of_comment : comment -> Sexplib0.Sexp.t
Sourceval compare : t -> t -> int
Sourceval compare_t_or_comment : t_or_comment -> t_or_comment -> int
Sourceval compare_comment : comment -> comment -> int
Sourcemodule Forget : sig ... end
OCaml

Innovation. Community. Security.