public static ICapture <T> Last <T>(this ICapture <T> segment, int offset, int count)
 {
     return(segment.Slice(segment.Count + segment.Offset - offset, count));
 }
Exemple #2
0
 protected LexemeBase(TLexerRule lexerRule, ICapture <char> parentSegment, int offset)
 {
     ConcreteLexerRule = lexerRule;
     Capture           = parentSegment.Slice(offset, 0);
 }
 /// <summary>
 /// Returns an empty segment at the offset
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="segment"></param>
 /// <param name="offset"></param>
 /// <returns></returns>
 public static ICapture <T> Empty <T>(this ICapture <T> segment, int offset) => segment.Slice(offset, 0);