feat(backend/riscv32): 实现基础的编译器功能
- 完成 RV32IMA 指令集的代码生成 - 添加整数运算、分支、调用等基本指令支持 - 实现从 IR 到机器码的转换 - 添加简单的测试用例和测试框架
This commit is contained in:
@@ -89,8 +89,12 @@ ast_node_t* parse_stmt(parser_t* parser) {
|
||||
|
||||
// init expr or init decl_var
|
||||
// TODO need add this feature
|
||||
node->for_stmt.init = parse_expr(parser);
|
||||
expect_pop_tok(tokbuf, TOKEN_SEMICOLON);
|
||||
if (peek_decl(tokbuf)) {
|
||||
node->for_stmt.init = parse_decl_val(parser);
|
||||
} else {
|
||||
node->for_stmt.init = parse_expr(parser);
|
||||
expect_pop_tok(tokbuf, TOKEN_SEMICOLON);
|
||||
}
|
||||
|
||||
// cond expr or null
|
||||
ttype = peek_tok_type(tokbuf);
|
||||
|
||||
Reference in New Issue
Block a user