static bool TryFind(Node n, ExpConstants id, out Node found) { if ((ExpConstants)n.Id == id) { found = n; return(true); } for (var i = 0; i < n.GetChildCount(); ++i) { if (TryFind(n[i], id, out found)) { return(true); } } found = default; return(false); }
static Node Find(Node n, ExpConstants id) { Assert.IsTrue(TryFind(n, id, out var found)); return(found); }