jon.recoil.org

Module OpamParserTypes.FullPosSource

OpamParserTypes transitional module with full position types

Sourcetype file_name = string

Source file positions

Sourcetype pos = {
  1. filename : OpamParserTypes.FullPos.file_name;
  2. start : int * int;
  3. stop : int * int;
}

Full position

Sourcetype 'a with_pos = {
  1. pelem : 'a;
  2. pos : OpamParserTypes.FullPos.pos;
}

with_pos type, used for all units, embedding the element pelem ans its position pos

Sourcetype relop_kind = OpamParserTypes.relop
Sourcetype logop_kind = OpamParserTypes.logop
Sourcetype pfxop_kind = OpamParserTypes.pfxop
Sourcetype env_update_op_kind = OpamParserTypes.env_update_op
Sourcetype value_kind =
  1. | Bool of bool
    (*

    bool atoms

    *)
  2. | Int of int
    (*

    int atoms

    *)
  3. | String of string
    (*

    string atoms

    *)
  4. | Relop of OpamParserTypes.FullPos.relop * OpamParserTypes.FullPos.value * OpamParserTypes.FullPos.value
    (*

    Relational operators with two values (e.g. os != "win32")

    *)
  5. | Prefix_relop of OpamParserTypes.FullPos.relop * OpamParserTypes.FullPos.value
    (*

    Relational operators in prefix position (e.g. < "4.07.0")

    *)
  6. | Logop of OpamParserTypes.FullPos.logop * OpamParserTypes.FullPos.value * OpamParserTypes.FullPos.value
    (*

    Logical operators

    *)
  7. | Pfxop of OpamParserTypes.FullPos.pfxop * OpamParserTypes.FullPos.value
    (*

    Prefix operators

    *)
  8. | Ident of string
    (*

    Identifiers

    *)
  9. | List of OpamParserTypes.FullPos.value list OpamParserTypes.FullPos.with_pos
    (*

    Lists of values ([x1 x2 ... x3])

    *)
  10. | Group of OpamParserTypes.FullPos.value list OpamParserTypes.FullPos.with_pos
    (*

    Groups of values ((x1 x2 ... x3))

    *)
  11. | Option of OpamParserTypes.FullPos.value * OpamParserTypes.FullPos.value list OpamParserTypes.FullPos.with_pos
    (*

    Value with optional list (x1 {x2 x3 x4})

    *)
  12. | Env_binding of OpamParserTypes.FullPos.value * OpamParserTypes.FullPos.env_update_op * OpamParserTypes.FullPos.value
    (*

    Environment variable binding (FOO += "bar")

    *)

Base values

Sourcetype opamfile_section = {
  1. section_kind : string OpamParserTypes.FullPos.with_pos;
    (*

    Section kind (e.g. extra-source)

    *)
  2. section_name : string OpamParserTypes.FullPos.with_pos option;
    (*

    Section name (e.g. "myfork.patch")

    *)
  3. section_items : OpamParserTypes.FullPos.opamfile_item list OpamParserTypes.FullPos.with_pos;
    (*

    Content of the section

    *)
}

An opamfile section

Sourceand opamfile_item_kind =
  1. | Section of OpamParserTypes.FullPos.opamfile_section
    (*

    e.g. kind ["name"] { ... }

    *)
  2. | Variable of string OpamParserTypes.FullPos.with_pos * OpamParserTypes.FullPos.value
    (*

    e.g. opam-version: "2.0"

    *)

An opamfile is composed of sections and variable definitions

Sourcetype opamfile = {
  1. file_contents : OpamParserTypes.FullPos.opamfile_item list;
    (*

    Content of the file

    *)
  2. file_name : OpamParserTypes.FullPos.file_name;
    (*

    Name of the disk file this record was loaded from

    *)
}

A file is a list of items and the filename