cl-ast: Cleanup
- Function bind is now one Pattern - TyRef now allows &Ty (i.e. &[i32], &(char, bool) - Range patterns (they cannot bind, only check whether a value is in range - ArrayRep repeat has been reverted to usize, for now, until early consteval is implemented.
This commit is contained in:
@@ -342,6 +342,8 @@ impl WeightOf for Pattern {
|
||||
Pattern::Rest(Some(pattern)) => pattern.weight_of(),
|
||||
Pattern::Rest(None) => 0,
|
||||
Pattern::Ref(mutability, pattern) => mutability.weight_of() + pattern.weight_of(),
|
||||
Pattern::RangeExc(head, tail) => head.weight_of() + tail.weight_of(),
|
||||
Pattern::RangeInc(head, tail) => head.weight_of() + tail.weight_of(),
|
||||
Pattern::Tuple(patterns) | Pattern::Array(patterns) => patterns.weight_of(),
|
||||
Pattern::Struct(path, items) => {
|
||||
let sitems: usize = items
|
||||
|
||||
Reference in New Issue
Block a user