public override IEnumerable <Parser> Find(ParserFindArgs args) { if (Inner != null && args.Push(this)) { var ret = Inner.Find(args); args.Pop(); return(base.Find(args).Concat(ret)); } return(base.Find(args)); }
public override IEnumerable<Parser> Find(ParserFindArgs args) { if (Inner != null && args.Push(this)) { var ret = Inner.Find(args); args.Pop(); return base.Find(args).Concat(ret); } return base.Find(args); }
public override IEnumerable<Parser> Find(ParserFindArgs args) { if (args.Push(this)) { foreach (var item in base.Find(args)) { yield return item; } foreach (var item in Items) { if (item != null) { foreach (var child in item.Find(args)) yield return child; } } //ret = ret.Concat(Items.Where(r => r != null).SelectMany(r => r.Find(args)).ToArray()); args.Pop(); } //return ret; }
public override IEnumerable <Parser> Find(ParserFindArgs args) { if (args.Push(this)) { foreach (var item in base.Find(args)) { yield return(item); } foreach (var item in Items) { if (item != null) { foreach (var child in item.Find(args)) { yield return(child); } } } //ret = ret.Concat(Items.Where(r => r != null).SelectMany(r => r.Find(args)).ToArray()); args.Pop(); } //return ret; }