restructure parsing and typing modules

* parsing backend submodules
* move typing to its own module
This commit is contained in:
Romain Paquet 2023-07-05 16:14:30 +02:00
parent 43df8c4b0a
commit 99434748fa
16 changed files with 1315 additions and 316 deletions

View file

@ -4,10 +4,15 @@ use crate::ast::*;
pub enum Expr {
BinaryExpression(Box<Expr>, BinaryOperator, Box<Expr>),
Identifier(Identifier),
Call(Box<Call>),
// Literals
BooleanLiteral(bool),
IntegerLiteral(i64),
FloatLiteral(f64),
StringLiteral(String),
Call(Box<Call>),
Block(Box<Block>),
/// Last field is either Expr::Block or Expr::IfExpr
IfExpr(Box<Expr>, Box<Block>, Box<Expr>),
}
#[derive(Debug, PartialEq, Clone)]
@ -16,4 +21,7 @@ pub enum BinaryOperator {
Sub,
Mul,
Div,
Modulo,
Equal,
NotEqual,
}