feat: support module-qualified constructor patterns in match expressions (issue 3)
Added module: Option<Ident> to Pattern::Constructor, updated parser to handle module.Constructor(args) syntax in patterns, exported ADT constructors from modules, and copied type definitions during module import so types like Shape are usable in importing files. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -697,8 +697,9 @@ pub enum Pattern {
|
||||
Var(Ident),
|
||||
/// Literal: 42, "hello", true
|
||||
Literal(Literal),
|
||||
/// Constructor: Some(x), None, Ok(v)
|
||||
/// Constructor: Some(x), None, Ok(v), module.Constructor(x)
|
||||
Constructor {
|
||||
module: Option<Ident>,
|
||||
name: Ident,
|
||||
fields: Vec<Pattern>,
|
||||
span: Span,
|
||||
|
||||
Reference in New Issue
Block a user