diff options
author | Johannes Stoelp <johannes.stoelp@gmail.com> | 2021-09-25 00:48:45 +0200 |
---|---|---|
committer | Johannes Stoelp <johannes.stoelp@gmail.com> | 2021-09-25 00:48:45 +0200 |
commit | 6eb6ad9f574c783d471f6a863299af25b6f5a8c7 (patch) | |
tree | 38c087654f2c703d7d4c6afbf342aa9dd65557c9 /src/parser.rs | |
parent | 425ba77074347f71283f75839224f78bd94f2e10 (diff) | |
download | llvm-kaleidoscope-rs-6eb6ad9f574c783d471f6a863299af25b6f5a8c7.tar.gz llvm-kaleidoscope-rs-6eb6ad9f574c783d471f6a863299af25b6f5a8c7.zip |
ch4: added jit
Diffstat (limited to 'src/parser.rs')
-rw-r--r-- | src/parser.rs | 4 |
1 files changed, 2 insertions, 2 deletions
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<String>); /// FunctionAST - This class represents a function definition itself. @@ -307,7 +307,7 @@ where /// Implement `std::unique_ptr<FunctionAST> ParseTopLevelExpr();` from the tutorial. pub fn parse_top_level_expr(&mut self) -> ParseResult<FunctionAST> { let e = self.parse_expression()?; - let proto = PrototypeAST("".into(), Vec::new()); + let proto = PrototypeAST("__anon_expr".into(), Vec::new()); Ok(FunctionAST(proto, e)) } } |