as expr (tree walk)
This commit is contained in:
parent
192c123373
commit
fe350da24d
|
|
@ -1853,6 +1853,14 @@ ast_walk_for_each:
|
|||
je .if_expr
|
||||
cmp bl, AST_CALL
|
||||
je .call
|
||||
cmp bl, AST_AS
|
||||
je .as_expr
|
||||
jmp .check_scope
|
||||
|
||||
.as_expr:
|
||||
mov rbx, [rax + 8] ; AstNode.data = *AstAsExpr
|
||||
mov rax, [rbx + 0] ; AstCallExpr.expr
|
||||
push rax ; push expr index
|
||||
jmp .check_scope
|
||||
|
||||
.call:
|
||||
|
|
|
|||
|
|
@ -133,7 +133,7 @@ return main(1);
|
|||
|
||||
print_ast(
|
||||
b"fn main(a: u32) -> void {
|
||||
return 1 as u8;
|
||||
return a as u8;
|
||||
}",
|
||||
|ast| unsafe { parse_func(ast) },
|
||||
);
|
||||
|
|
|
|||
|
|
@ -324,6 +324,8 @@ pub struct Operand {
|
|||
pub register: u8,
|
||||
pub width: u16,
|
||||
pub len: u16,
|
||||
pub align: u8,
|
||||
pub bitset: u8,
|
||||
pub value: u64,
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue