separate typed and untyped ASTs
This commit is contained in:
parent
91148b1a20
commit
86d4f7fffb
14 changed files with 512 additions and 262 deletions
|
|
@ -1,27 +0,0 @@
|
|||
use crate::ast::*;
|
||||
|
||||
#[derive(Debug, PartialEq)]
|
||||
pub enum Expr {
|
||||
BinaryExpression(Box<Expr>, BinaryOperator, Box<Expr>),
|
||||
Identifier(Identifier),
|
||||
Call(Box<Call>),
|
||||
// Literals
|
||||
BooleanLiteral(bool),
|
||||
IntegerLiteral(i64),
|
||||
FloatLiteral(f64),
|
||||
StringLiteral(String),
|
||||
Block(Box<Block>),
|
||||
/// Last field is either Expr::Block or Expr::IfExpr
|
||||
IfExpr(Box<Expr>, Box<Block>, Box<Expr>),
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq, Clone)]
|
||||
pub enum BinaryOperator {
|
||||
Add,
|
||||
Sub,
|
||||
Mul,
|
||||
Div,
|
||||
Modulo,
|
||||
Equal,
|
||||
NotEqual,
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue