Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
v420v committed Sep 17, 2024
1 parent 505f253 commit b287a84
Show file tree
Hide file tree
Showing 3 changed files with 180 additions and 186 deletions.
4 changes: 0 additions & 4 deletions src/codegen/codegen.ibu
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ func new_gen() *Gen {
return g;
}

func gen_expr(g *Gen, node *Node) i32;

func gen_lhs_rhs(g *Gen, lhs *Node, rhs *Node) i32 {
gen_expr(g, rhs);
printf("\tpush %%rax\n");
Expand Down Expand Up @@ -427,8 +425,6 @@ func gen_expr(g *Gen, node *Node) i32 {
exit(1);
}

func gen_stmt(g *Gen, node *Node) i32;

func gen_node_block(g *Gen, stmts *Vec) i32 {
let idx i32 = 0;
while idx < stmts.len {
Expand Down
6 changes: 6 additions & 0 deletions src/parser/header.ibu
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,12 @@ func parse_stmt(p *Parser) *Node;
func parse_block(p *Parser) *Node;
func node_true() *Node;
func initializer(p *Parser, lhs *Node) *Node;
func parse_let(p *Parser) *Node;
func parse_goto(p *Parser) *Node;
func parse_if(p *Parser) *Node;
func parse_return(p *Parser) *Node;
func parse_while(p *Parser) *Node;
func parse_label(p *Parser) *Node;
func new_member(name *u8, ty *Type) *Member;
func calc_sizof_struct_members(members *Vec) i32;
func parse_struct(p *Parser) i32;
Expand Down
Loading

0 comments on commit b287a84

Please sign in to comment.