cl-parser: Dedicated parsing logic for patterns!

This commit is contained in:
2025-05-18 04:00:00 -04:00
parent e6156343c3
commit 3e2063835b
11 changed files with 100 additions and 4 deletions

View File

@@ -338,6 +338,7 @@ impl WeightOf for Pattern {
fn weight_of(&self) -> usize {
match self {
Pattern::Name(s) => size_of_val(s),
Pattern::Path(p) => p.weight_of(),
Pattern::Literal(literal) => literal.weight_of(),
Pattern::Rest(Some(pattern)) => pattern.weight_of(),
Pattern::Rest(None) => 0,