Пример #1
0
        /// <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 void Consume(ReadOnlySpan <Char> source, ref Int32 location, [AllowNull, MaybeNull] out Exception exception, [AllowNull] IAdd <Capture> trace)
 {
     Left.Consume(source, ref location, out exception, trace);
     if (exception is not null)
     {
         return;
     }
     Right.Consume(source, ref location, out exception, trace);
 }
Пример #3
0
 /// <inheritdoc/>
 protected internal override void Consume(ReadOnlySpan <Char> source, ref Int32 location, [AllowNull, MaybeNull] out Exception exception, [AllowNull] IAdd <Capture> trace)
 {
     exception = null;
     for (Int32 i = 0; i < Count; i++)
     {
         Pattern.Consume(source, ref location, out exception, trace);
         if (exception is not null)
         {
             return;
         }
     }
 }