2024-08-13 14:46:11 +08:00
|
|
|
using CanonSharp.Combinator.Abstractions;
|
|
|
|
using CanonSharp.Combinator.Extensions;
|
|
|
|
using static CanonSharp.Combinator.Text.TextParserBuilder;
|
|
|
|
|
|
|
|
namespace CanonSharp.Combinator.Text;
|
|
|
|
|
|
|
|
public static class TextParserExtensions
|
|
|
|
{
|
2024-08-18 12:01:27 +08:00
|
|
|
public static IParser<char, T> SkipSpaces<T>(this IParser<char, T> parser)
|
2024-08-13 14:46:11 +08:00
|
|
|
=> Space().SkipTill(parser);
|
|
|
|
|
2024-08-18 12:01:27 +08:00
|
|
|
public static IParser<char, T> SkipSpaceAndLineBreak<T>(this IParser<char, T> parser)
|
2024-08-13 14:46:11 +08:00
|
|
|
=> (Space().Map(x => x.ToString()) | LineBreak()).SkipTill(parser);
|
|
|
|
}
|