package parsexp

  1. Overview
  2. Docs

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 =
  1. | Atom of {
    1. loc : Positions.range;
    2. atom : Base.string;
      (*

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

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

    Line or block comment

    *)
  2. | Sexp_comment of {
    1. hash_semi_pos : Positions.pos;
    2. comments : comment Base.list;
    3. 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
OCaml

Innovation. Community. Security.