예제 #1
0
 int? IMatch.Match(SourcePosn sourcePosn)
 {
     var length = sourcePosn.Match(Target);
     if (length != null)
         OnMatch(sourcePosn.SubString(0, length.Value));
     else
         OnMismatch?.Invoke();
     return length;
 }
 public int? GuardedMatch(SourcePosn sourcePosn, IMatch match)
 {
     try
     {
         return sourcePosn.Match(match);
     }
     catch(Match.Exception exception)
     {
         throw new TwoLayerScanner.Exception
         (
             exception.SourcePosn,
             Convert(exception.Error)
         );
     }
 }
예제 #3
0
 internal int? Any(SourcePosn sourcePosn) => sourcePosn.Match(_any);
예제 #4
0
 internal int? Number(SourcePosn sourcePosn) => sourcePosn.Match(_number);
예제 #5
0
 internal int? WhiteSpace(SourcePosn sourcePosn) => sourcePosn.Match(_whiteSpaces);