/// <summary> /// Indicates a successful parse operation without actually parsing by yielding the specified scalar <paramref name="result"/>. /// </summary> /// <typeparam name="TSource">The type of the source elements.</typeparam> /// <typeparam name="TIntermediate">The type of the elements that are generated from parsing the source elements.</typeparam> /// <typeparam name="TResult">The type of the <paramref name="result"/>.</typeparam> /// <param name="parser">The parser for which the specified <paramref name="result"/> indicates success.</param> /// <param name="result">The value of the created parser's result.</param> /// <returns>A parser that always returns the specified scalar <paramref name="result"/> with a length /// of zero, starting from the index at which the specified <paramref name="parser"/> starts.</returns> public static IObservableParser <TSource, TResult> Success <TSource, TIntermediate, TResult>( this IObservableParser <TSource, TIntermediate> parser, TResult result) { Contract.Requires(parser != null); Contract.Ensures(Contract.Result <IObservableParser <TSource, TResult> >() != null); return(parser.Success(result, length: 0)); }