/// <summary> /// Read the string up to any <see cref="Rune"/> that is included in <paramref name="runes"/> or until EOF is reached. /// The matched character is put in <paramref name="matched"/>. /// </summary> /// <param name="parser">A parser on which to operate.</param> /// <param name="runes">The runes to find in the stream</param> /// <returns>A parser string containing the read characters.</returns> public static ParserString ReadUntilAny(this ITextParser parser, params Rune[] runes) { return(parser.ReadUntilAny(runes, out _)); }
/// <summary> /// Read the string up to any <see cref="Rune"/> that is included in <paramref name="chars"/> or until EOF is reached. /// The matched character is put in <paramref name="matched"/>. /// </summary> /// <param name="parser">A parser on which to operate.</param> /// <param name="chars">The characters to find in the stream</param> /// <param name="matched">The character that was finally matched, or 0 if the end of the stream was reached.</param> /// <returns>A parser string containing the read characters.</returns> public static ParserString ReadUntilAny(this ITextParser parser, char[] chars, out ParserValue match) { return(parser.ReadUntilAny(chars.Select(c => new Rune(c)).ToArray(), out match)); }
/// <summary> /// Read the string up to any <see cref="Rune"/> that is included in <paramref name="chars"/> or until EOF is reached. /// The matched character is put in <paramref name="matched"/>. /// </summary> /// <param name="parser">A parser on which to operate.</param> /// <param name="chars">The characters to find in the stream</param> /// <returns>A parser string containing the read characters.</returns> public static ParserString ReadUntilAny(this ITextParser parser, params char[] chars) { return(parser.ReadUntilAny(chars, out _)); }