Skip to content

Commit

Permalink
♻️ remove unneeded comments
Browse files Browse the repository at this point in the history
  • Loading branch information
KPMGE committed Mar 25, 2024
1 parent 045cae0 commit d06b73c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions src/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,25 @@ pub enum Expression {
Boolean(bool),
String(String),
Prefix {
operator: Token, // Token::Bang, Token::Minus
operator: Token,
right: Box<Expression>,
},
Infix {
operator: Token, // Token::Plus, Token::Minus, Token::Equals etc.
operator: Token,
left: Box<Expression>,
right: Box<Expression>,
},
IfExpression {
condition: Box<AstNode>,
consequence: BlockStatement, // Statement::BlockStatement
alternative: Option<BlockStatement>, // Statement::BlockStatement
consequence: BlockStatement,
alternative: Option<BlockStatement>,
},
FunctionExpression {
parameters: Vec<Token>, // Vec<Token::Identifier>
parameters: Vec<Token>,
body: BlockStatement,
},
CallExpression {
function: Box<Expression>, // Expression::FunctionExpression or Expression::Identifier
function: Box<Expression>,
arguments: Vec<Expression>,
},
}
Expand All @@ -39,7 +39,7 @@ pub struct BlockStatement {
pub enum Statement {
ReturnStatement(Expression),
LetStatement {
name: Expression, // Expression::Identifer
name: Expression,
value: Expression,
},
}
Expand Down
2 changes: 1 addition & 1 deletion src/evaluator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pub enum Object {
String(String),
Return(Box<Object>),
Function {
parameters: Vec<Token>, // Token::Identifier
parameters: Vec<Token>,
body: BlockStatement,
scope: HashMap<String, Object>,
},
Expand Down

0 comments on commit d06b73c

Please sign in to comment.