Enum cranelift_isle::ast::Pattern [−][src]
pub enum Pattern {
BindPattern {
var: Ident,
subpat: Box<Pattern>,
pos: Pos,
},
Var {
var: Ident,
pos: Pos,
},
ConstInt {
val: i64,
pos: Pos,
},
ConstPrim {
val: Ident,
pos: Pos,
},
Term {
sym: Ident,
args: Vec<TermArgPattern>,
pos: Pos,
},
Wildcard {
pos: Pos,
},
And {
subpats: Vec<Pattern>,
pos: Pos,
},
MacroArg {
index: usize,
pos: Pos,
},
}
Expand description
A pattern: the left-hand side of a rule.
Variants
BindPattern
An operator that binds a variable to a subterm and match the subpattern.
Var
A variable that has already been bound (=x
syntax).
ConstInt
An operator that matches a constant integer value.
ConstPrim
An operator that matches an external constant value.
Term
An application of a type variant or term.
Wildcard
Fields
pos: Pos
An operator that matches anything.
And
N sub-patterns that must all match.
MacroArg
Internal use only: macro argument in a template.
Implementations
Call f
for each of the terms in this pattern.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Pattern
impl UnwindSafe for Pattern
Blanket Implementations
Mutably borrows from an owned value. Read more