feat(ir,backend,frontend): Support for and revise ir array param generate
This commit is contained in:
@@ -18,6 +18,7 @@ pub struct HirVarDeclStmt {
|
||||
pub struct HirVarDeclStmtValue {
|
||||
pub symbol: SymbolId,
|
||||
pub name_span: Span,
|
||||
pub value: Option<HirExpr>,
|
||||
}
|
||||
|
||||
pub struct HirFuncDeclStmt {
|
||||
@@ -46,6 +47,7 @@ pub enum HirStatement {
|
||||
VarDecl(HirVarDeclStmt),
|
||||
If(HirIfStmt),
|
||||
While(HirWhileStmt),
|
||||
For(HirForStmt),
|
||||
Break(HirBreakStmt),
|
||||
Continue(HirContinueStmt),
|
||||
}
|
||||
@@ -67,6 +69,18 @@ pub struct HirWhileStmt {
|
||||
pub body: HirBlockStmt,
|
||||
}
|
||||
|
||||
pub struct HirForStmt {
|
||||
pub init: Option<HirForInit>,
|
||||
pub condition: Option<HirExpr>,
|
||||
pub update: Option<HirExpr>,
|
||||
pub body: HirBlockStmt,
|
||||
}
|
||||
|
||||
pub enum HirForInit {
|
||||
Expr(HirExpr),
|
||||
VarDecl(HirVarDeclStmt),
|
||||
}
|
||||
|
||||
pub struct HirBreakStmt {
|
||||
pub span: Span,
|
||||
}
|
||||
@@ -102,6 +116,11 @@ pub enum HirExprValue {
|
||||
op: UnaryOp,
|
||||
operand: Box<HirExpr>,
|
||||
},
|
||||
IncDec {
|
||||
op: crate::ast::types::IncDecOp,
|
||||
operand: Box<HirExpr>,
|
||||
is_prefix: bool,
|
||||
},
|
||||
FuncCall(FunctionId, Vec<HirExpr>),
|
||||
Assign {
|
||||
lvalue: Box<HirExpr>,
|
||||
|
||||
Reference in New Issue
Block a user