roc/compiler/parse/src/pattern.rs
2020-03-06 01:43:39 -05:00

11 lines
424 B
Rust

/// Different patterns are supported in different circumstances.
/// For example, when branches can pattern match on number literals, but
/// assignments and function args can't. Underscore is supported in function
/// arg patterns and in when branch patterns, but not in assignments.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub enum PatternType {
TopLevelDef,
DefExpr,
FunctionArg,
WhenBranch,
}