コード例 #1
0
        private static DecimalLiteralElement?CreateDecimal(string image)
        {
            if (image.EndsWith("m", StringComparison.OrdinalIgnoreCase))
            {
                image = image.Remove(image.Length - 1);
                return(DecimalLiteralElement.Parse(image));
            }

            return(null);
        }
コード例 #2
0
 private static DecimalLiteralElement CreateDecimal(string image, IServiceProvider services)
 {
     if (image.EndsWith("m", StringComparison.OrdinalIgnoreCase) == true)
     {
         image = image.Remove(image.Length - 1);
         return(DecimalLiteralElement.Parse(image, services));
     }
     else
     {
         return(null);
     }
 }
コード例 #3
0
        private static LiteralElement?CreateImplicitReal(string image)
        {
            var realType = builderOptions.RealLiteralDataType;

            switch (realType)
            {
            case RealLiteralDataType.Double:
                return(DoubleLiteralElement.Parse(image));

            case RealLiteralDataType.Single:
                return(SingleLiteralElement.Parse(image));

            case RealLiteralDataType.Decimal:
                return(DecimalLiteralElement.Parse(image));

            default:
                Debug.Fail("Unknown value");
                return(null);
            }
        }
コード例 #4
0
        private static LiteralElement CreateImplicitReal(string image, IServiceProvider services)
        {
            ExpressionOptions   options  = (ExpressionOptions)services.GetService(typeof(ExpressionOptions));
            RealLiteralDataType realType = options.RealLiteralDataType;

            switch (realType)
            {
            case RealLiteralDataType.Double:
                return(DoubleLiteralElement.Parse(image, services));

            case RealLiteralDataType.Single:
                return(SingleLiteralElement.Parse(image, services));

            case RealLiteralDataType.Decimal:
                return(DecimalLiteralElement.Parse(image, services));

            default:
                Debug.Fail("Unknown value");
                return(null);
            }
        }