feat: compile Endor await expressions through the source pipeline

This commit is contained in:
2026-10-23 20:14:15 +08:00
parent 16816c38c7
commit 8a2135897e
8 changed files with 39 additions and 6 deletions
+3 -1
View File
@@ -332,7 +332,9 @@ impl Builder {
binding,
});
}
ExprKind::Unary { operand, .. } => self.expression(operand, globals)?,
ExprKind::Unary { operand, .. } | ExprKind::Await { operand } => {
self.expression(operand, globals)?
}
ExprKind::Binary { left, right, .. } => {
self.expression(left, globals)?;
self.expression(right, globals)?;
+4
View File
@@ -300,6 +300,10 @@ impl<'a> Emitter<'a> {
}
self.emit(Opcode::Call, arguments.len())?;
}
ExprKind::Await { operand } => {
self.expression(operand)?;
self.simple(Opcode::Await);
}
ExprKind::Member { object, name } => {
self.expression(object)?;
self.emit(Opcode::LoadAttr, self.name_index(&name.text))?;