Module Dune_lang.SyntaxSource

Management of syntaxes

Sourcemodule Version : sig ... end
Sourcetype t
Sourcemodule Error : sig ... end
Sourcemodule Warning : sig ... end
Sourceval create : ?experimental:bool -> name:string -> desc:string -> (Version.t * [ `Since of Version.t ]) list -> t

create ~name ~desc supported_versions defines a new syntax. supported_version is the list of all the supported versions paired with the versions of the dune lang in which they where introduced. desc is used to describe what this syntax represent in error messages.

Sourceval name : t -> string

Return the name of the syntax.

Sourceval check_supported : dune_lang_ver:Version.t -> t -> (Stdune.Loc.t * Version.t) -> unit

Check that the given version is supported and raise otherwise.

Sourceval greatest_supported_version : t -> Version.t
Sourceval greatest_supported_version_for_dune_lang : t -> dune_lang_ver:Version.t -> Version.t option

S-expression parsing

High-level functions

Sourceval deleted_in : ?extra_info:string -> t -> Version.t -> (unit, _) Decoder.parser

Indicate the field/constructor being parsed was deleted in the given version

Sourceval deprecated_in : ?extra_info:string -> t -> Version.t -> (unit, _) Decoder.parser

Indicate the field/constructor being parsed was deprecated in the given version

Sourceval renamed_in : t -> Version.t -> to_:string -> (unit, _) Decoder.parser

Indicate the field/constructor being parsed was renamed in the given version

Sourceval since : ?fatal:bool -> t -> Version.t -> (unit, _) Decoder.parser

Indicate the field/constructor being parsed was introduced in the given version. When fatal is false, simply emit a warning instead of error. fatal defaults to true.

Low-level functions

Sourcemodule Key : sig ... end
Sourceval set : t -> Key.t -> ('a, 'k) Decoder.parser -> ('a, 'k) Decoder.parser
Sourceval get_exn : t -> (Version.t, 'k) Decoder.parser
Sourceval experimental : t -> bool