diff --git a/compile.schala b/compile.schala index 98c6ce0..42db015 100644 --- a/compile.schala +++ b/compile.schala @@ -1,4 +1,5 @@ +が = 80 a = 1 b = 2 -a + b +a + b + が diff --git a/src/compilation.rs b/src/compilation.rs index e775dcd..d742eae 100644 --- a/src/compilation.rs +++ b/src/compilation.rs @@ -88,8 +88,14 @@ trait CodeGen { impl CodeGen for AST { fn codegen(&self, data: &mut CompilationData) -> LLVMValueRef { - let first = self.get(0).unwrap(); - first.codegen(data) + + let int_type = LLVMWrap::Int64TypeInContext(data.context); + let mut ret = LLVMWrap::ConstInt(int_type, 0, false); + + for statement in self { + ret = statement.codegen(data); + } + ret } }