Module OpamParserTypes

Defines the types for the opam format lexer and parser

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

type relop = [
| `Eq(*

=

*)
| `Neq(*

!=

*)
| `Geq(*

>=

*)
| `Gt(*

>

*)
| `Leq(*

<=

*)
| `Lt(*

<

*)
]

Relational operators

type logop = [
| `And(*

&

*)
| `Or(*

|

*)
]

Logical operators

type pfxop = [
| `Not(*

!

*)
| `Defined(*

?

*)
]

Prefix operators

type file_name = string
type pos = file_name * int * int

Source file positions: (filename, line, column)

type env_update_op =
| Eq(*

=

*)
| PlusEq(*

+=

*)
| EqPlus(*

=+

*)
| ColonEq(*

:=

*)
| EqColon(*

=:

*)
| EqPlusEq(*

=+=

*)

Environment variable update operators

module FullPos : sig ... end

OpamParserTypes transitional module with full position types

type value =
| Bool of pos * bool
| Int of pos * int
| String of pos * string
| Relop of pos * relop * value * value
| Prefix_relop of pos * relop * value
| Logop of pos * logop * value * value
| Pfxop of pos * pfxop * value
| Ident of pos * string
| List of pos * value list
| Group of pos * value list
| Option of pos * value * value list
| Env_binding of pos * value * env_update_op * value
type opamfile_section = {
section_kind : string;
section_name : string option;
section_items : opamfile_item list;
}
and opamfile_item =
| Section of pos * opamfile_section
| Variable of pos * string * value
type opamfile = {
file_contents : opamfile_item list;
file_name : file_name;
}