15 lines
505 B
C#
15 lines
505 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 Parser<char, T> SkipSpaces<T>(this Parser<char, T> parser)
|
||
|
=> Space().SkipTill(parser);
|
||
|
|
||
|
public static Parser<char, T> SkipSpaceAndLineBreak<T>(this Parser<char, T> parser)
|
||
|
=> (Space().Map(x => x.ToString()) | LineBreak()).SkipTill(parser);
|
||
|
}
|