pub type UntypedPattern = Pattern<(), (), Namespace, (u8, Span)>;Aliased Type§
pub enum UntypedPattern {
Int {
location: Span,
value: String,
base: Base,
},
ByteArray {
location: Span,
value: Vec<(u8, Span)>,
preferred_format: ByteArrayFormatPreference,
},
Var {
location: Span,
name: String,
},
Assign {
name: String,
location: Span,
pattern: Box<Pattern<(), (), Namespace, (u8, Span)>>,
},
Discard {
name: String,
location: Span,
},
List {
location: Span,
elements: Vec<Pattern<(), (), Namespace, (u8, Span)>>,
tail: Option<Box<Pattern<(), (), Namespace, (u8, Span)>>>,
},
Constructor {
is_record: bool,
location: Span,
name: String,
arguments: Vec<CallArg<Pattern<(), (), Namespace, (u8, Span)>>>,
module: Option<Namespace>,
constructor: (),
spread_location: Option<Span>,
tipo: (),
},
Pair {
location: Span,
fst: Box<Pattern<(), (), Namespace, (u8, Span)>>,
snd: Box<Pattern<(), (), Namespace, (u8, Span)>>,
},
Tuple {
location: Span,
elems: Vec<Pattern<(), (), Namespace, (u8, Span)>>,
},
}Variants§
Int
ByteArray
Var
The creation of a variable.
e.g. expect [this_is_a_var, .._] = x
e.g. let foo = 42
Assign
A name given to a sub-pattern using the as keyword.
when foo is {
[_, _] as the_list -> ...
}Discard
A pattern that binds to any value but does not assign a variable. Always starts with an underscore.
List
Fields
Constructor
The constructor for a custom type. Starts with an uppercase letter.