Extend ast module with more nodes. Test send method on generators.

This commit is contained in:
Windel Bouwman
2018-10-24 16:02:59 +02:00
parent babb8ed2f0
commit 09e2c027cd
7 changed files with 439 additions and 138 deletions

View File

@@ -14,7 +14,7 @@ pub fn init(context: &PyContext) {
let ref generator_type = context.generator_type;
generator_type.set_attr("__iter__", context.new_rustfunc(generator_iter));
generator_type.set_attr("__next__", context.new_rustfunc(generator_next));
generator_type.set_attr("__send__", context.new_rustfunc(generator_send));
generator_type.set_attr("send", context.new_rustfunc(generator_send));
}
pub fn new_generator(vm: &mut VirtualMachine, frame: Frame) -> PyResult {