Still more work
This commit is contained in:
parent
8a92d5ffa8
commit
64d560a1fc
@ -8,7 +8,7 @@ use self::iron_llvm::core;
|
|||||||
use self::iron_llvm::core::types::{RealTypeCtor, RealTypeRef};
|
use self::iron_llvm::core::types::{RealTypeCtor, RealTypeRef};
|
||||||
use self::iron_llvm::{LLVMRef, LLVMRefCtor};
|
use self::iron_llvm::{LLVMRef, LLVMRefCtor};
|
||||||
|
|
||||||
use parser::{ParseResult, AST, ASTNode};
|
use parser::{ParseResult, AST, ASTNode, Prototype, Expression};
|
||||||
|
|
||||||
pub struct Context {
|
pub struct Context {
|
||||||
context: core::Context,
|
context: core::Context,
|
||||||
@ -96,3 +96,19 @@ impl IRBuilder for AST {
|
|||||||
result
|
result
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl IRBuilder for ASTNode {
|
||||||
|
fn codegen(&self, context: &mut Context, module_provider: &mut ModuleProvider) -> IRBuildingResult {
|
||||||
|
match self {
|
||||||
|
&ASTNode::ExprNode(ref expression) => expression.codegen(context, module_provider),
|
||||||
|
&ASTNode::FuncNode(ref function) => function.codegen(context, module_provider),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl IRBuilder for Function {
|
||||||
|
fn codegen(&self, context: &mut Context, module_provider: &mut ModuleProvider) -> IRBuildingResult {
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user