Skip to content

Commit

Permalink
Refactor expression module, rename files and imports for consistency …
Browse files Browse the repository at this point in the history
…and clarity.
  • Loading branch information
DaviRain-Su committed Oct 23, 2023
1 parent b1240c7 commit bab7840
Show file tree
Hide file tree
Showing 17 changed files with 43 additions and 43 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/ast/expression/if_expression.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::ast::expression::integer_literal::IntegerLiteral;
use crate::ast::expression::integer::IntegerLiteral;
use crate::ast::expression::Expression;
use crate::ast::statement::block::BlockStatement;
use crate::ast::NodeInterface;
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::ast::expression::integer_literal::IntegerLiteral;
use crate::ast::expression::integer::IntegerLiteral;
use crate::ast::expression::Expression;
use crate::ast::statement::expression::ExpressionStatement;
use crate::ast::NodeInterface;
Expand Down
File renamed without changes.
36 changes: 18 additions & 18 deletions src/ast/expression/mod.rs
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
use crate::ast::expression::array_literal::ArrayLiteral;
use crate::ast::expression::array::ArrayLiteral;
use crate::ast::expression::boolean::Boolean;
use crate::ast::expression::call_expression::Call;
use crate::ast::expression::function_literal::FunctionLiteral;
use crate::ast::expression::hash_literal::HashLiteral;
use crate::ast::expression::call::Call;
use crate::ast::expression::function::FunctionLiteral;
use crate::ast::expression::hash::HashLiteral;
use crate::ast::expression::if_expression::If;
use crate::ast::expression::index_expression::Index;
use crate::ast::expression::infix_expression::Infix;
use crate::ast::expression::integer_literal::IntegerLiteral;
use crate::ast::expression::prefix_expression::Prefix;
use crate::ast::expression::string_literal::StringLiteral;
use crate::ast::expression::index::Index;
use crate::ast::expression::infix::Infix;
use crate::ast::expression::integer::IntegerLiteral;
use crate::ast::expression::prefix::Prefix;
use crate::ast::expression::string::StringLiteral;
use crate::ast::Identifier;
use crate::ast::NodeInterface;
use std::fmt::{Display, Formatter};

pub mod array_literal;
pub mod array;
pub mod boolean;
pub mod call_expression;
pub mod function_literal;
pub mod hash_literal;
pub mod call;
pub mod function;
pub mod hash;
pub mod if_expression;
pub mod index_expression;
pub mod infix_expression;
pub mod integer_literal;
pub mod prefix_expression;
pub mod string_literal;
pub mod index;
pub mod infix;
pub mod integer;
pub mod prefix;
pub mod string;

#[derive(Debug, Clone, Hash, Eq, PartialEq, Ord, PartialOrd)]
pub enum Expression {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::ast::expression::integer_literal::IntegerLiteral;
use crate::ast::expression::integer::IntegerLiteral;
use crate::ast::expression::Expression;
use crate::ast::statement::expression::ExpressionStatement;
use crate::ast::NodeInterface;
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/ast/statement/expression.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::ast::expression::integer_literal::IntegerLiteral;
use crate::ast::expression::integer::IntegerLiteral;
use crate::ast::expression::Expression;
use crate::ast::statement::Statement;
use crate::ast::NodeInterface;
Expand Down
2 changes: 1 addition & 1 deletion src/ast/statement/let_statement.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::ast::expression::integer_literal::IntegerLiteral;
use crate::ast::expression::integer::IntegerLiteral;
use crate::ast::expression::Expression;
use crate::ast::statement::Statement;
use crate::ast::{Identifier, NodeInterface};
Expand Down
2 changes: 1 addition & 1 deletion src/ast/statement/return_statement.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::ast::expression::integer_literal::IntegerLiteral;
use crate::ast::expression::integer::IntegerLiteral;
use crate::ast::expression::Expression;
use crate::ast::statement::Statement;
use crate::ast::NodeInterface;
Expand Down
2 changes: 1 addition & 1 deletion src/evaluator/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::ast::expression::hash_literal::HashLiteral;
use crate::ast::expression::hash::HashLiteral;
use crate::ast::expression::if_expression::If;
use crate::ast::expression::Expression;
use crate::ast::statement::block::BlockStatement;
Expand Down
18 changes: 9 additions & 9 deletions src/parser/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ pub mod parser_tracing;
#[cfg(test)]
mod tests;

use crate::ast::expression::array_literal::ArrayLiteral;
use crate::ast::expression::array::ArrayLiteral;
use crate::ast::expression::boolean::Boolean;
use crate::ast::expression::call_expression::Call;
use crate::ast::expression::function_literal::FunctionLiteral;
use crate::ast::expression::hash_literal::HashLiteral;
use crate::ast::expression::call::Call;
use crate::ast::expression::function::FunctionLiteral;
use crate::ast::expression::hash::HashLiteral;
use crate::ast::expression::if_expression::If;
use crate::ast::expression::index_expression::Index;
use crate::ast::expression::infix_expression::Infix;
use crate::ast::expression::integer_literal::IntegerLiteral;
use crate::ast::expression::prefix_expression::Prefix;
use crate::ast::expression::string_literal::StringLiteral;
use crate::ast::expression::index::Index;
use crate::ast::expression::infix::Infix;
use crate::ast::expression::integer::IntegerLiteral;
use crate::ast::expression::prefix::Prefix;
use crate::ast::expression::string::StringLiteral;
use crate::ast::expression::Expression;
use crate::ast::statement::block::BlockStatement;
use crate::ast::statement::expression::ExpressionStatement;
Expand Down
18 changes: 9 additions & 9 deletions src/parser/tests.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
use crate::ast::expression::array_literal::ArrayLiteral;
use crate::ast::expression::array::ArrayLiteral;
use crate::ast::expression::boolean::Boolean;
use crate::ast::expression::call_expression::Call;
use crate::ast::expression::function_literal::FunctionLiteral;
use crate::ast::expression::hash_literal::HashLiteral;
use crate::ast::expression::call::Call;
use crate::ast::expression::function::FunctionLiteral;
use crate::ast::expression::hash::HashLiteral;
use crate::ast::expression::if_expression::If;
use crate::ast::expression::index_expression::Index;
use crate::ast::expression::infix_expression::Infix;
use crate::ast::expression::integer_literal::IntegerLiteral;
use crate::ast::expression::prefix_expression::Prefix;
use crate::ast::expression::string_literal::StringLiteral;
use crate::ast::expression::index::Index;
use crate::ast::expression::infix::Infix;
use crate::ast::expression::integer::IntegerLiteral;
use crate::ast::expression::prefix::Prefix;
use crate::ast::expression::string::StringLiteral;
use crate::ast::expression::Expression;
use crate::ast::statement::expression::ExpressionStatement;
use crate::ast::statement::let_statement::LetStatement;
Expand Down

0 comments on commit bab7840

Please sign in to comment.