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); }
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); } }
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)); }