Add base branch logic

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
2023-04-07 00:00:04 -07:00
parent 4d005494a3
commit 7bac4306c3
17 changed files with 20302 additions and 5491 deletions

View File

@@ -1,13 +1,16 @@
use crate::syn::Spanned;
pub type SpBody = Spanned<Body>;
pub type Body = Vec<SpStmt>;
#[derive(Debug, Clone)]
pub enum Stmt {
Assign(SpAssignLhs, SpExpr),
Expr(SpExpr),
If {
if_true: SpCondExpr,
elseif: Vec<SpCondExpr>,
else_expr: Option<SpExpr>,
if_true: SpCondBody,
elseif: Vec<SpCondBody>,
else_body: Option<SpBody>,
},
Def {
name: String,
@@ -38,12 +41,12 @@ pub enum AssignLhs {
pub type SpStmt = Spanned<Stmt>;
#[derive(Debug, Clone)]
pub struct CondExpr {
pub struct CondBody {
pub cond: SpExpr,
pub expr: SpExpr,
pub body: SpBody,
}
pub type SpCondExpr = Spanned<CondExpr>;
pub type SpCondBody = Spanned<CondBody>;
#[derive(Debug, Clone)]
pub struct Param {