MCPcopy
hub / github.com/MadAppGang/dingo / ConstructorPattern

Struct ConstructorPattern

pkg/ast/match.go:86–92  ·  view source on GitHub ↗

ConstructorPattern represents: Ok(x), Err(e), Some(v), None, EnumName_Variant(x) CRITICAL: Supports nested patterns in Params

Source from the content-addressed store, hash-verified

84// ConstructorPattern represents: Ok(x), Err(e), Some(v), None, EnumName_Variant(x)
85// CRITICAL: Supports nested patterns in Params
86type ConstructorPattern struct {
87 NamePos token.Pos // Position of constructor name
88 Name string // Constructor name (Ok, Err, Some, None, or qualified)
89 LParen token.Pos // Position of '(' (zero if no params)
90 Params []Pattern // CHANGED: Pattern instead of string (enables nesting!)
91 RParen token.Pos // Position of ')' (zero if no params)
92}
93
94func (p *ConstructorPattern) PatternNode() {}
95func (p *ConstructorPattern) Pos() token.Pos {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected