示例#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);