package pyre-ast

  1. Overview
  2. Docs

See TaglessFinal.Pattern.

type t = private
  1. | MatchValue of {
    1. location : Location.t;
    2. value : Expression.t;
    }
  2. | MatchSingleton of {
    1. location : Location.t;
    2. value : Constant.t;
    }
  3. | MatchSequence of {
    1. location : Location.t;
    2. patterns : t list;
    }
  4. | MatchMapping of {
    1. location : Location.t;
    2. keys : Expression.t list;
    3. patterns : t list;
    4. rest : Identifier.t option;
    }
  5. | MatchClass of {
    1. location : Location.t;
    2. cls : Expression.t;
    3. patterns : t list;
    4. kwd_attrs : Identifier.t list;
    5. kwd_patterns : t list;
    }
  6. | MatchStar of {
    1. location : Location.t;
    2. name : Identifier.t option;
    }
  7. | MatchAs of {
    1. location : Location.t;
    2. pattern : t option;
    3. name : Identifier.t option;
    }
  8. | MatchOr of {
    1. location : Location.t;
    2. patterns : t list;
    }
include Sexplib0.Sexpable.S with type t := t
val t_of_sexp : Sexplib0.Sexp.t -> t
val sexp_of_t : t -> Sexplib0.Sexp.t
include Ppx_compare_lib.Comparable.S with type t := t
val compare : t -> t -> int
include Ppx_hash_lib.Hashable.S with type t := t
val hash_fold_t : Base.Hash.state -> t -> Base.Hash.state
val hash : t -> Base.Hash.hash_value
val make_matchvalue_of_t : location:Location.t -> value:Expression.t -> unit -> t
val make_matchsingleton_of_t : location:Location.t -> value:Constant.t -> unit -> t
val make_matchsequence_of_t : location:Location.t -> ?patterns:t list -> unit -> t
val make_matchmapping_of_t : location:Location.t -> ?keys:Expression.t list -> ?patterns:t list -> ?rest:Identifier.t -> unit -> t
val make_matchclass_of_t : location:Location.t -> cls:Expression.t -> ?patterns:t list -> ?kwd_attrs:Identifier.t list -> ?kwd_patterns:t list -> unit -> t
val make_matchstar_of_t : location:Location.t -> ?name:Identifier.t -> unit -> t
val make_matchas_of_t : location:Location.t -> ?pattern:t -> ?name:Identifier.t -> unit -> t
val make_matchor_of_t : location:Location.t -> ?patterns:t list -> unit -> t
OCaml

Innovation. Community. Security.