package opam-file-format

  1. Overview
  2. Docs

Functions for converting parsed opam files back to strings

Printers for the value and opamfile formats

val relop : [< OpamParserTypes.relop ] -> string

Converts OpamParserTypes.relop to its string representation (=, !=, ..., ~).

val logop : [< OpamParserTypes.logop ] -> string

Converts OpamParserTypes.logop to its string representation (& and |).

val pfxop : [< OpamParserTypes.pfxop ] -> string

Converts OpamParserTypes.pfxop to its string representation (! and ?).

val env_update_op : OpamParserTypes.env_update_op -> string

Converts OpamParserTypes.env_update_op to its string representation (=, +=, ..., =:).

val value : OpamParserTypes.value -> string

Converts value to a string always using LF-encoding of newlines.

val value_list : OpamParserTypes.value list -> string

Converts a list of values to a string always using LF-encoding of newlines.

val items : OpamParserTypes.opamfile_item list -> string
val opamfile : OpamParserTypes.opamfile -> string

Converts an opamfile to a string.

val format_opamfile : Format.formatter -> OpamParserTypes.opamfile -> unit

Writes an opamfile to a Format.formatter. The function ensures that all newlines are sent using Format's break instructions (and so ultimately are processed with the out_newline function of the formatter) but it is the responsibility of the caller to ensure that the formatter is configured for the required output, if necessary.

Normalised output for opam syntax files

module Normalise : sig ... end

opam normalised file format, for signatures.

Format-preserving reprinter

module Preserved : sig ... end

Random utility functions

val value_equals : OpamParserTypes.value -> OpamParserTypes.value -> bool

Compares structurally, without considering file positions

val opamfile_item_equals : OpamParserTypes.opamfile_item -> OpamParserTypes.opamfile_item -> bool

Compares structurally, without considering file positions

OCaml

Innovation. Community. Security.