public static Pattern Then([DisallowNull] this String @char, [AllowNull] Pattern other) => new MemoryLiteral(@char).Then(other);
public static Pattern Then(this Char @char, [AllowNull] Pattern other) => new CharLiteral(@char).Then(other);
public static Pattern Then(this Rune rune, [AllowNull] Pattern other) => new RuneLiteral(rune).Then(other);
/// <summary> /// Concatenates the patterns so that this <see cref="Rune"/> comes before <paramref name="other"/> /// </summary> /// <param name="other">The succeeding <see cref="Pattern"/></param> /// <returns>A new <see cref="Pattern"/> concatenating this <see cref="Rune"/> and <paramref name="other"/></returns> public static Pattern Then(this Rune @Rune, Pattern other) { Guard.NotNull(other, nameof(other)); return(new RuneLiteral(@Rune).Concatenate(other)); }
public static Pattern Many([AllowNull] Pattern pattern) => pattern?.Many();
public static Pattern To(this String @string, [DisallowNull] Pattern to, [AllowNull] Pattern escape) => escape is not null ? new EscapedRanger(@string, to, escape) : new Ranger(@string, to);
/// <summary> /// Initialize a new <see cref="KleenesClosure"/> from the given <paramref name="pattern"/>. /// </summary> /// <param name="pattern">The <see cref="Patterns.Pattern"/> to be parsed.</param> internal KleenesClosure([DisallowNull] Pattern pattern) => Pattern = pattern;
public static Pattern To(this String @string, [DisallowNull] Pattern to) => new Ranger(@string, to);
public static Pattern ToNested(this Rune rune, [DisallowNull] Pattern to) => new NestedRanger(rune, to);
public static Pattern To(this Rune rune, [DisallowNull] Pattern to, [AllowNull] Pattern escape) => escape is not null ? new EscapedRanger(rune, to, escape) : new Ranger(rune, to);
public static Pattern ToNested(this Char @char, [DisallowNull] Pattern to) => new NestedRanger(@char, to);
public static Pattern To(this Char @char, [DisallowNull] Pattern to, [AllowNull] Pattern escape) => escape is not null ? new EscapedRanger(@char, to, escape) : new Ranger(@char, to);