Before attempt to convert buffer to dyn

This commit is contained in:
2024-11-21 19:21:15 -07:00
parent 028051a178
commit abaf58374f
3 changed files with 36 additions and 7 deletions

View File

@@ -135,6 +135,8 @@ where
// match functions with a `fn` keyword
TokenType::Keyword(Keyword::Fn) => Expression::FunctionExpression(self.function()?),
TokenType::Identifier(ref id) => Expression::Variable(id.clone()),
// match block expressions with a `{` symbol
TokenType::Symbol(Symbol::LBrace) => Expression::BlockExpression(self.block()?),
@@ -353,7 +355,7 @@ mod tests {
let input = r#"
// This is a function. The parser is starting to get more complex
fn add(x, y) {
let z = 5;
let z = x;
}
"#;