From 6eb6ad9f574c783d471f6a863299af25b6f5a8c7 Mon Sep 17 00:00:00 2001 From: Johannes Stoelp Date: Sat, 25 Sep 2021 00:48:45 +0200 Subject: ch4: added jit --- src/parser.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/parser.rs') diff --git a/src/parser.rs b/src/parser.rs index af69a87..b3a26cb 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -18,7 +18,7 @@ pub enum ExprAST { /// PrototypeAST - This class represents the "prototype" for a function, /// which captures its name, and its argument names (thus implicitly the number /// of arguments the function takes). -#[derive(Debug, PartialEq)] +#[derive(Debug, PartialEq, Clone)] pub struct PrototypeAST(pub String, pub Vec); /// FunctionAST - This class represents a function definition itself. @@ -307,7 +307,7 @@ where /// Implement `std::unique_ptr ParseTopLevelExpr();` from the tutorial. pub fn parse_top_level_expr(&mut self) -> ParseResult { let e = self.parse_expression()?; - let proto = PrototypeAST("".into(), Vec::new()); + let proto = PrototypeAST("__anon_expr".into(), Vec::new()); Ok(FunctionAST(proto, e)) } } -- cgit v1.2.3