Пример #1
0
        public ReadResults Parse(IStringReader reader, DispatcherResources resources, out long result)
        {
            int         start       = reader.GetCursor();
            ReadResults readResults = reader.ReadLong(out result);

            if (readResults.Successful)
            {
                if (result < Minimum)
                {
                    reader.SetCursor(start);
                    return(ReadResults.Failure(CommandError.LongTooLow(result, Minimum).WithContext(reader)));
                }
                if (result > Maximum)
                {
                    reader.SetCursor(start);
                    return(ReadResults.Failure(CommandError.LongTooHigh(result, Maximum).WithContext(reader)));
                }
            }

            return(readResults);
        }