// public static T Case <T, In, NothingOrPrepared>(this MatchCollector <T, In, NothingOrPrepared> that, In expected, Action <In> result) { return(that.Add(new MatchSingle <In, NothingOrPrepared>( expected, F.ReturnDefault <In, NothingOrPrepared>(result)))); }
public static T Case <T, In, NothingOrPrepared>(this MatchCollector <T, In, NothingOrPrepared> that, Func <In, bool> expected, Action result) { return(that.Add(new Match <In, NothingOrPrepared>( expected, F.ReturnDefault <In, NothingOrPrepared>(F.IgnoreInput <In>(result))))); }
public static T Regex <T, Out>(this MatchCollector <T, string, Out> that, string expected, Func <Out> result) { var regex = new Regex(expected); return(that.Regex(regex, result)); }
public static T Regex <T, Out>(this MatchCollector <T, string, Out> that, Regex expected, Func <Out> result) { return(that.Add(new Match <string, Out>( expected.IsMatch, F.IgnoreInput <string, Out>(result)))); }
public static T Regex <T, NothingOrPrepared>(this MatchCollector <T, string, NothingOrPrepared> that, Regex expected, Action <Match> result) { return(that.Add(new Match <string, NothingOrPrepared>( expected.IsMatch, F.ReturnDefault <string, NothingOrPrepared>(i => result(expected.Match(i)))))); }
public static T Regex <T, NothingOrPrepared>(this MatchCollector <T, string, NothingOrPrepared> that, string expected, Action result) { var regex = new Regex(expected); return(that.Regex(regex, result)); }
public static T Regex <T, NothingOrPrepared>(this MatchCollector <T, string, NothingOrPrepared> that, Regex expected, Action result) { return(that.Add(new Match <string, NothingOrPrepared>( expected.IsMatch, F.ReturnDefault <string, NothingOrPrepared>(F.IgnoreInput <string>(result))))); }
public static T Fields <T, In, Out>(this MatchCollector <T, In, Out> that, Action <MatchFields <In, Out> > fields) { var m = new MatchFields <In, Out>(); m.Fields = true; fields(m); return(that.Add(new SwitchMatchFields <In, Out>(m.Funcs.ToArray(), m.TypeOfFields))); }
public static T Regex <T, Out>(this MatchCollector <T, string, Out> that, string expected, RegexOptions options, Out result) { var regex = new Regex(expected, options); return(that.Regex(regex, result)); }
public static T Regex <T, Out>(this MatchCollector <T, string, Out> that, Regex expected, Func <Match, Out> result) { return(that.Add(new Match <string, Out>(expected.IsMatch, i => result(expected.Match(i))))); }
public static T Else <T, In>(this MatchCollector <T, In, Prepared> that, Action <In> result) { return(that.Add(new MatchElse <In, Prepared>( F.ReturnDefault <In, Prepared>(result)))); }
public static T Case <T, On, In>( this MatchCollector <T, In, Nothing> that, Action <On> func) where On : In { return(that.Add(new MatchType <On, In, Nothing>(F.ReturnDefault <On, Nothing>(func)))); }