From f9d13f3098b2a5984f59d612be87c184aba0b2c7 Mon Sep 17 00:00:00 2001 From: Cody Date: Fri, 24 Mar 2023 17:33:44 -0500 Subject: Stuff and things --- src/ast/mod.rs | 75 ---------------------------------------------------------- 1 file changed, 75 deletions(-) delete mode 100644 src/ast/mod.rs (limited to 'src/ast/mod.rs') diff --git a/src/ast/mod.rs b/src/ast/mod.rs deleted file mode 100644 index b3e7c36..0000000 --- a/src/ast/mod.rs +++ /dev/null @@ -1,75 +0,0 @@ -use crate::lexer::{Literal, TokenType}; - -pub mod parser; -pub mod printer; - -#[derive(Debug, Eq, PartialEq)] -pub enum Stmt { - Block(Vec), - Expr(Expr), - Val { - ident: String, - value: Expr, - }, - Var { - ident: String, - value: Expr, - }, - Assignment { - ident: String, - value: Expr, - }, - Function { - ident: String, - arguments: Vec, - return_type: String, - body: Vec, - }, - If { - condition: Expr, - body: Vec, - }, - For { - binding: String, - range: (Expr, Expr), - body: Vec, - }, - While { - condition: Expr, - body: Vec, - }, - Return { - value: Expr, - }, -} - -#[derive(Debug, Eq, PartialEq)] -pub struct FunctionArgument { - name: String, - types: String, -} - -#[derive(Debug, Eq, PartialEq)] -pub enum Expr { - Literal(Literal), - Variable(String), - Grouping(Box), - Call { - ident: String, - arguments: Vec, - }, - Binary { - operator: TokenType, - lhs: Box, - rhs: Box, - }, - Unary { - operator: TokenType, - expr: Box, - }, -} - -pub trait AstVisitor { - fn visit_stmt(&mut self, stmt: &Stmt) -> T; - fn visit_expr(&mut self, expr: &Expr) -> T; -} -- cgit v1.2.3