Enum cranelift_isle::sema::Pattern
source · pub enum Pattern {
BindPattern(TypeId, VarId, Box<Pattern>),
Var(TypeId, VarId),
ConstInt(TypeId, i128),
ConstPrim(TypeId, Sym),
Term(TypeId, TermId, Vec<Pattern>),
Wildcard(TypeId),
And(TypeId, Vec<Pattern>),
}
Expand description
A left-hand side pattern of some rule.
Variants§
BindPattern(TypeId, VarId, Box<Pattern>)
Bind a variable of the given type from the current value.
Keep matching on the value with the subpattern.
Var(TypeId, VarId)
Match the current value against an already bound variable with the given type.
ConstInt(TypeId, i128)
Match the current value against a constant integer of the given integer type.
ConstPrim(TypeId, Sym)
Match the current value against a constant primitive value of the given primitive type.
Term(TypeId, TermId, Vec<Pattern>)
Match the current value against the given extractor term with the given arguments.
Wildcard(TypeId)
Match anything of the given type successfully.
And(TypeId, Vec<Pattern>)
Match all of the following patterns of the given type.