jackfiled
cf19f8197e
Reviewed-on: https://git.bupt-hpc.cn/jackfiled/CanonSharp/pulls/3 Co-authored-by: jackfiled <xcrenchangjun@outlook.com> Co-committed-by: jackfiled <xcrenchangjun@outlook.com>
15 lines
509 B
C#
15 lines
509 B
C#
using CanonSharp.Combinator.Abstractions;
|
|
using CanonSharp.Combinator.Extensions;
|
|
using static CanonSharp.Combinator.Text.TextParserBuilder;
|
|
|
|
namespace CanonSharp.Combinator.Text;
|
|
|
|
public static class TextParserExtensions
|
|
{
|
|
public static IParser<char, T> SkipSpaces<T>(this IParser<char, T> parser)
|
|
=> Space().SkipTill(parser);
|
|
|
|
public static IParser<char, T> SkipSpaceAndLineBreak<T>(this IParser<char, T> parser)
|
|
=> (Space().Map(x => x.ToString()) | LineBreak()).SkipTill(parser);
|
|
}
|