package ocaml-protoc

  1. Overview
  2. Docs
Protobuf compiler for OCaml

Install

Dune Dependency

Authors

Maintainers

Sources

2.4.0.tar.gz
md5=8a294e86c6202b8ec8016e71d19264cb
sha512=67020bef50b59c6590c1b25d85a75d6e19d6cd37d42b87c94aef798bff51a45f38fe7024b4c67d71c22c13d3f2776bec83acd77794a518f1c4a7eddfc30b6d0b

doc/src/ocaml-protoc.compiler-lib/pb_option.ml.html

Source file pb_option.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
type constant =
  | Constant_string of string
  | Constant_bool of bool
  | Constant_int of int
  | Constant_float of float
  | Constant_litteral of string

type option_name = string
type t = option_name * constant
type set = t list

let empty = []
let add t option_name constant = (option_name, constant) :: t
let merge t1 t2 = t2 @ t1

let get t option_name =
  match List.assoc option_name t with
  | c -> Some c
  | exception Not_found -> None
OCaml

Innovation. Community. Security.