提交 4de5af13 编写于 作者: C Cyrus Najmabadi

Use struct iterator

上级 7b2bcfea
......@@ -52,13 +52,18 @@ private IEnumerable<SyntaxNode> WalkChildren(SyntaxNode node)
var current = stack.Pop();
yield return current;
foreach (var child in current.ChildNodes())
foreach (var child in current.ChildNodesAndTokens())
{
// Only process children if they're not the start of another construct
// that async/await would be related to.
if (!child.IsReturnableConstruct())
if (child.IsNode)
{
stack.Push(child);
var childNode = child.AsNode();
// Only process children if they're not the start of another construct
// that async/await would be related to.
if (!childNode.IsReturnableConstruct())
{
stack.Push(childNode);
}
}
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册