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) ); } }
internal int? Any(SourcePosn sourcePosn) => sourcePosn.Match(_any);
internal int? Number(SourcePosn sourcePosn) => sourcePosn.Match(_number);
internal int? WhiteSpace(SourcePosn sourcePosn) => sourcePosn.Match(_whiteSpaces);