PatternKind

enum PatternKind

The grammar form and child nodes of a parsed pattern.

Variant and struct paths retain explicit generic arguments and source labels; exhaustiveness, binding agreement, and nominal resolution are later typing responsibilities rather than parser invariants.

Cases

case bind(String)

Binds the matched value to a local name.

case wildcard

Matches any value without binding it.

case literal_int(String)

Matches an integer literal preserved in source spelling.

case literal_float(String)

Matches a floating-point literal preserved in source spelling.

case literal_character(String)

Matches a decoded character literal.

case literal_string(String)

Matches a decoded string literal.

case literal_true

Matches the Boolean value true.

case literal_false

Matches the Boolean value false.

case tuple([Pattern])

Matches tuple elements positionally.

case or_pattern([Pattern])

Matches when any alternative pattern matches.

case variant(String?, [[GenericArg]], String, Int, Int, [Pattern], [String?])

Enum path (none for a leading dot), one explicit generic-argument list per path segment, variant name and its token span, field patterns, and one label per field (labels select fixed payload slots).

case struct_pattern(String, [[GenericArg]], [Pattern], [String], Bool)

Dotted struct path, per-segment generic arguments, field patterns, parallel field names, and whether a .. rest closed the list.

case macro_call_pattern(String, Int, Int, Int, Int, [MacroToken])

An @macro invocation in pattern position: name + its token span, the input extent, and canonical tokens (outer delimiters included).