예제 #1
0
파일: Ranger.cs 프로젝트: Entomy/LibLangly
        /// <inheritdoc/>
        protected internal override void Consume(ReadOnlySpan <Char> source, ref Int32 location, [AllowNull, MaybeNull] out Exception exception, [AllowNull] IAdd <Capture> trace)
        {
            Int32 start = location;

            From.Consume(source, ref location, out exception, trace);
            if (exception is not null)
            {
                return;
            }
            To.Consume(source, ref location, out exception, trace);
            while (exception is not null)
            {
                if (++location == source.Length)
                {
                    break;
                }
                if (To.IsConsumeHeader(source, location))
                {
                    To.Consume(source, ref location, out exception, trace);
                }
            }
            if (exception is not null)
            {
                location  = start;
                exception = AtEnd;
            }
        }
예제 #2
0
 /// <inheritdoc/>
 protected internal override Boolean IsConsumeHeader(ReadOnlySpan <Char> source, Int32 location) => Pattern.IsConsumeHeader(source, location);
예제 #3
0
파일: Ranger.cs 프로젝트: Entomy/LibLangly
 /// <inheritdoc/>
 protected internal sealed override Boolean IsConsumeHeader(ReadOnlySpan <Char> source, Int32 location) => From.IsConsumeHeader(source, location);