36 lines
527 B
Rust
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,
|
|
}
|