Beispiel #1
0
        internal static RangeDuration Parse(IniParser parser)
        {
            var token = parser.GetNextToken(IniParser.SeparatorsColon);

            if (parser.IsFloat(token))
            {
                var value = parser.ScanFloat(token);
                return(new RangeDuration
                {
                    Min = value,
                    Max = value
                });
            }

            if (token.Text.ToUpper() != "MIN")
            {
                throw new IniParseException($"Unexpected range duration: {token.Text}", token.Position);
            }

            var minValue = parser.ScanInteger(parser.GetNextToken());

            return(new RangeDuration
            {
                Min = minValue,
                Max = parser.ParseAttributeInteger("Max")
            });
        }