assignment: Add variable assignment

* Syntax for x = y
* Compiler creates Inst::Store thunks
* New Vm::store function

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
2023-04-02 01:55:51 -07:00
parent bfe7ca33bd
commit 4d005494a3
6 changed files with 6767 additions and 2376 deletions

View File

@@ -2,7 +2,7 @@ use crate::syn::Spanned;
#[derive(Debug, Clone)]
pub enum Stmt {
Assign(AssignLhs, Expr),
Assign(SpAssignLhs, SpExpr),
Expr(SpExpr),
If {
if_true: SpCondExpr,
@@ -20,6 +20,8 @@ pub enum Stmt {
},
}
pub type SpAssignLhs = Spanned<AssignLhs>;
#[derive(Debug, Clone)]
pub enum AssignLhs {
/// A simple assignment.