cl-ast: Move loop expression into unary exprs (with lowest priority)

This commit is contained in:
2024-07-30 18:21:25 -05:00
parent b0341f06fd
commit b64cc232f9
8 changed files with 28 additions and 57 deletions

View File

@@ -392,8 +392,6 @@ pub enum ExprKind {
Group(Group),
/// A [Tuple] expression: `(` [`Expr`] (`,` [`Expr`])+ `)`
Tuple(Tuple),
/// A [Loop] expression: `loop` [`Block`]
Loop(Loop),
/// A [While] expression: `while` [`Expr`] [`Block`] [`Else`]?
While(While),
/// An [If] expression: `if` [`Expr`] [`Block`] [`Else`]?
@@ -482,6 +480,8 @@ pub enum UnaryKind {
Deref,
Neg,
Not,
/// A Loop expression: `loop` [`Block`]
Loop,
/// Unused
At,
/// Unused
@@ -570,12 +570,6 @@ pub struct Tuple {
pub exprs: Vec<Expr>,
}
/// A [Loop] expression: `loop` [`Block`]
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub struct Loop {
pub body: Box<Expr>,
}
/// A [While] expression: `while` [`Expr`] [`Block`] [`Else`]?
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub struct While {