private void Scan(AstNode node) { var replace = new List<AstNode>(); foreach (var ch in node.Children) { if (ch is ThisLiteral) { replace.Add(ch); } else { Scan(ch); } } foreach (var x in replace) { node.ReplaceChild(x, new Lookup(x.Context) { Name = ThisCode }); } }
private void Scan(AstNode node) { var replace = new List <AstNode>(); foreach (var ch in node.Children) { if (ch is ThisLiteral) { replace.Add(ch); } else { Scan(ch); } } foreach (var x in replace) { node.ReplaceChild(x, new Lookup(x.Context) { Name = ThisCode }); } }