iterator_item
iterator_item copied to clipboard
A mix between your initial syntax and RFC 2996
Here's another quick test :)
Your & javascript's fn*
+ RFC 2996 (and regular rust) return types syntax.
fn* foo() -> i32 {
for n in 0i32..10 {
yield n;
}
}
And for fun, something more involved (but not as involved as parsing invalid syntax as if it were valid): a simile yield from some_iterator;
— made easier to parse with yield #[from] some_iterator;
.
Making the first example expressible as:
fn* foo() -> i32 {
yield #[from] 0i32..10;
}
(and only for sync code, not async generators)
Which reminds me: you mentioned for await in it
here but IIUC from this test above, syn
won't be able to parse that and visit that node at this location ?