コード例 #1
0
        protected override void ComputeToken(int id, string name, PatternType type, string pattern, ExpressionContext context)
        {
            ExpressionParserOptions options = context.ParserOptions;

            char digitsBeforePattern = (options.RequireDigitsBeforeDecimalPoint ? '+' : '*');

            pattern = string.Format(CorePattern, digitsBeforePattern, options.DecimalSeparator);

            this.SetData(id, name, type, pattern);
        }
コード例 #2
0
ファイル: Real.cs プロジェクト: radtek/credit-card-exchange
        public static SingleLiteralElement Parse(string image, IServiceProvider services)
        {
            ExpressionParserOptions options = services.GetService(typeof(ExpressionParserOptions)) as ExpressionParserOptions;
            SingleLiteralElement    element = new SingleLiteralElement();

            try
            {
                float value = options.ParseSingle(image);
                return(new SingleLiteralElement(value));
            }
            catch (OverflowException)
            {
                element.OnParseOverflow(image);
                return(null);
            }
        }
コード例 #3
0
        protected override void ComputeToken(int id, string name, PatternType type, string pattern, ExpressionContext context)
        {
            ExpressionParserOptions options = context.ParserOptions;

            this.SetData(id, name, type, Convert.ToString(options.FunctionArgumentSeparator));
        }