package opam-file-format

  1. Overview
  2. Docs
Parser and printer for the opam file syntax

Install

dune-project
 Dependency

Authors

Maintainers

Sources

2.1.3.tar.gz
md5=b805562dd2d86fc3c8e6d47884fd1da6
sha512=90da53a2b19eb97c17ec71d3ac00969863ef3458f421189413b3ec2d96f8822da9fba51ef95f55064bbb17f1729104a1fe4fed1d61d5006568b53165f0c6931f

doc/opam-file-format/OpamParserTypes/index.html

Module OpamParserTypesSource

Defines the types for the opam format lexer and parser

Type definitions used by the legacy and the new full position modules

Sourcetype relop = [
  1. | `Eq
    (*

    =

    *)
  2. | `Neq
    (*

    !=

    *)
  3. | `Geq
    (*

    >=

    *)
  4. | `Gt
    (*

    >

    *)
  5. | `Leq
    (*

    <=

    *)
  6. | `Lt
    (*

    <

    *)
]

Relational operators

Sourcetype logop = [
  1. | `And
    (*

    &

    *)
  2. | `Or
    (*

    |

    *)
]

Logical operators

Sourcetype pfxop = [
  1. | `Not
    (*

    !

    *)
  2. | `Defined
    (*

    ?

    *)
]

Prefix operators

Sourcetype file_name = string
Sourcetype pos = file_name * int * int

Source file positions: (filename, line, column)

Sourcetype env_update_op =
  1. | Eq
    (*

    =

    *)
  2. | PlusEq
    (*

    +=

    *)
  3. | EqPlus
    (*

    =+

    *)
  4. | ColonEq
    (*

    :=

    *)
  5. | EqColon
    (*

    =:

    *)
  6. | EqPlusEq
    (*

    =+=

    *)

Environment variable update operators

Sourcemodule FullPos : sig ... end

OpamParserTypes transitional module with full position types

Sourcetype value =
  1. | Bool of pos * bool
  2. | Int of pos * int
  3. | String of pos * string
  4. | Relop of pos * relop * value * value
  5. | Prefix_relop of pos * relop * value
  6. | Logop of pos * logop * value * value
  7. | Pfxop of pos * pfxop * value
  8. | Ident of pos * string
  9. | List of pos * value list
  10. | Group of pos * value list
  11. | Option of pos * value * value list
  12. | Env_binding of pos * value * env_update_op * value
Sourcetype opamfile_section = {
  1. section_kind : string;
  2. section_name : string option;
  3. section_items : opamfile_item list;
}
Sourceand opamfile_item =
  1. | Section of pos * opamfile_section
  2. | Variable of pos * string * value
Sourcetype opamfile = {
  1. file_contents : opamfile_item list;
  2. file_name : file_name;
}