This repository has been archived on 2020-09-15. You can view files and clone it, but cannot push or open issues or pull requests.
Files
not-python-old.2020-08-27/src/compile/ir.rs
Alek Ratzloff 0eaa5060a2 Run cargo fmt
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2020-05-20 15:25:10 -04:00

36 lines
527 B
Rust

use crate::{obj::Sym, syn::span::*};
pub type Body = Vec<Stmt>;
#[derive(Debug, Clone)]
pub enum Stmt {
Eval(Expr),
Assign(Lhs, Expr),
}
#[derive(Debug, Clone)]
pub enum Lhs {
Name(Sym),
Complex(Expr),
}
#[derive(Debug, Clone)]
pub enum Expr {
Call(Box<Expr>, Vec<Expr>),
Base(BaseExpr),
}
#[derive(Debug, Clone)]
pub enum BaseExprKind {
Num(i64),
Str(String),
Sym(Sym),
Ident(Sym),
}
#[derive(Debug, Clone)]
pub struct BaseExpr {
pub kind: BaseExprKind,
pub span: Span,
}