CLF.Context
External contextual LF contexts.
In the parser, every untyped variable in head position of a context is disambiguated as a context variable.
type t = {
location : Syncom.Location.t;
head : Context.Head.t;
bindings : (Syncom.Identifier.t * Typ.t Support.Option.t) Support.List.t;
}
{ Context.head; bindings; _ }
is the context
^
if head = Head.None
and bindings = []
.x1 : t1, x2 : t2, ..., xn : tn
if head = Head.None
and bindings = [("x1", t1); ("x2", t2); ..., ("xn", tn)]
._
if head = Head.Hole
and bindings = []
._, x1 : t1, x2 : t2, ..., xn : tn
if head = Head.Hole
and bindings = [("x1", t1); ("x2", t2); ..., ("xn", tn)]
.g
if head = Head.Context_variable { identifier = "g"; _ }
and bindings = []
.g, x1 : t1, x2 : t2, ..., xn : tn
if head = Head.Context_variable { identifier = "g"; _ }
and bindings = [("x1", t1); ("x2", t2); ..., ("xn", tn)]
.module Head : sig ... end
module Pattern : sig ... end
External contextual LF context patterns.