alongubkin / alongubkin/spider

Generators

未关闭
#68 4 条评论 0 个 reaction 已指派 1 人 已被 @alongubkin 认领 在 GitHub 查看
enhancement
主要语言
JavaScript
星标
1.3k
派生
46
PR 合并指标
30 天内没有已合并 PR

描述

Add generators support to Spider.

```
fn inorder(node) {
if (node) {
yield* inorder(node.left);
yield t.label;
yield* inorder(node.right);
}
}
```

compiles to:

```
function* inorder(node) {
if (node) {
yield* inorder(node.left);
yield node.label;
yield* inorder(node.right);
}
}
```

Note that `*` is not required near the Spider function declaration.

If you have a better idea for the `yield*` syntax, please let me know.

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。