conlang: Introduce ..rest Patterns, refactor Ranges

This commit is contained in:
2025-02-23 02:41:41 -06:00
parent cc6168b55e
commit 7d3f189100
12 changed files with 162 additions and 73 deletions

View File

@@ -413,6 +413,7 @@ pub struct Let {
pub enum Pattern {
Name(Sym),
Literal(Literal),
Rest(Option<Box<Pattern>>),
Ref(Mutability, Box<Pattern>),
Tuple(Vec<Pattern>),
Array(Vec<Pattern>),
@@ -505,6 +506,8 @@ pub enum UnaryKind {
Deref,
Neg,
Not,
RangeInc,
RangeExc,
/// A Loop expression: `loop` [`Block`]
Loop,
/// Unused