codegen: add Grouping expr support
- entry: return value of rayoko main
This commit is contained in:
parent
34481c8ea8
commit
809dad1095
3 changed files with 6 additions and 2 deletions
|
@ -26,7 +26,7 @@ fn multwo(num: i32, double_flag: bool) i32 {
|
|||
}
|
||||
|
||||
fn add(a: i32, b: i32) i32 {
|
||||
return a + b;
|
||||
return a + b + (2 * b);
|
||||
}
|
||||
|
||||
fn main() i32 {
|
||||
|
|
|
@ -258,6 +258,10 @@ pub const Codegen = struct {
|
|||
};
|
||||
},
|
||||
|
||||
.Grouping => |expr_ptr| blk: {
|
||||
break :blk try self.emitExpr(builder, expr_ptr);
|
||||
},
|
||||
|
||||
else => {
|
||||
std.debug.warn("Got unexpected expr {}\n", ast.ExprType(expr.*));
|
||||
return CompileError.EmitError;
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
int main(void) {
|
||||
__rayoko_main();
|
||||
return __rayoko_main();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue