feat: add as operator

This commit is contained in:
Shunsuke Shibayama 2023-04-19 15:20:46 +09:00
parent 1c6a6b2ec8
commit daf01f3cf2
14 changed files with 119 additions and 12 deletions

View file

@ -1452,6 +1452,11 @@ impl PyCodeGenerator {
self.emit_push_null();
self.emit_load_name_instr(Identifier::private("#in_operator"));
}
// (x as T) == x
TokenKind::AsOp => {
self.emit_expr(*bin.lhs);
return;
}
_ => {}
}
let lhs_t = bin