package opam-file-format
Module OpamParserTypes.FullPosSource
OpamParserTypes transitional module with full position types
Source file positions
with_pos type, used for all units, embedding the element pelem ans its position pos
type value_kind = | Bool of bool(*
*)boolatoms| Int of int(*
*)intatoms| String of string(*
*)stringatoms| Relop of relop * value * value(*Relational operators with two values (e.g.
*)os != "win32")| Prefix_relop of relop * value(*Relational operators in prefix position (e.g.
*)< "4.07.0")| Logop of logop * value * value(*Logical operators
*)| Pfxop of pfxop * value(*Prefix operators
*)| Ident of string(*Identifiers
*)| List of value list with_pos(*Lists of values (
*)[x1 x2 ... x3])| Group of value list with_pos(*Groups of values (
*)(x1 x2 ... x3))| Option of value * value list with_pos(*Value with optional list (
*)x1 {x2 x3 x4})| Env_binding of value * env_update_op * value(*Environment variable binding (
*)FOO += "bar")
Base values
type opamfile_section = {section_kind : string with_pos;(*Section kind (e.g.
*)extra-source)section_name : string with_pos option;(*Section name (e.g.
*)"myfork.patch")section_items : opamfile_item list with_pos;(*Content of the section
*)
}An opamfile section
and opamfile_item_kind = | Section of opamfile_section(*e.g.
*)kind ["name"] { ... }| Variable of string with_pos * value(*e.g.
*)opam-version: "2.0"
An opamfile is composed of sections and variable definitions
type opamfile = {file_contents : opamfile_item list;(*Content of the file
*)file_name : file_name;(*Name of the disk file this record was loaded from
*)
}A file is a list of items and the filename