package pidgin

  1. Overview
  2. Docs
A common language for describing and validating data structures

Install

dune-project
 Dependency

Authors

Maintainers

Sources

pidgin-1.0.0.tbz
sha256=4a7bb0fccdebf5b205d2eeaa8a9b8e50acf267445f949a2b1a8304def9a38548
sha512=2612fc5cbdd6173a0676ae8840158b85358744561245d0b55ce0ebcf41acb26eddbd316be42a60d55e187928182f681cf3efb4f556ddf47d698217e8376633d3

doc/pidgin/Pidgin/Csexp/index.html

Module Pidgin.CsexpSource

A minimalist library for describing and parsing Canonical S-expression.

Types

Sourcetype t = Sexp.t =
  1. | Atom of string
  2. | Node of t list

Type is shared with Sexp.

Sourcetype parsing_error =
  1. | Premature_end_of_atom of {
    1. expected_length : int;
    2. given_length : int;
    3. position : int;
    }
  2. | Expected_atom of int
  3. | Expected_number_or_column of int
  4. | Expected_number of int
  5. | Unexpected_char of char * int
  6. | Non_terminated_node of int
  7. | Non_opened_node of int

Errors that may occur during parsing.

Sourcetype parsed = (t, parsing_error) result

Describe a parsed Canonical S-Expression.

Parsing

Sourceval from_seq : char Seq.t -> parsed

from_seq charseq parse a sequence of chars (charseq) as Canonical S-Expression.

Sourceval from_string : string -> parsed

from_string string parse a string as a Canonical S-Expression.

Conversion

Sourceval to_buffer : Buffer.t -> t -> unit

to_buffer buf csexp output the given csexp into the given buffer.

Sourceval to_string : t -> string

to_string csexp render a given csexp as a string. Note that the function does not perform pretty-printing.

Equality

Sourceval equal : t -> t -> bool

Equality between Canonical S-Expressions.

Drivers

Drivers

Sourceval translate_from_pidgin : Repr.t -> t

S-expression can be use as a target.

Sourceval translate_to_pidgin : t -> Repr.t

S-expression can be use as a source.