lila/src/ast/expr.rs
Romain Paquet 99434748fa restructure parsing and typing modules
* parsing backend submodules
* move typing to its own module
2023-07-05 16:15:05 +02:00

27 lines
555 B
Rust

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,
}