From 9e6c0a92dbedb5b8801772802e2e5d2e56cb9bcf Mon Sep 17 00:00:00 2001 From: Johannes Stoelp Date: Tue, 14 Sep 2021 00:19:40 +0200 Subject: ch3: added LLVM IR code gen - Added safe wrapper around LLVM C API - Added codegen module to emit LLVM IR for the AST - Update the main repl loop to codegen LLVM IR --- src/parser.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/parser.rs') diff --git a/src/parser.rs b/src/parser.rs index 63f5a77..af69a87 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -19,15 +19,16 @@ pub enum ExprAST { /// which captures its name, and its argument names (thus implicitly the number /// of arguments the function takes). #[derive(Debug, PartialEq)] -pub struct PrototypeAST(String, Vec); +pub struct PrototypeAST(pub String, pub Vec); /// FunctionAST - This class represents a function definition itself. #[derive(Debug, PartialEq)] -pub struct FunctionAST(PrototypeAST, ExprAST); +pub struct FunctionAST(pub PrototypeAST, pub ExprAST); /// Parse result with String as Error type (to be compliant with tutorial). type ParseResult = Result; +/// Parser for the `kaleidoscope` language. pub struct Parser where I: Iterator, -- cgit v1.2.3