protected override int InnerParse(ParseArgs args) { var count = Items.Count; if (HasNamedChildren) { args.Push(); for (int i = 0; i < count; i++) { var parser = Items[i]; if (parser != null) { var match = parser.Parse(args); if (match < 0) { args.ClearMatches(); } else { args.PopSuccess(); return match; } } else { args.PopFailed(); return 0; } } args.PopFailed(); } else { for (int i = 0; i < count; i++) { var parser = Items[i]; if (parser != null) { var match = parser.Parse(args); if (match >= 0) return match; } else { return 0; } } } return -1; }
protected override int InnerParse(ParseArgs args) { if (!HasNamedChildren) { var match = Inner.Parse(args); return match < 0 ? 0 : match; } else { args.Push(); var match = Inner.Parse(args); if (match >= 0) { args.PopSuccess(); return match; } args.PopFailed(); return 0; } }